Example #1
0
        public PaymentToSupplierForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            PaymentToSupplierForm PQForm = new PaymentToSupplierForm();

            PQForm.PaymentToSupplierDetails = new List <PaymentToSupplierDetailsEntity>();
            PaymentToSupplierEntity model = new PaymentToSupplierEntity();

            //  this.ID = pqf.PaymentToSupplier.ID;
            model.SupplierID   = this.SelectedSupplierID;
            model.AccountId    = this.SelectedAccountID;
            model.Date         = DateTime.ParseExact(this.DateStr, oData.DateFormat, null);
            model.AmountStr    = this.AmountStr;
            model.Amount       = Convert.ToDecimal(this.AmountStr);
            model.IsCheque     = this.IsCheque;
            model.CashChequeNo = this.CashChequeNo;
            model.Remarks      = this.Remarks;
            if (this.IsChequeTrue == true)
            {
                model.IsCheque = true;
            }
            else
            {
                model.IsCheque = false;
            }

            PQForm.PaymentToSupplier = model;

            foreach (var item in PQDetailsEntity.Where(e => Convert.ToDecimal(e.AmountAdjustedStr) != 0))
            {
                PaymentToSupplierDetailsEntity pqEntity = new PaymentToSupplierDetailsEntity();

                pqEntity.PurchaseNo     = item.PurchaseNo;
                pqEntity.PurchaseDate   = item.PurchaseDate;
                pqEntity.PurchaseAmount = Convert.ToDecimal(item.PurchaseAmountStr);
                //item.PurchaseAmount=pqEntity.PurchaseAmount;
                if (item.PaymentDueDateStr != string.Empty)
                {
                    // pqEntity.PaymentDueDate = Convert.ToDateTime(item.PaymentDueDateStr);
                    pqEntity.PaymentDueDate = Utility.SimpleDateTime(item.PaymentDueDateStr);
                }
                else
                {
                    pqEntity.PaymentDueDate = null;
                }
                //pqEntity.AmountDueStr = Convert.ToString(item.AmountDue);
                pqEntity.AmountDue = Convert.ToDecimal(item.AmountDueStr);
                // pqEntity.AmountAdjustedStr = Convert.ToString(item.AmountAdjusted);
                pqEntity.AmountAdjusted = Convert.ToDecimal(item.AmountAdjustedStr);

                pqEntity.Discount = Convert.ToDecimal(item.DiscountStr);

                PQForm.PaymentToSupplierDetails.Add(pqEntity);
            }
            return(PQForm);
        }
Example #2
0
 private void GetPSData(object param)
 {
     if (SelectedSupplierID != null && SelectedSupplierID != 0)
     {
         PaymentToSupplierForm pqf = psRepository.GetNewPS(SelectedSupplierID);
         GetModelData(pqf);
     }
 }
Example #3
0
        private void GetPaymentToSupplierDetails(string cashChequeNo)
        {
            this.ListSuppliers = supplierRepository.GetAllSupplier().ToList();
            IsNew = false;
            PaymentToSupplierForm pqf = psRepository.GetPaymentToSupplierDetails(cashChequeNo);

            GetModelData(pqf);
        }
Example #4
0
        public PaymentToSupplierForm GetDataIntoModel()
        {
            PaymentToSupplierForm PQForm = new PaymentToSupplierForm();

            PQForm.PaymentToSupplierDetails = new List <PaymentToSupplierDetailsEntity>();
            PaymentToSupplierEntity model = new PaymentToSupplierEntity();

            //  this.ID = pqf.PaymentToSupplier.ID;
            model.SupplierID   = this.SelectedSupplierID;
            model.AccountId    = this.SelectedAccountID;
            model.Date         = this.Date;
            model.AmountStr    = this.AmountStr;
            model.Amount       = Convert.ToDecimal(this.AmountStr);
            model.IsCheque     = this.IsCheque;
            model.CashChequeNo = this.CashChequeNo;
            model.Remarks      = this.Remarks;
            if (this.IsChequeTrue == true)
            {
                model.IsCheque = true;
            }
            else
            {
                model.IsCheque = false;
            }

            PQForm.PaymentToSupplier = model;

            foreach (var item in PQDetailsEntity)
            {
                PaymentToSupplierDetailsEntity pqEntity = new PaymentToSupplierDetailsEntity();

                pqEntity.PurchaseNo     = item.PurchaseNo;
                pqEntity.PurchaseDate   = item.PurchaseDate;
                pqEntity.PurchaseAmount = Convert.ToDecimal(item.PurchaseAmountStr);
                //item.PurchaseAmount=pqEntity.PurchaseAmount;
                if (item.PaymentDueDateStr != string.Empty)
                {
                    pqEntity.PaymentDueDate = Convert.ToDateTime(item.PaymentDueDateStr);
                }
                else
                {
                    pqEntity.PaymentDueDate = null;
                }
                //pqEntity.AmountDueStr = Convert.ToString(item.AmountDue);
                pqEntity.AmountDue = Convert.ToDecimal(item.AmountDueStr);
                // pqEntity.AmountAdjustedStr = Convert.ToString(item.AmountAdjusted);
                pqEntity.AmountAdjusted = Convert.ToDecimal(item.AmountAdjustedStr);

                pqEntity.Discount = Convert.ToDecimal(item.DiscountStr);

                PQForm.PaymentToSupplierDetails.Add(pqEntity);
            }
            return(PQForm);
        }
Example #5
0
        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;
                PaymentToSupplierForm PSForm = GetDataIntoModel();
                string msg = ValidatePaymentToSupplier();
                if (msg != string.Empty)
                {
                    PSErrors             = msg;
                    Mouse.OverrideCursor = null;
                    return;
                }

                PSErrors = string.Empty;

                if (PSForm != null)
                {
                    if (IsNew == true)
                    {
                        int i = psRepository.SavePaymentToSupplier(PSForm);
                        IsSupplierEnabled = false;
                        IsTextBoxReadOnly = true;
                        IsNew             = false;
                    }
                    else
                    {
                        int i = psRepository.UpdatePaymentToSupplier(PSForm);
                        IsNew             = false;
                        IsSupplierEnabled = false;
                        IsTextBoxReadOnly = true;
                    }

                    Mouse.OverrideCursor = null;
                }
            }
        }
Example #6
0
        public int UpdatePaymentToSupplier(PaymentToSupplierForm psForm)
        {
            IPaymentToSupplierDAl psDAL = new PaymentToSupplierDAl();

            return(psDAL.UpdatePaymentToSupplier(psForm));
        }
Example #7
0
        public int UpdatePaymentToSupplier(PaymentToSupplierForm psForm)
        {
            IPaymentToSupplierBL psBL = new PaymentToSupplierBL();

            return(psBL.UpdatePaymentToSupplier(psForm));
        }