public frmLedger(frmLedgerList frm, Item item, bool copy) { InitializeComponent(); this.frmList = frm; lblTitle.Text = "Edit Ledger"; Layer.LedgerBL BL = new Layer.LedgerBL(); BL.LoadByPK(item.Value); sLedgerId = BL.LedgerId; txtDate.Text = BL.LedgerDate.ToString("yyyyMMdd"); txtDocu.Text = BL.LedgerDocu; txtDesc.Text = BL.LedgerDesc; txtRef.Text = BL.LedgerRef; foreach (Layer.LedgerDtlBL dtl in BL.dtls) { int i = grdDetail.Rows.Add(); grdDetail.Rows[i].Cells["cAccount"].Value = dtl.AccountCode; grdDetail.Rows[i].Cells["cDescription"].Value = dtl.LedgerDescription; grdDetail.Rows[i].Cells["cDebit"].Value = dtl.LedgerDebit.ToString("#,##0.00"); grdDetail.Rows[i].Cells["cCredit"].Value = dtl.LedgerCredit.ToString("#,##0.00"); grdDetail.Rows[i].Cells["cAmount"].Value = dtl.LedgerAmount.ToString("#,##0.00"); } LoadDescriptionList(); if (!copy) { this._IsAdd = false; btnAdd.Text = "Save"; } }
public frmLedger(frmLedgerList frm) { InitializeComponent(); this.frmList = frm; FormNew(); this._IsAdd = true; }
private void mEntry_Click(object sender, EventArgs e) { foreach (Form frmChild in this.MdiChildren) { if (frmChild.Name == "frmEntryList") { frmChild.Activate(); return; } //else //frmChild.Close(); } frmLedgerList frm = new frmLedgerList(); frm.MdiParent = this; frm.Show(); }