private void btnContraList_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Transaction.List.ContraVouchersList frmList = new Transaction.List.ContraVouchersList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillContraVoucherInfo(); }
private void btnUpdate_Click(object sender, EventArgs e) { ContraVoucherModel objcontra = new ContraVoucherModel(); if (tbxVoucherNo.Text.Trim() == "") { MessageBox.Show("Voucher Number Can Not Be Blank!"); return; } objcontra.Voucher_Series = tbxVoucherSeries.SelectedItem.ToString(); objcontra.Voucher_Number = Convert.ToInt64(tbxVoucherNo.Text.Trim()); objcontra.CV_Date = Convert.ToDateTime(dtDate.Text.Trim()); objcontra.PDCDate = Convert.ToDateTime(dtPdc.Text.Trim()); objcontra.Type = cbxType.SelectedItem.ToString(); objcontra.LongNarration = tbxLongNarration.Text.Trim(); objcontra.TotalCreditAmount = Convert.ToDecimal(colCredit.SummaryItem.SummaryValue); objcontra.TotalDebitAmount = Convert.ToDecimal(colDebit.SummaryItem.SummaryValue); //Contra Account Details AccountModel objacc; List <AccountModel> lstAccounts = new List <AccountModel>(); for (int i = 0; i < dvgContraDetails.DataRowCount; i++) { DataRow row = dvgContraDetails.GetDataRow(i); objacc = new AccountModel(); objacc.DC = row["DC"].ToString(); objacc.Account = row["Account"].ToString(); objacc.LedgerId = objAccBL.GetLedgerIdByAccountName(row["Account"].ToString()); objacc.Debit = Convert.ToDecimal(row["Debit"].ToString() == string.Empty ? "0.00" : row["Debit"].ToString()); objacc.Credit = Convert.ToDecimal(row["Credit"].ToString() == string.Empty ? "0.00" : row["Credit"].ToString()); objacc.Narration = row["Narration"].ToString() == null ? string.Empty : row["Narration"].ToString(); objacc.ParentId = Convert.ToInt32(row["ParentId"].ToString() == string.Empty ? "0" : row["ParentId"].ToString()); objacc.AC_Id = Convert.ToInt32(row["AC_Id"].ToString() == string.Empty ? "0" : row["AC_Id"].ToString()); lstAccounts.Add(objacc); } objcontra.ContraAccountModel = lstAccounts; objcontra.CV_Id = Contra_Id; bool isSuccess = objconBL.UpdateContraVoucher(objcontra); if (isSuccess) { MessageBox.Show("Update Successfully!"); Contra_Id = 0; ClearFormValues(); Transaction.List.ContraVouchersList frmList = new Transaction.List.ContraVouchersList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillContraVoucherInfo(); } }
private void btnDelete_Click(object sender, EventArgs e) { bool isDelete = objconBL.DeleteContraVoucher(Contra_Id); { MessageBox.Show("Delete Successfully!"); Contra_Id = 0; ClearFormValues(); Transaction.List.ContraVouchersList frmList = new Transaction.List.ContraVouchersList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillContraVoucherInfo(); } }