void Bttn_Click(object sender, EventArgs e) { if (sender == bttnPost) { UpdateRecord(); } else if (sender == bttnCancel) { tsbReload.PerformClick(); } else if (sender == bttnUpdate) { InsertUpdate(); } else if (sender == bttnReport) { strmonth = txtPeriod.Text.Substring(0, 2); //string fullmonth = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(strmonth); ; split = txtPeriod.Text.Trim().Split(new Char[] { '/' }); var dtf = CultureInfo.CurrentCulture.DateTimeFormat; //string monthName = dtf.GetMonthName(strmonth); var month = Convert.ToInt32(txtPeriod.Text.Substring(0, 2)); var fyear = txtPeriod.Text.Length; monthName = dtf.GetMonthName(month); xrTranAccount report = new xrTranAccount(); string fulltext = String.Format("Collection Reconciliation for : [{0} {1}]", monthName, Convert.ToInt32(split[1])); report.paramAccount.Value = cboAcct.Text; report.paramPeriod.Value = txtPeriod.Text; report.xrLabel1.Text = fulltext; report.xrLabel18.Text = String.Format("{0} - {1}", lblBank.Text, lblbranch.Text); report.ShowPreviewDialog(); } }
void bttnUpdate_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(cboAcct.Text)) { Common.setEmptyField("Account Number", Program.ApplicationName); cboAcct.Focus(); return; } else if (string.IsNullOrEmpty(cboPeriods.Text)) { Common.setEmptyField("Transaction Period", Program.ApplicationName); cboPeriods.Focus(); return; } else { strmonth = cboPeriods.Text.Substring(0, 2); //string fullmonth = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(strmonth); ; split = cboPeriods.Text.Trim().Split(new Char[] { '/' }); var dtf = CultureInfo.CurrentCulture.DateTimeFormat; //string monthName = dtf.GetMonthName(strmonth); var month = Convert.ToInt32(cboPeriods.Text.Substring(0, 2)); var fyear = cboPeriods.Text.Length; monthName = dtf.GetMonthName(month); xrTranAccount report = new xrTranAccount(); string fulltext = String.Format("Collection Reconciliation for : [{0} {1}]", monthName, Convert.ToInt32(split[1])); report.paramAccount.Value = cboAcct.Text; report.paramPeriod.Value = cboPeriods.Text; report.xrLabel1.Text = fulltext; report.xrLabel18.Text = String.Format("{0} - {1}", label4.Text, label5.Text); report.ShowPreviewDialog(); } }