public PayMoneyEntity GetDataIntoModel() { OptionsEntity oData = new OptionsEntity(); ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository(); oData = purchaseRepository.GetOptionSettings(); PayMoneyEntity model = new PayMoneyEntity(); model.SelectedLinkedAcntID = this.SelectedLinkedAcntID; model.SelectedCashBankAcntID = this.SelectedCashBankAcntID; model.CashChequeDate = DateTime.ParseExact(this.CashChequeDateStr, oData.DateFormat, null); model.CashChequeNo = this.CashChequeNo; model.TotalBeforeTaxStr = TotalBeforeTaxStr; model.TotalBeforeTax = Convert.ToDecimal(TotalBeforeTaxStr); model.TotalTaxStr = this.TotalTaxStr; model.TotalTax = Convert.ToDecimal(TotalTaxStr); model.TotalAfterTaxStr = this.TotalAfterTaxStr; model.TotalAfterTax = Convert.ToDecimal(TotalAfterTaxStr); model.SelectedTaxID = this.SelectedTaxID; model.TaxRate = this.TaxRate; model.Remarks = this.Remarks; model.IsCheque = this.IsCheque; return(model); }
public int SavePayMoney(PayMoneyEntity receiveMoney) { int autoId = 0; try { using (SASEntitiesEDM entities = new SASEntitiesEDM()) { PayMoney cbt = new PayMoney(); cbt.LinkedAccountID = receiveMoney.SelectedLinkedAcntID; cbt.CashBankAccountID = receiveMoney.SelectedCashBankAcntID; cbt.IsCheque = receiveMoney.IsCheque; cbt.CashChequeNo = receiveMoney.CashChequeNo; cbt.CashChequeDate = receiveMoney.CashChequeDate; cbt.Remarks = receiveMoney.Remarks; cbt.TaxID = receiveMoney.SelectedTaxID; cbt.TotalBeforeTax = receiveMoney.TotalBeforeTax; cbt.TotalTax = receiveMoney.TotalTax; cbt.TotalAfterTax = receiveMoney.TotalAfterTax; cbt.Remarks = receiveMoney.Remarks; cbt.CreatedBy = 1; cbt.CreatedDate = DateTime.Now; entities.PayMoneys.Add(cbt); entities.SaveChanges(); } } catch (Exception ex) { throw ex; } return(autoId); }
public PayMoneyEntity GetPayMoneyDetails(string cashChequeNo) { PayMoneyEntity receiveMoney = new PayMoneyEntity(); try { using (SASEntitiesEDM entities = new SASEntitiesEDM()) { PayMoney cbt = entities.PayMoneys.Where(e => e.CashChequeNo == cashChequeNo).SingleOrDefault(); if (cbt != null) { receiveMoney.ID = cbt.ID; receiveMoney.SelectedLinkedAcntID = cbt.LinkedAccountID; receiveMoney.SelectedCashBankAcntID = cbt.CashBankAccountID; receiveMoney.IsCheque = cbt.IsCheque; receiveMoney.CashChequeNo = cbt.CashChequeNo; receiveMoney.CashChequeDate = cbt.CashChequeDate; receiveMoney.Remarks = cbt.Remarks; receiveMoney.SelectedTaxID = cbt.TaxID; receiveMoney.TotalBeforeTax = cbt.TotalBeforeTax; receiveMoney.TotalTax = cbt.TotalTax; receiveMoney.TotalAfterTax = cbt.TotalAfterTax; receiveMoney.Remarks = cbt.Remarks; } } } catch (Exception ex) { throw ex; } return(receiveMoney); }
private void GetPayMoneyDetails(string cashChequeNo) { OptionsEntity oData = new OptionsEntity(); ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository(); oData = purchaseRepository.GetOptionSettings(); IsNew = false; IsTextBoxReadOnly = true; IsCashChequeEnabled = false; PayMoneyEntity pqf = rmRepository.GetPayMoneyDetails(cashChequeNo); DateTime Dateinstr = (DateTime)pqf.CashChequeDate; this.CashChequeDateStr = Dateinstr.ToString(oData.DateFormat); GetModelData(pqf); }
private void GetModelData(PayMoneyEntity rmf) { if (IsNew == false) { this.SelectedLinkedAcntID = rmf.SelectedLinkedAcntID; this.SelectedCashBankAcntID = rmf.SelectedCashBankAcntID; this.CashChequeNo = rmf.CashChequeNo; this.IsCheque = rmf.IsCheque; this.SelectedTaxID = rmf.SelectedTaxID; this.TotalBeforeTaxStr = Convert.ToString(rmf.TotalBeforeTax); this.TotalTaxStr = Convert.ToString(rmf.TotalTax); this.TotalAfterTaxStr = Convert.ToString(rmf.TotalAfterTax); this.Remarks = rmf.Remarks; } }
void OnSavePS(object param) { MessageBoxResult result = System.Windows.MessageBox.Show("Do you want to save changes?", "Save Confirmation", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { Mouse.OverrideCursor = Cursors.Wait; PayMoneyEntity rsEntity = GetDataIntoModel(); string msg = ValidateRefundFromSupplier(); if (msg != string.Empty) { PSErrors = msg; Mouse.OverrideCursor = null; return; } PSErrors = string.Empty; if (rsEntity != null) { if (IsNew == true) { int i = rmRepository.SavePayMoney(rsEntity); IsCashChequeEnabled = false; IsTextBoxReadOnly = true; IsNew = false; } else { int i = rmRepository.UpdatePayMoney(rsEntity); IsNew = false; IsCashChequeEnabled = false; IsTextBoxReadOnly = true; } Mouse.OverrideCursor = null; } } }
public int UpdatePayMoney(PayMoneyEntity receiveMoney) { int autoId = 0; try { using (SASEntitiesEDM entities = new SASEntitiesEDM()) { PayMoney cbt = entities.PayMoneys.SingleOrDefault(e => e.CashChequeNo == receiveMoney.CashChequeNo); if (cbt != null) { //cbt.ID = receiveMoney.ID; cbt.LinkedAccountID = receiveMoney.SelectedLinkedAcntID; cbt.CashBankAccountID = receiveMoney.SelectedCashBankAcntID; cbt.IsCheque = receiveMoney.IsCheque; cbt.CashChequeNo = receiveMoney.CashChequeNo; cbt.CashChequeDate = Convert.ToDateTime(receiveMoney.CashChequeDateStr); cbt.Remarks = receiveMoney.Remarks; cbt.TaxID = receiveMoney.SelectedTaxID; cbt.TotalBeforeTax = receiveMoney.TotalBeforeTax; cbt.TotalTax = receiveMoney.TotalTax; cbt.TotalAfterTax = receiveMoney.TotalAfterTax; cbt.Remarks = receiveMoney.Remarks; cbt.UpdatedBy = 1; cbt.UpdatedDate = DateTime.Now; entities.SaveChanges(); } } } catch (Exception ex) { throw ex; } return(autoId); }
public int UpdatePayMoney(PayMoneyEntity receiveMoney) { IPayMoneyDAL rmDAL = new PayMoneyDAL(); return(rmDAL.UpdatePayMoney(receiveMoney)); }
public int SavePayMoney(PayMoneyEntity receiveMoney) { IPayMoneyBL rmDAL = new PayMoneyBL(); return(rmDAL.SavePayMoney(receiveMoney)); }