private void grdUsage_CommandCellClick(object sender, EventArgs e) { string cntrNo = grdUsage.CurrentRow.Cells["tbl_usage.cntr_No"].Value.ToString(); string payBalance = grdUsage.CurrentRow.Cells["priceSum"].Value.ToString(); string custNo = grdUsage.CurrentRow.Cells["Cust_No"].Value.ToString(); string custName = grdUsage.CurrentRow.Cells["FName"].Value.ToString() + grdUsage.CurrentRow.Cells["LName"].Value.ToString(); int termNo = Convert.ToInt16(lstTermNo.SelectedItem.Text); if (grdUsage.CurrentColumn.Name == "cmdDelete") { if (MessageBox.Show("اطلاعات مربوط به این قبض حذف خواهند گردید. آیا تأیید می نمایید؟", "", MessageBoxButtons.YesNo) == DialogResult.Yes) { dataAccess.ExecuteAccess("delete from tbl_Usage where term_No = " + lstTermNo.SelectedItem.Text + " and cntr_No = " + cntrNo); lstTermNo_SelectedIndexChanged(null, null); } } else if (grdUsage.CurrentColumn.Name == "cmdPrintBill") { frmFastReport frmRep = new frmFastReport(this); frmRep.FastReportBill(termNo, cntrNo, txtBillDescription.Text); //frmRep.MdiParent = this; frmRep.Show(); } else if (grdUsage.CurrentColumn.Name == "cmdInstalment") { frmInstalmentInsertUpdate frmIns = new frmInstalmentInsertUpdate(cntrNo, termNo.ToString(), custNo, custName, payBalance); frmIns.ShowDialog(); } }
private void btnPrintCustomerList_Click(object sender, EventArgs e) { frmFastReport frmRep = new frmFastReport(this); frmRep.FastReportCustomerlList(); //frmRep.MdiParent = this; frmRep.Show(); }
private void btnTermDebtorList_Click(object sender, EventArgs e) { frmFastReport frmRep = new frmFastReport(this); frmRep.FastReportDebtorList(Convert.ToInt16(lstTermNo.SelectedItem.Text)); //frmRep.MdiParent = this; frmRep.Show(); }
private void btnTermBillPrint_Click(object sender, EventArgs e) { //DisableReporting(); frmFastReport frmRep = new frmFastReport(this); frmRep.FastReportBill(Convert.ToInt16(lstTermNo.SelectedItem.Text), txtBillDescription.Text); frmRep.Show(); #region Old Comment //frmRep.MdiParent = this; //string min = (DateTime.Now.Minute - tm.Minute).ToString(); //string sec = (DateTime.Now.Second - tm.Second).ToString(); //string msg = "محاسبات قبوض انجام گردید" + "\n"; //msg += "تعداد کل رکوردها " + billCount.ToString() + "\n"; //msg += "زمان محاسبات برای هر رکورد" + ((float)(DateTime.Now.Subtract(tm).TotalSeconds) / billCount).ToString().Substring(0, 4) + " ثانیه" + "\n"; //msg += "زمان کل محاسبات" + ((float)DateTime.Now.Subtract(tm).TotalMinutes).ToString().Substring(0,4) + " دقیقه و " + // (DateTime.Now.Subtract(tm).TotalSeconds - DateTime.Now.Subtract(tm).TotalMinutes * 60).ToString().Substring(0, 4) + " ثانیه"; //MessageBox.Show(msg,"گزارش محاسبات",MessageBoxButtons.OK,MessageBoxIcon.Information,MessageBoxDefaultButton.Button1,MessageBoxOptions.RightAlign,false); #endregion }
private void grdCust_CommandCellClick(object sender, EventArgs e) { if (grdCust.CurrentColumn.Name == "cmdDelete") { if (MessageBox.Show("تمامی اطلاعات مربوط به " + grdCust.SelectedRows[0].Cells["FName"].Value.ToString() + " " + grdCust.SelectedRows[0].Cells["LName"].Value.ToString() + " حذف خواهند گردید. آیا تأیید می نمایید؟", "", MessageBoxButtons.YesNo) == DialogResult.Yes) { dataAccess.ExecuteAccess("delete from tbl_usage where cntr_no = " + grdCust.SelectedRows[0].Cells["Cntr_No"].Value.ToString() + " and cust_no = " + grdCust.SelectedRows[0].Cells["Cust_No"].Value.ToString()); dataAccess.ExecuteAccess("delete from tbl_cust where cntr_no = " + grdCust.SelectedRows[0].Cells["Cntr_No"].Value.ToString() + " and cust_no = " + grdCust.SelectedRows[0].Cells["Cust_No"].Value.ToString()); dataAccess.ExecuteAccess("delete from tbl_payment where cntr_no = " + grdCust.SelectedRows[0].Cells["Cntr_No"].Value.ToString() + " and cust_no = " + grdCust.SelectedRows[0].Cells["Cust_No"].Value.ToString()); btnRefreshCust_Click(null, null); FillLstTermNo(); lstTermNo_SelectedIndexChanged(null, null); btnRefreshUsage_Click(null, null); btnRefreshPayment_Click(null, null); } } else if (grdCust.CurrentColumn.Name == "cmdUpdate") { frmCustInsertUpdate frm = new frmCustInsertUpdate(grdCust.SelectedRows[0].Cells["Cntr_No"].Value.ToString()); if (frm.ShowDialog() == DialogResult.OK) { btnRefreshCust_Click(null, null); btnRefreshUsage_Click(null, null); btnRefreshPayment_Click(null, null); } } else if (grdCust.CurrentColumn.Name == "cmdFinancialList") { frmFastReport frmRep = new frmFastReport(this); frmRep.FastReportFinancialList(grdCust.SelectedRows[0].Cells["Cntr_No"].Value.ToString(), grdCust.SelectedRows[0].Cells["FName"].Value.ToString() + " " + grdCust.SelectedRows[0].Cells["LName"].Value.ToString()); //frmRep.MdiParent = this; frmRep.Show(); } }