private void btnJournalList_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Transaction.List.JournalVouchersList frmList = new Transaction.List.JournalVouchersList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillJournalVoucherInfo(); }
private void btnUpdate_Click(object sender, EventArgs e) { JournalVoucherModel objJVmodel = new JournalVoucherModel(); if (tbxVchNo.Text.Trim() == "") { MessageBox.Show("Voucher Number Can Not Be Blank!"); return; } objJVmodel.Voucher_Series = tbxVoucherSeries.Text.Trim(); objJVmodel.JV_Date = Convert.ToDateTime(dtDate.Text); objJVmodel.Type = tbxType.Text.Trim() == null ? string.Empty : tbxType.Text.Trim(); objJVmodel.Voucher_Number = Convert.ToInt32(tbxVchNo.Text.Trim()); objJVmodel.PDCDate = Convert.ToDateTime(dtPDCDate.Text); objJVmodel.LongNarration = tbxLongNarration.Text.Trim() == null ? string.Empty : tbxLongNarration.Text.Trim(); objJVmodel.TotalCreditAmt = Convert.ToDecimal(colCredit.SummaryItem.SummaryValue); objJVmodel.TotalDebitAmt = Convert.ToDecimal(colDebit.SummaryItem.SummaryValue); //Journal details AccountModel objacc; List <AccountModel> lstAccounts = new List <AccountModel>(); for (int i = 0; i < gdvJournalDetails.DataRowCount; i++) { DataRow row = gdvJournalDetails.GetDataRow(i); objacc = new AccountModel(); objacc.DC = row["DC"].ToString(); objacc.LedgerId = objAccBL.GetLedgerIdByAccountName(row["Account"].ToString()); objacc.Account = row["Account"].ToString(); objacc.Debit = Convert.ToDecimal(row["Debit"].ToString() == string.Empty ? "0" : row["Debit"].ToString()); objacc.Credit = Convert.ToDecimal(row["Credit"].ToString() == string.Empty ? "0" : row["Credit"].ToString()); objacc.Narration = row["Narration"].ToString() == string.Empty ? string.Empty : row["Narration"].ToString(); objacc.AC_Id = Convert.ToInt32(row["AC_Id"].ToString() == string.Empty ? "0" : row["AC_Id"].ToString()); objacc.ParentId = Convert.ToInt32(row["ParentId"].ToString() == string.Empty ? "0" : row["ParentId"].ToString()); lstAccounts.Add(objacc); } objJVmodel.JournalAccountModel = lstAccounts; objJVmodel.JV_Id = Convert.ToInt32(Journl_Id); bool isSuccess = objJVbal.UpdateJournalVoucher(objJVmodel); if (isSuccess) { MessageBox.Show("Update Successfully!"); Journl_Id = 0; ClearFormValues(); Transaction.List.JournalVouchersList frmList = new Transaction.List.JournalVouchersList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillJournalVoucherInfo(); } }
private void btnDelete_Click(object sender, EventArgs e) { bool isDelete = objJVbal.DeletJournalVoucher(Journl_Id); { MessageBox.Show("Delete Successfully!"); Journl_Id = 0; ClearFormValues(); Transaction.List.JournalVouchersList frmList = new Transaction.List.JournalVouchersList(); frmList.StartPosition = FormStartPosition.CenterScreen; frmList.ShowDialog(); FillJournalVoucherInfo(); } }