public AdjustDebitNoteForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

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

            PQForm.AdjustDebitNoteDetails = new List <AdjustDebitNoteDetailsEntity>();
            AdjustDebitNoteEntity model = new AdjustDebitNoteEntity();

            //  this.ID = pqf.AdjustDebitNote.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;
            model.DebitNoteNo           = this.DebitNoteNo;
            model.AdjustDebitNoteNumber = this.AdjustDebitNoteNumber;
            model.AdjustDebitNoteDate   = DateTime.ParseExact(this.AdjustDebitNoteDateStr, oData.DateFormat, null);
            if (this.IsChequeTrue == true)
            {
                model.IsCheque = true;
            }
            else
            {
                model.IsCheque = false;
            }

            PQForm.AdjustDebitNote = model;

            foreach (var item in PQDetailsEntity.Where(e => !(string.IsNullOrEmpty(e.AmountAdjustedStr))))
            {
                AdjustDebitNoteDetailsEntity pqEntity = new AdjustDebitNoteDetailsEntity();

                pqEntity.PurchaseNo     = item.PurchaseNo;
                pqEntity.PurchaseDate   = item.PurchaseDate;
                pqEntity.PurchaseAmount = Convert.ToDecimal(item.PurchaseAmountStr);
                //item.PurchaseAmount=pqEntity.PurchaseAmount;
                //pqEntity.PaymentDueDate = Convert.ToDateTime(item.PaymentDueDateStr);
                pqEntity.PaymentDueDate = DateTime.ParseExact(item.PaymentDueDateStr, "dd'/'MM'/'yy", CultureInfo.InvariantCulture);
                //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);
                pqEntity.CheckAmountAdjusted = item.CheckAmountAdjusted;

                PQForm.AdjustDebitNoteDetails.Add(pqEntity);
            }
            return(PQForm);
        }
Ejemplo n.º 2
0
        public AdjustDebitNoteForm GetDataIntoModel()
        {
            AdjustDebitNoteForm PQForm = new AdjustDebitNoteForm();

            PQForm.AdjustDebitNoteDetails = new List <AdjustDebitNoteDetailsEntity>();
            AdjustDebitNoteEntity model = new AdjustDebitNoteEntity();

            //  this.ID = pqf.AdjustDebitNote.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;
            model.DebitNoteNo = this.DebitNoteNo;
            if (this.IsChequeTrue == true)
            {
                model.IsCheque = true;
            }
            else
            {
                model.IsCheque = false;
            }

            PQForm.AdjustDebitNote = model;

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

                pqEntity.PurchaseNo     = item.PurchaseNo;
                pqEntity.PurchaseDate   = item.PurchaseDate;
                pqEntity.PurchaseAmount = Convert.ToDecimal(item.PurchaseAmountStr);
                //item.PurchaseAmount=pqEntity.PurchaseAmount;
                //pqEntity.PaymentDueDate = Convert.ToDateTime(item.PaymentDueDateStr);
                pqEntity.PaymentDueDate = DateTime.ParseExact(item.PaymentDueDateStr, "dd'/'MM'/'yyyy", CultureInfo.InvariantCulture);
                //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);
                pqEntity.CheckAmountAdjusted = item.CheckAmountAdjusted;

                PQForm.AdjustDebitNoteDetails.Add(pqEntity);
            }
            return(PQForm);
        }