protected void lbtnEdit_Click(object sender, EventArgs e) { GetAllAccounts(); LinkButton lbtn = (LinkButton)sender; GridViewRow gvr = (GridViewRow)lbtn.NamingContainer; var val = gvr.DataItemIndex; var id = Convert.ToInt32(gvr.Cells[0].Text); MinorAccounttbl ma = new MinorAccounttbl(); ma.MinorAccountID = id; List <MinorAccounttbl> lst = new List <MinorAccounttbl>(); lst = objMinorAccountBL.GetMinorAccountById(ma).ToList(); foreach (var el in lst) { hdnMinorAccountID.Value = el.MinorAccountID.ToString(); DdlMajorAccount.SelectedValue = el.MajorAccountID.ToString(); txtMinorAccount.Text = el.MinorAccountName; txtMinorAccountCode.Text = el.MinorAccountCode.ToString(); txtAmount.Text = el.Amount.ToString(); } btnSave.Visible = false; btnUpdate.Visible = true; //GetState(); //GetAllAccounts(); }
protected string GetMinorAccounts(int maid) { List <MinorAccounttbl> lstMinor = new List <MinorAccounttbl>(); MinorAccounttbl Mn = new MinorAccounttbl(); MinorAccountBL objMinorAccountBL = new MinorAccountBL(); Mn.Status = 1; lstMinor = objMinorAccountBL.GetMinorAccountByStatus(Mn).ToList(); ListItem mn = new ListItem(); mn.Text = "--Select--"; mn.Value = 0.ToString(); ddlMinorAccountList.Items.Add(mn); foreach (var nt in lstMinor) { ListItem lc = new ListItem(); lc.Text = nt.MinorAccountName; lc.Value = nt.MinorAccountID.ToString(); ddlMinorAccountList.Items.Add(lc); } var minor = lstMinor.OfType <MinorAccounttbl>().Where(a => a.MinorAccountID == maid); //return minor.First().MinorAccountName; return(minor.Count() > 0 ? minor.First().MinorAccountName : ""); }
protected void GetAllMinorAccount() { MinorAccounttbl ls = new MinorAccounttbl(); List <MinorAccounttbl> lst = new List <MinorAccounttbl>(); lst = objMinorAccountBL.GetAllMinorAccount(ls).ToList(); gdvMinorAccount.DataSource = lst; gdvMinorAccount.DataBind(); btnUpdate.Visible = false; }
protected string GetMinorAccounts(int maid) { List <MinorAccounttbl> lstMinor = new List <MinorAccounttbl>(); MinorAccounttbl Mn = new MinorAccounttbl(); MinorAccountBL objMinorAccountBL = new MinorAccountBL(); lstMinor = objMinorAccountBL.GetAllMinorAccount(Mn).ToList(); var minor = lstMinor.OfType <MinorAccounttbl>().Where(d => d.MinorAccountID == maid); //return minor.First().MinorAccountName; return(minor.Count() > 0 ? minor.First().MinorAccountName : ""); }
protected void ddlMinorAccountList_SelectedIndexChanged(object sender, EventArgs e) { List <MinorAccounttbl> lstMinor = new List <MinorAccounttbl>(); MinorAccounttbl Mn = new MinorAccounttbl(); MinorAccountBL objMinorAccountBL = new MinorAccountBL(); Mn.Status = 1; Mn.MinorAccountID = Convert.ToInt32(ddlMinorAccountList.SelectedValue); lstMinor = objMinorAccountBL.GetMinorAccountById(Mn).ToList(); txtCurrentBal.Text = lstMinor[0].Amount.ToString(); }
protected void lbtnActive_Click(object sender, EventArgs e) { LinkButton lbtn = (LinkButton)sender; GridViewRow gvr = (GridViewRow)lbtn.NamingContainer; var val = gvr.DataItemIndex; var status = gvr.Cells[5].Text; MinorAccounttbl ma = new MinorAccounttbl(); ma.MinorAccountID = Convert.ToInt32(gvr.Cells[0].Text); if (status == "Active") { ma.Status = 0; } else if (status == "InActive") { ma.Status = 1; } objMinorAccountBL.UpdateMinorAccountIsActive(ma); GetAllMinorAccount(); }
protected void GetMinorAccounts() { List <MinorAccounttbl> lstMinor = new List <MinorAccounttbl>(); MinorAccounttbl Mn = new MinorAccounttbl(); MinorAccountBL objMinorAccountBL = new MinorAccountBL(); Mn.Status = 1; lstMinor = objMinorAccountBL.MajorAccountIDByStatus(Mn).ToList(); ListItem mn = new ListItem(); mn.Text = "--Select--"; mn.Value = 0.ToString(); ddlMinorAccountList.Items.Add(mn); foreach (var nt in lstMinor) { ListItem lc = new ListItem(); lc.Text = nt.MinorAccountName; lc.Value = nt.MinorAccountID.ToString(); ddlMinorAccountList.Items.Add(lc); } }
protected void btnSave_Click(object sender, EventArgs e) { MinorAccounttbl ma = new MinorAccounttbl(); ma.MinorAccountName = txtMinorAccount.Text; ma.MinorAccountCode = string.IsNullOrEmpty(txtMinorAccountCode.Text) ? 0 : Convert.ToInt32(txtMinorAccountCode.Text); ma.MajorAccountID = Convert.ToInt32(DdlMajorAccount.SelectedValue); ma.Amount = string.IsNullOrEmpty(txtAmount.Text) ? 0 : Convert.ToInt32(txtAmount.Text); ma.Status = 1; ma.CreatedBy = 1; ma.CreatedDate = DateTime.Now.ToString("yyyy-MM-dd"); List <MinorAccounttbl> lst = new List <MinorAccounttbl>(); lst = objMinorAccountBL.SaveMinorAccount(ma).ToList(); ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Minor Account Saved Successfully');", true); Clear(); GetAllMinorAccount(); DdlMajorAccount.SelectedIndex = 0; //Response.Redirect("MinorAccountList.aspx"); }
protected void ddlMAccountList_SelectedIndexChanged(object sender, EventArgs e) { List <MinorAccounttbl> lstMinor = new List <MinorAccounttbl>(); MinorAccounttbl Mn = new MinorAccounttbl(); MinorAccountBL objMinorAccountBL = new MinorAccountBL(); Mn.Status = 1; Mn.MajorAccountID = Convert.ToInt32(ddlMAccountList.SelectedValue); lstMinor = objMinorAccountBL.MajorAccountIDByStatus(Mn).ToList(); ddlMinorAccountList.Items.Clear(); ListItem mn = new ListItem(); mn.Text = "--Select--"; mn.Value = 0.ToString(); ddlMinorAccountList.Items.Add(mn); foreach (var nt in lstMinor) { ListItem lc = new ListItem(); lc.Text = nt.MinorAccountName; //lc.Text = nt..ToString(); lc.Value = nt.MinorAccountID.ToString(); ddlMinorAccountList.Items.Add(lc); } }
protected void btnUpdate_Click(object sender, EventArgs e) { MinorAccounttbl ma = new MinorAccounttbl(); ma.MinorAccountID = Convert.ToInt32(hdnMinorAccountID.Value); ma.MinorAccountName = txtMinorAccount.Text; ma.MinorAccountCode = Convert.ToInt32(txtMinorAccountCode.Text); ma.MajorAccountID = Convert.ToInt32(DdlMajorAccount.SelectedValue); //ma.Amount = Convert.ToInt32(txtAmount.Text); // ma.Status = 1; ma.UpdatedBy = 1; ma.UpdatedDate = DateTime.Now.ToString("yyyy-MM-dd"); List <MinorAccounttbl> lst = new List <MinorAccounttbl>(); lst = objMinorAccountBL.UpdateMinorAccount(ma).ToList(); ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('MinorAccount Updated Successfully');", true); Clear(); btnUpdate.Visible = false; btnSave.Visible = true; GetAllMinorAccount(); GetAllAccountsMajorActive(); }
protected void InsertPayments() { AccPaymentstbl pa = new AccPaymentstbl(); { //pa.PaymentType = ddlPaymentType.SelectedValue; pa.VoucherNo = txtVoucherNumber.Text; pa.MajorAccount = ddlMAccountList.Text; pa.MinorAccount = ddlMinorAccountList.Text; pa.PaymentDate = txtPaymentDate.Text; pa.ToAccount = ddlToAccount.SelectedValue; pa.PaymentThrough = ddlPaymentThrough.SelectedValue; pa.FromAccount = ddlFromAccount.SelectedValue; pa.CurrentBalance = txtCurrentBal.Text; pa.PayingAmount = txtPayingAmount.Text; pa.PaymentMode = ddlPaymentMode.SelectedValue; if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 1) { pa.CdNo = txtChequeNo.Text; pa.CdDate = txtChequeDate.Text; pa.AcNo = txtAcNo.Text; pa.BankName = txtBankName.Text; } else if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 2) { pa.CdNo = txtDDNo.Text; pa.CdDate = txtDDDate.Text; pa.AcNo = txtAcNo.Text; pa.BankName = txtBankName.Text; } else if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 3) { pa.CardNo = txtCardNo.Text; pa.TransactionDate = txtTransactionDate.Text; pa.ReferenceNo = txtReferenceNo.Text; } else if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 4) { pa.TransactionDate = txtTransactionDate.Text; pa.ReferenceNo = txtReferenceNo.Text; } pa.Narration = txtNarration.Text; pa.AttachFiles = BrowseFile.FileName; pa.Status = 1; pa.CreatedBy = 1; pa.CreatedDate = DateTime.Now.ToString(" yyyy-MM-dd HH:mm:ss"); } MinorAccountBL objMinorAccountBL = new MinorAccountBL(); MinorAccounttbl mt = new MinorAccounttbl(); mt.MinorAccountID = Convert.ToInt32(ddlMinorAccountList.SelectedValue); mt.Amount = string.IsNullOrEmpty(txtTotalBalance.Text) ? 0 : Convert.ToInt32(txtTotalBalance.Text); List <MinorAccounttbl> lstMinor = new List <MinorAccounttbl>(); lstMinor = objMinorAccountBL.UpdateMinorAccountAmount(mt).ToList(); List <AccPaymentstbl> lst = new List <AccPaymentstbl>(); lst = objPaymentstBL.InsertPayments(pa).ToList(); ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Payments Saved Successfully');", true); btnSave.Visible = true; Reset(); }
public IEnumerable <MinorAccounttbl> GetAllMinorAccount(MinorAccounttbl ls) { return(objMinorAccountDA.MinorAccountAll(1, ls)); }
public IEnumerable <MinorAccounttbl> DeleteMinorAccount(MinorAccounttbl ls) { return(objMinorAccountDA.MinorAccountAll(5, ls)); }
protected void BtnSave_Click(object sender, EventArgs e) { AccReceiptstbl ls = new AccReceiptstbl //MinorAccounttbl MA = new MinorAccounttbl; { VoucherNo = txtVoucherNo.Text, MajorAccount = ddlMAccountList.Text, MinorAccount = ddlMinorAccountList.Text, ReceiveDate = txtReceiveDate.Text, FromAccount = DdlFromAccount.Text, ReceivedThrough = DdlReceivedThrough.Text, ToAccount = DdlToAccount.Text, CurrentBalance = txtCurrentBalance.Text, ReceivingAmount = txtReceivingAmount.Text, PaymentMode = DdlPaymentMode.Text, //Comment = txtCommentsReason.Text, Narration = txtNarration.Text, AttachFiles = UploadDoc.FileName, ChequeNo = string.IsNullOrEmpty(txtChequeNo.Text) ? 0 : Convert.ToInt32(txtChequeNo.Text), ChequeDate = txtChequeDate.Text, DDNO = string.IsNullOrEmpty(txtDDNo.Text) ? 0 : Convert.ToInt32(txtDDNo.Text), Date = txtDate.Text, AccountNO = txtAccountNo.Text, BankName = txtBankName.Text, CardNo = txtCardNo.Text, TransactionDate = txtTransactionDate.Text, ReferenceNo = txtReferenceNo.Text, Status = 1, CreatedBy = 1, CreatedDate = DateTime.Now.ToString(" yyyy-MM-dd HH:mm:ss") }; //AccReceiptInVoicestbl lv = new AccReceiptInVoicestbl //{ // Status = 1, // CreatedBy = 1, // CreatedDate = DateTime.Now.ToString(" yyyy-MM-dd HH:mm:ss") //}; List <AccReceiptstbl> lst = new List <AccReceiptstbl>(); lst = objAccReceiptsBL.SaveAccReceipt(ls).ToList(); MinorAccountBL objMinorAccountBL = new MinorAccountBL(); MinorAccounttbl mt = new MinorAccounttbl(); mt.MinorAccountID = Convert.ToInt32(ddlMinorAccountList.SelectedValue); mt.Amount = string.IsNullOrEmpty(txtABalance.Text) ? 0 : Convert.ToInt32(txtABalance.Text); List <MinorAccounttbl> lstMinor = new List <MinorAccounttbl>(); lstMinor = objMinorAccountBL.UpdateMinorAccountAmount(mt).ToList(); //List<AccReceiptInVoicestbl> lstIV = new List<AccReceiptInVoicestbl>(); //lstIV = objAccReceiptsInVoicesBL.SaveAccReceiptInVoices(lv).ToList(); ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('AccountReciept Saved Successfully');", true); Clear(); //UploadFile(); if (UploadDoc.HasFile == false) { } else { UploadFile(); } }
public IEnumerable <MinorAccounttbl> UpdateMinorAccountAmount(MinorAccounttbl ls) { return(objMinorAccountDA.MinorAccountAll(9, ls)); }
public IEnumerable <MinorAccounttbl> GetMinorAccountByStatus(MinorAccounttbl ls) { return(objMinorAccountDA.MinorAccountAll(8, ls)); }
public IEnumerable <MinorAccounttbl> UpdateMinorAccountStatus(MinorAccounttbl ls) { return(objMinorAccountDA.MinorAccountAll(7, ls)); }
public IEnumerable <MinorAccounttbl> UpdateMinorAccountIsActive(MinorAccounttbl ls) { return(objMinorAccountDA.MinorAccountAll(6, ls)); }
public IEnumerable <MinorAccounttbl> GetMinorAccountById(MinorAccounttbl ls) { return(objMinorAccountDA.MinorAccountAll(2, ls)); }
public IEnumerable <MinorAccounttbl> MajorAccountIDByStatus(MinorAccounttbl ls) { return(objMinorAccountDA.MinorAccountAll(10, ls)); }
public IEnumerable <MinorAccounttbl> SaveMinorAccount(MinorAccounttbl ls) { return(objMinorAccountDA.MinorAccountAll(3, ls)); }