How to remove calendar icon from DateField - ext.net

How do I remove/hide the calendar icon from the DateField in Ext.net? I need the input only through directly editing the text.
DateField dtPlanDate = new DateField {
ID = "dtPlanDate",
FieldLabel = Strings.PlanDate,
LabelAlign = LabelAlign.Top,
ToolTip = "Enter Date",
Value = DateTime.Today,
MinDate = DateTime.Today,
MaxDate = DateTime.Today.AddDays(1),
StartDay = (int)DayOfWeek.Monday,
};

Simple !!!
Add one more property "HideTrigger" and set it to "true"
DateField dtPlanDate = new DateField {
ID = "dtPlanDate",
FieldLabel = Strings.PlanDate,
LabelAlign = LabelAlign.Top,
ToolTip = "Enter Date",
Value = DateTime.Today,
MinDate = DateTime.Today,
MaxDate = DateTime.Today.AddDays(1),
StartDay = (int)DayOfWeek.Monday,
HideTrigger=true
};
Thanks

Related

DocuSign REST API full name tag

I am creating an envelope using DocuSign REST API with two recipients. Each recipient has two sets of tags - sign here tag and a full name tag.
When an envelope gets created, the sign here tags are showing up correctly for both recipients but the the full name tags for the second recipient is showing up for the first recipient.
I am passing the correct document id and recipient id for both tags in the API request.
Adding my code here..
Public Function SetSignerProperties(ByVal signer As Recipient) As DocuSign.eSign.Model.Signer
Dim dssigner As New DocuSign.eSign.Model.Signer
If Not signer Is Nothing Then
dssigner.Name = signer.name
dssigner.Email = signer.email
dssigner.AccessCode = signer.accesscode
dssigner.AddAccessCodeToEmail = signer.addAccessCodeToEmail
dssigner.Note = signer.note
dssigner.RoutingOrder = signer.routingOrder
dssigner.RecipientId = signer.recipientrecid
If signer.IsCaptiveRecipient Then
dssigner.ClientUserId = signer.recipientrecid
dssigner.EmbeddedRecipientStartURL = signer.embeddedRecipientStartURL
End If
'set up the signer tabs..
AddRecipientTags(signer, dssigner)
End If
Return dssigner
End Function
Public Function AddRecipientTags(ByVal recp As Recipient, ByVal signer As DocuSign.eSign.Model.Signer)
If Not signer Is Nothing Then
If Not recp.tabs Is Nothing Then
signer.Tabs = New DocuSign.eSign.Model.Tabs
For Each currtab In recp.tabs
Select Case currtab.tabType
Case "Sign Here"
'it is a signer tab..
If signer.Tabs.SignHereTabs Is Nothing Then
signer.Tabs.SignHereTabs = New List(Of DocuSign.eSign.Model.SignHere)
End If
Dim signheretab As New DocuSign.eSign.Model.SignHere
If Not currtab.anchorIgnoreIfNotPresent Is Nothing Then
signheretab.AnchorIgnoreIfNotPresent = currtab.anchorIgnoreIfNotPresent
End If
signheretab.AnchorString = currtab.anchorString
signheretab.AnchorUnits = currtab.anchorUnits
signheretab.AnchorXOffset = currtab.anchorXOffset
signheretab.AnchorYOffset = currtab.anchorYOffset
signheretab.ConditionalParentLabel = currtab.conditionalParentLabel
signheretab.ConditionalParentValue = currtab.conditionalParentValue
signheretab.Name = currtab.name
signheretab.Optional = currtab.toptional
signheretab.PageNumber = currtab.pageNumber
signheretab.RecipientId = currtab.recipientId
signheretab.ScaleValue = currtab.scaleValue
signheretab.TabId = currtab.tabId
signheretab.TabLabel = currtab.tabLabel
signheretab.TabOrder = currtab.tabOrder
signheretab.XPosition = currtab.xPosition
signheretab.YPosition = currtab.yPosition
signheretab.DocumentId = currtab.documentId
signer.Tabs.SignHereTabs.Add(signheretab)
Case "Full Name"
If signer.Tabs.FullNameTabs Is Nothing Then
signer.Tabs.FullNameTabs = New List(Of DocuSign.eSign.Model.FullName)
End If
Dim tab As New DocuSign.eSign.Model.FullName
If Not currtab.anchorIgnoreIfNotPresent Is Nothing Then
tab.AnchorIgnoreIfNotPresent = currtab.anchorIgnoreIfNotPresent
End If
tab.AnchorString = currtab.anchorString
tab.AnchorUnits = currtab.anchorUnits
tab.AnchorXOffset = currtab.anchorXOffset
tab.AnchorYOffset = currtab.anchorYOffset
If Not currtab.bold Is Nothing Then
tab.Bold = currtab.bold
End If
tab.ConditionalParentLabel = currtab.conditionalParentLabel
tab.ConditionalParentValue = currtab.conditionalParentValue
tab.DocumentId = currtab.documentId
tab.Font = currtab.font
tab.FontColor = currtab.fontColor
tab.FontSize = currtab.fontSize
tab.PageNumber = currtab.pageNumber
tab.RecipientId = currtab.recipientId
tab.Name = currtab.name
tab.TabId = currtab.tabId
tab.TabLabel = currtab.tabLabel
tab.TabOrder = currtab.tabOrder
tab.XPosition = currtab.xPosition
tab.YPosition = currtab.yPosition
If Not currtab.underline Is Nothing Then
tab.Underline = currtab.underline
End If
signer.Tabs.FullNameTabs.Add(tab)
End Select
Next
End If
End If
End Function
Please advise,
Thanks,
Minal

How to create a new customer via code

Hello how do I add a new customer with a default contact in my process in code behind.
So far I have this but I need to create a contact object link the two somehow.
PX.Objects.AR.Customer m = new PX.Objects.AR.Customer();
m.AcctCD = "Test1";
m.AcctName = "Joe Bloggs";
m.Type = "CU";
Customers.Insert(m);
Persist();
CustomerMaint graph = PXGraph.CreateInstance<CustomerMaint>();
Customer cust = new Customer();
cust.AcctName = "Company Name";
cust = (Customer)graph.CurrentCustomer.Insert(cust);
Address addr = (Address)graph.Addresses.Current;
addr.AddressLine1 = "Address 1";
addr.AddressLine2 = "Address 2";
addr.City = "City";
addr.State = "State";
addr.PostalCode = "Zip";
addr.CountryID = "Country";
graph.Addresses.Update(addr);
Contact contact = (Contact)graph.DefContact.Current;
contact.ContactType = ContactTypesAttribute.BAccountProperty;
contact.FirstName = "FirstName";
contact.LastName = "Last Name";
contact.EMail = "emaiL#email.com";
contact.WebSite = "www.website.com";
contact.Phone1 = "1234567890";
contact.Fax = "1234567890";
graph.DefContact.Update(contact);
graph.Actions.PressSave();
This what I did seems to work good. Got instance of the customermaint graph. Insert new Customer into currentcustomer and edit current def contact.
PX.Objects.AR.CustomerMaint graph = PXGraph.CreateInstance<PX.Objects.AR.CustomerMaint>();
PX.Objects.AR.Customer m = new PX.Objects.AR.Customer();
m.AcctCD = "Test4";
m.AcctName = "Jo Bloggs";
m.Type = "CU";
graph.CurrentCustomer.Insert(m);
PX.Objects.CR.Contact c = graph.DefContact.Current;
c.ContactType = "AP";
c.FullName = "Joe Bloggs";
c.EMail = "joe#Bloggs.com";
graph.Actions.PressSave();

OutOfMemory exception in dataGridView

I am using 2 datagridview to see the data in a windows form application.
The first DGV show the products according to the ids passed to them.
On click of VIEW as of my one column in DGV1, it passes the product id to and fetch the complete records from database and show the records to the other DGV2.
this is my code:
if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value == (Object)"View")
{
if (con.State == ConnectionState.Closed)
{
con.Open();
}
int prod_id = Convert.ToInt16(dataGridView1.Rows[e.RowIndex].Cells[0].Value);
dataGridView2.DataSource = null;
dataGridView2.Rows.Clear();
retFindProducts = new MySqlCommand("SELECT DISTINCT tf_history.thefind_id, tf_product.product_id, tf_product.`name`, tf_product.product_url, tf_product.image_tpm, tf_product.image_thefind, tf_product.image_accuracy, (SELECT MIN(tf_h.price) FROM tf_history AS tf_h WHERE tf_h.thefind_id = tf_history.thefind_id) as price, oc_product.price AS priceTPM FROM tf_product LEFT JOIN tf_history ON tf_product.product_id = tf_history.product_id AND tf_product.thefind_id = tf_history.thefind_id LEFT JOIN oc_product ON tf_product.product_id = oc_product.product_id WHERE tf_product.product_id = #product_id", con);
historyData = new MySqlCommand("SELECT price, date from tf_history WHERE thefind_id = #thefind_id", con);
retFindProducts.CommandTimeout = 300;
historyData.CommandTimeout = 300;
retFindProducts.Parameters.AddWithValue("#product_id", prod_id);
dr = retFindProducts.ExecuteReader();
retFindProducts.Parameters.Clear();
while (dr.Read())
{
dataGridView2.Rows.Add();
long fI = Convert.ToInt64(dr["thefind_id"]);
//if (!findId.Exists(p => p.Item1 == fI))
findId.Add(new Tuple<long>(fI));
decimal findPrice = Convert.ToDecimal(dr["price"]);
decimal tpmPrice = Convert.ToDecimal(dr["priceTPM"]);
if (findPrice > tpmPrice)
{
dataGridView2.Rows[cnt].Cells[4].Style.ForeColor = Color.Green;
dataGridView2.Rows[cnt].Cells[4].Style.Font = new Font(dataGridView2.DefaultCellStyle.Font.FontFamily, 9, FontStyle.Regular);
}
else if (findPrice < tpmPrice)
{
dataGridView2.Rows[cnt].Cells[4].Style.ForeColor = Color.Red;
dataGridView2.Rows[cnt].Cells[4].Style.Font = new Font(dataGridView2.DefaultCellStyle.Font.FontFamily, 10, FontStyle.Bold);
}
dataGridView2.Rows[cnt].Cells[0].Value = Image.FromFile(dr["image_tpm"].ToString());
dataGridView2.Rows[cnt].Cells[1].Value = Image.FromFile(dr["image_thefind"].ToString());
dataGridView2.Rows[cnt].Cells[2].Value = dr["name"].ToString();
dataGridView2.Rows[cnt].Cells[3].Value = dr["product_url"].ToString();
dataGridView2.Rows[cnt].Cells[4].Value = dr["price"].ToString();
dataGridView2.Rows[cnt].Cells[5].Value = dr["image_accuracy"].ToString();
cnt++;
}
foreach (DataGridViewRow row in dataGridView2.Rows)
{
row.Height = 60;
}
dr.Close();
}
Now, the outofexception does not comes on first time of the click, but it comes after 5-8 clicks on the VIEW column of DGV1.
How can i clear up the memory?
Try to dispose and create datagridview manually. The Code can be like this:
dgv.Dispose();
dgv = new DataGridView();
DataGridViewColumn col1 = new DataGridViewTextBoxColumn();
DataGridViewColumn col2 = new DataGridViewTextBoxColumn();
DataGridViewColumn col3 = new DataGridViewTextBoxColumn();
DataGridViewColumn col4 = new DataGridViewTextBoxColumn();
DataGridViewColumn col5 = new DataGridViewTextBoxColumn();
col1.HeaderText = "COl1";
col2.HeaderText = "COl2";
col3.HeaderText = "COl3";
col4.HeaderText = "COl4";
col5.HeaderText = "COl5";
dgv = new System.Windows.Forms.DataGridView();
dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dgv.Location = new System.Drawing.Point(59, 101);
dgv.Name = "dataGridView1";
dgv.Size = new System.Drawing.Size(240, 150);
dgv.TabIndex = 2;
dgv.Columns.Add(col1);
dgv.Columns.Add(col2);
dgv.Columns.Add(col3);
dgv.Columns.Add(col4);
dgv.Columns.Add(col5);
this.Controls.Add(dgv);
dgv.ColumnCount = 5;
dgv.Visible = true;

Columns get combined in .Net Column charts

I am working in .Net Charts. I am trying to generate a Column chart. I am having two rows in my dataset. Here is my code.
DataTable DT1 = new DataTable();
DT1 = chartViewSummaryList;
DataView DV = DT1.DefaultView;
DV.ToTable(false, new string[] { "REVENUE_TOTAL", "WEEK_END_DATE" });
DataSet ds = new DataSet();
ds.Tables.Add(DT1.Copy());
ds.Tables[0].Rows[0]["MARGIN"] = "0";
ds.Tables[0].Rows[0]["REVENUE_TOTAL"] = "3776169.61";
ds.Tables[0].Rows[0]["MARGIN_PCT"] = "0";
ds.Tables[0].Rows[0]["VISIT_REVENUE_AVG"] = "29.28";
ds.Tables[0].Rows[0]["VISIT_COUNT"] = "614041";
ds.Tables[0].Rows[0]["REVENUE_SALE"] = "1840387.18";
ds.Tables[0].Rows[0]["REVENUE_REGULAR"] = "1935782.43";
ds.Tables[0].Rows[0]["WEEK_END_DATE"] = "1/1/2012 12:00:00 AM";
ds.Tables[0].Rows.Add();
ds.Tables[0].Rows[1]["MARGIN"] = "1";
ds.Tables[0].Rows[1]["REVENUE_TOTAL"] = "5776169.61";
ds.Tables[0].Rows[1]["MARGIN_PCT"] = "0";
ds.Tables[0].Rows[1]["VISIT_REVENUE_AVG"] = "49.28";
ds.Tables[0].Rows[1]["VISIT_COUNT"] = "814041";
ds.Tables[0].Rows[1]["REVENUE_SALE"] = "3840387.18";
ds.Tables[0].Rows[1]["REVENUE_REGULAR"] = "3935782.43";
ds.Tables[0].Rows[1]["WEEK_END_DATE"] = "1/1/2012 12:00:00 AM";
Chart1.DataSource = ds;
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
Chart1.Titles.Add(storeLevelCaption).Font = new System.Drawing.Font("Verdana", 11, FontStyle.Bold);
Chart1.ChartAreas["ChartArea1"].AxisX.Title = "Weeks";
Chart1.ChartAreas["ChartArea1"].AxisX.TitleFont = new System.Drawing.Font("Verdana", 10, FontStyle.Bold);
Chart1.ChartAreas["ChartArea1"].AxisX.LabelStyle.Font = new Font(new FontFamily("Verdana"), 7.25F, FontStyle.Bold);
string series = "Series" + i;
Chart1.Series.Add(series);
Chart1.Series[series].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Column;
Chart1.Series[series].XValueMember = "WEEK_END_DATE";
Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;
Color color = System.Drawing.ColorTranslator.FromHtml("#B93B8F");
Chart1.Series[series].Color = color;
Chart1.ChartAreas["ChartArea1"].AxisY.Title = "Total Revenue";
Chart1.ChartAreas["ChartArea1"].AxisY.TitleFont = new System.Drawing.Font("Verdana", 10, FontStyle.Bold);
Chart1.ChartAreas["ChartArea1"].AxisY.LabelStyle.Font = new Font(new FontFamily("Verdana"), 7.25F, FontStyle.Bold);
Chart1.Series[series].YValueMembers = "REVENUE_TOTAL";
Chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false;
Chart1.Series[series].ToolTip = "Total Revenue ($) , " + ds.Tables[0].Rows[i]["WEEK_END_DATE"].ToString() + " , " + ds.Tables[0].Rows[i]["REVENUE_TOTAL"].ToString();
Chart1.Series[series].Font = new Font(new FontFamily("Verdana"), 7.25F, FontStyle.Bold);
//Chart1.Series[series].Name = "Total Revenue";
}
Chart1.ChartAreas[0].AxisY.Interval = 1;
Chart1.DataBind();
I am getting the chart, where two column combined together and displayed as one column. Where i had gone wrong...
I can't reproduce your problem using the WinForm charting assemblies. However you may want to try using distinct dates since they are bound to your X values.
ds.Tables[0].Rows[0]["WEEK_END_DATE"] = "1/1/2012 12:00:00 AM";
ds.Tables[0].Rows[1]["WEEK_END_DATE"] = "8/1/2012 12:00:00 AM"; // a different date
FYI, I changed your code minimaly
// DT1 = chartViewSummaryList;
// replace unknown object with this code
DT1.Columns.Add(new DataColumn("MARGIN"));
DT1.Columns.Add(new DataColumn("REVENUE_TOTAL"));
DT1.Columns.Add(new DataColumn("MARGIN_PCT"));
DT1.Columns.Add(new DataColumn("VISIT_REVENUE_AVG"));
DT1.Columns.Add(new DataColumn("VISIT_COUNT"));
DT1.Columns.Add(new DataColumn("REVENUE_SALE"));
DT1.Columns.Add(new DataColumn("REVENUE_REGULAR"));
DT1.Columns.Add(new DataColumn("WEEK_END_DATE"));
and also added a row manually
ds.Tables.Add(DT1.Copy());
ds.Tables[0].Rows.Add(); // Added this
and got two columns from your plotting code.

How to create a field of format dd/yyyy?

The field is like a DateField but instead its value is just the month and the year like '05/2011' : how to create such a field ?
In java-me, you can use the java.util.Calendar package for formatting the date.
Here is snippet from this tutorial on displaying the date and time in Java ME:
private void outputDateUsingCalendar(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
StringBuffer sb = new StringBuffer();
int day = calendar.get(Calendar.DAY_OF_MONTH);
sb.append(numberToString(day));
sb.append("-");
int month = calendar.get(Calendar.MONTH) + 1;
sb.append(numberToString(month));
sb.append("-");
sb.append(calendar.get(Calendar.YEAR));
StringItem item = new StringItem("Using Calendar", sb.toString());
mainForm.append(item);
}

Resources