public void  GetJournalDetails(string JNo)
        {
            OptionsEntity oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();
            oData = purchaseRepository.GetOptionSettings();
            string obj = JNo.ToString();
            JournalForm JObj = journalRepository.GetJournalDetails(obj);
            this.JournalNo = JObj.JournalData.JournalNo;
            DateTime Dateinstr = (DateTime)JObj.JournalData.JournalDate;
            this.JournalDateStr = Dateinstr.ToString(oData.DateFormat);
            this.JournalDetailsEntity = new ObservableCollection<JGridViewModel>();
            this.sumCredit =Convert.ToString(JObj.JournalaDataDetails.Sum(x => x.Credit));
            this.sumDebit = Convert.ToString(JObj.JournalaDataDetails.Sum(x => x.Debit));

            foreach (var item in JObj.JournalaDataDetails)
            {
                JGridViewModel pqEntity = new JGridViewModel(JournalList);
                pqEntity.ID = item.ID;
                pqEntity.JournalDateStr = item.JournalDateStr;
                pqEntity.Credit = item.Credit;
                pqEntity.Debit = item.Debit;
                
                JournalDetailsEntity.Add(pqEntity);
            }
        }
        public JournalForm GetDataIntoModel()
        {
            OptionsEntity oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();
            oData = purchaseRepository.GetOptionSettings();
            JournalForm JForm = new JournalForm();
            JForm.JournalaDataDetails= new List<JournalFormEntity>();
            JournalFormEntity model = new JournalFormEntity();
            model.JournalNo = this.JournalNo;
            model.JournalDate = DateTime.ParseExact(this.JournalDateStr, oData.DateFormat, null);

            JForm.JournalData = model;

            foreach (var item in JournalDetailsEntity)
            {
                if (item.ID != null)
                {
                    JournalFormEntity jEntity = new JournalFormEntity();
                    jEntity.ID = item.ID;
                    jEntity.JournalDateStr = item.JournalDateStr;
                    jEntity.Credit = item.Credit;
                    jEntity.Debit = item.Debit;
                    if (item.ID != 0 && Convert.ToInt32(item.ID) > 0)
                    {
                        JForm.JournalaDataDetails.Add(jEntity);
                    }
                }
            }

            return JForm;
        }
Example #3
0
        public TransferMoneyEntity GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            TransferMoneyEntity model = new TransferMoneyEntity();

            model.SelectedtransferFromCashAndBankAcntID = this.SelectedtransferFromCashAndBankAcntID;
            model.SelectedtransferToCashBankAcntID      = this.SelectedtransferToCashBankAcntID;
            model.CashChequeDate = DateTime.ParseExact(this.CashChequeDateStr, oData.DateFormat, null);
            model.CashChequeNo   = this.CashChequeNo;
            model.AmountStr      = AmountStr;
            model.Amount         = Convert.ToDecimal(AmountStr);
            model.TransferFromBeforeBalanceStr = this.TransferFromBeforeBalanceStr;
            model.TransferFromBeforeBalance    = Convert.ToDecimal(TransferFromBeforeBalance);
            model.TransferFromAfterBalanceStr  = this.TransferFromAfterBalanceStr;
            model.TransferFromAfterBalance     = Convert.ToDecimal(TransferFromAfterBalance);
            model.TransferToBeforeBalanceStr   = this.TransferToBeforeBalanceStr;
            model.TransferToBeforeBalance      = Convert.ToDecimal(TransferToBeforeBalance);
            model.TransferToAfterBalanceStr    = this.TransferToAfterBalanceStr;
            model.TransferToAfterBalance       = Convert.ToDecimal(TransferToAfterBalance);
            model.TaxRate  = this.TaxRate;
            model.Remarks  = this.Remarks;
            model.IsCheque = this.IsCheque;

            return(model);
        }
Example #4
0
        void GetOptionsandTaxValues()
        {
            OptionsEntity oData = new OptionsEntity();

            oData = pandsRepository.GetOptionDetails();
            if (oData != null)
            {
                this.CurrencyName = oData.CurrencyCode;     //there is no currency name field in database

                this.DateFormat    = oData.DateFormat;
                this.DecimalPlaces = oData.DecimalPlaces;
            }
            else
            {
                this.CurrencyName = "USD";
                this.DateFormat   = "dd/MM/yyyy";
            }

            var objDefaultTax = pandsRepository.GetTaxes().FirstOrDefault();

            if (objDefaultTax != null)
            {
                this.TaxName = objDefaultTax.TaxName;
            }
            else
            {
                this.TaxName = "GST";
            }
        }
        public PaymentFromCustomerForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

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

            PQForm.PaymentFromCustomerDetails = new List <PaymentFromCustomerDetailsEntity>();
            PaymentFromCustomerEntity model = new PaymentFromCustomerEntity();

            //  this.ID = pqf.PaymentFromCustomer.ID;
            model.CustomerID = this.SelectedCustomerID;
            model.AccountId  = this.SelectedAccountID;
            //model.DateStr = this.DateStr;
            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.PaymentFromCustomer = model;

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

                pqEntity.SalesNo     = item.SalesNo;
                pqEntity.SalesDate   = item.SalesDate;
                pqEntity.SalesAmount = Convert.ToDecimal(item.SalesAmountStr);
                //item.SalesAmount=pqEntity.SalesAmount;
                if (item.PaymentDueDateStr != string.Empty)
                {
                    // pqEntity.PaymentDueDate = Convert.ToDateTime(item.PaymentDueDateStr);
                    pqEntity.PaymentDueDate = Utility.SimpleDateTime(item.PaymentDueDateStr);   //Sunil Sharma
                }
                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.PaymentFromCustomerDetails.Add(pqEntity);
            }
            return(PQForm);
        }
Example #6
0
        /// <summary>
        /// 获取optionnamelist
        /// </summary>
        /// <param name="entity">clientID  必传,optionName非必传</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="rowCount"></param>
        /// <returns></returns>
        public OptionsViewEntity[] GetOptionNameList(OptionsEntity entity, string ClientID, string ClientDistributorID, int pageIndex, int pageSize, out int rowCount)
        {
            List <IWhereCondition> wheres = new List <IWhereCondition>();

            if (entity != null && !string.IsNullOrEmpty(entity.OptionName))
            {
                wheres.Add(new LikeCondition()
                {
                    FieldName = "OptionName", HasLeftFuzzMatching = true, HasRightFuzzMathing = true, Value = entity.OptionName
                });
            }
            wheres.Add(new EqualsCondition()
            {
                FieldName = "ClientID", Value = entity.ClientID
            });
            List <OrderBy> orderbys = new List <OrderBy>();

            orderbys.Add(new OrderBy()
            {
                FieldName = "ClientID", Direction = OrderByDirections.Desc
            });
            orderbys.Add(new OrderBy()
            {
                FieldName = "CreateTime", Direction = OrderByDirections.Desc
            });
            PagedQueryResult <OptionsViewEntity> pEntity = new OptionsDAO(this.CurrentUserInfo).GetOptionNameList(wheres.ToArray(), ClientID, ClientDistributorID, orderbys.ToArray(), pageIndex, pageSize);

            rowCount = pEntity.RowCount;
            return(pEntity.Entities);
        }
        void GetOptionsandTaxValues()
        {
            OptionsEntity oData = new OptionsEntity();
            IPurchaseInvoiceListRepository purchaseRepository = new PurchaseInvoiceListRepository();

            oData = purchaseRepository.GetOptionSettings();
            if (oData != null)
            {
                this.CurrencyName = oData.CurrencyCode;     //there is no currency name field in database
            }
            else
            {
                this.CurrencyName = "USD";
                this.DateFormat   = "dd/MM/yyyy";
            }

            TaxModel objDefaultTax = new TaxModel();

            objDefaultTax = purchaseRepository.GetDefaultTaxes().FirstOrDefault();
            if (objDefaultTax != null)
            {
                this.TaxName = objDefaultTax.TaxName;
                //this.TaxName = objDefaultTax.TaxRate;
            }
            else
            {
                this.TaxName = "GST";
                //this.TaxRate = 0;
            }
        }
Example #8
0
        public bool AddEditOptions(OptionsEntity optionsEntity)
        {
            IOptionsDAL OptionsDetails = new OptionsDAL();
            bool        result         = OptionsDetails.AddEditOptions(optionsEntity);

            return(result);
        }
Example #9
0
        public OptionsEntity GetOptionDetails()
        {
            IOptionsDetailsBL optionDAL  = new OptionsDetailsBL();
            OptionsEntity     lstOptions = optionDAL.GetOptionsDetails();

            return(lstOptions);
        }
Example #10
0
        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);
        }
Example #11
0
        void GetOptionsandTaxValues()
        {
            OptionsEntity oData = new OptionsEntity();
            ICustomerPaymentDueDaysRepository paymentRepository = new CustomerPaymentDueDaysRepository();

            oData = paymentRepository.GetOptionSettings();
            if (oData != null)
            {
                this.CurrencyName   = oData.CurrencyCode;   //there is no currency name field in database
                this.CurrencyCode   = oData.CurrencyCode;
                this.CurrencyFormat = oData.NumberFormat;
                this.DecimalPlaces  = oData.DecimalPlaces;
            }
            else
            {
                this.CurrencyName   = "USD";
                this.CurrencyCode   = "USD";
                this.CurrencyFormat = "en-US";
            }
            TaxModel objDefaultTax = new TaxModel();

            objDefaultTax = paymentRepository.GetDefaultTaxes().FirstOrDefault();
            if (objDefaultTax != null)
            {
                this.TaxName = objDefaultTax.TaxName;
            }
            else
            {
                this.TaxName = "GST";
            }
        }
Example #12
0
        private void AdjustCreditNotes(string AdjustedNo)
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();

            IsNew = false;
            AdjustCreditNoteForm pqf = psRepository.AdjustCreditNoteDetails(AdjustedNo);

            pqf.AdjustCreditNote.Amount      = Math.Abs(decimal.Parse(pqf.AdjustCreditNote.Amount.ToString()));
            pqf.AdjustCreditNote.AmountStr   = Math.Abs(decimal.Parse(pqf.AdjustCreditNote.AmountStr)).ToString();
            pqf.AdjustCreditNote.MustCompare = true;
            if (pqf.AdjustCreditNote.AdjustCreditNoteDate == null)
            {
                this.AdjustCreditNoteDateStr = "";
            }
            else
            {
                DateTime Dateinstr = (DateTime)pqf.AdjustCreditNote.AdjustCreditNoteDate;
                this.AdjustCreditNoteDateStr = Dateinstr.ToString(oData.DateFormat);
            }

            GetModelData(pqf);
        }
        /// <summary>
        /// To add or edit options table
        /// </summary>
        /// <param name="optionEntity"></param>
        /// <returns></returns>
        public bool AddEditOptions(OptionsEntity optionEntity)
        {
            IOptionsBL optionsBL = new OptionsBL();
            bool       result    = optionsBL.AddEditOptions(optionEntity);

            return(result);
        }
        public OptionsEntity GetOptionsDetails()
        {
            IOptionsBL    optionsBL = new OptionsBL();
            OptionsEntity result    = optionsBL.GetOptionsDetails();

            return(result);
        }
        void GetOptionsandTaxValues()
        {
            OptionsEntity oData = new OptionsEntity();
            IPandSCostPriceListRepository pandsRepository = new PandSCostPriceListRepository();

            oData = pandsRepository.GetOptionDetails();
            if (oData != null)
            {
                this.CurrencyName   = oData.CurrencyCode;   //there is no currency name field in database
                this.CurrencyCode   = oData.CurrencyCode;
                this.CurrencyFormat = oData.NumberFormat;
                this.DateFormat     = oData.DateFormat;
                this.DecimalPlaces  = oData.DecimalPlaces;
                if (oData.ShowAmountIncGST == true)
                {
                    this.ShowIncTaxTrue = true;
                    this.ShowExcTaxTrue = false;
                    //int decimalpoints = Convert.ToInt32(DecimalPlaces);
                    //foreach (var item in this.PurchaseQuotationList)
                    //{
                    //    item.QuotationAmount = Math.Round(Convert.ToDouble(item.QuotationAmount), decimalpoints).ToString();
                    //}
                    //this.PurchaseQuotationList = this.PurchaseQuotationList.Where(x => x.ExcIncGST == true).ToList();
                }
                else
                {
                    this.ShowIncTaxTrue = false;
                    this.ShowExcTaxTrue = true;
                    int decimalpoints = Convert.ToInt32(DecimalPlaces);
                    //foreach (var item in this.PurchaseQuotationList)
                    //{
                    //    //item.QuotationAmount = item.QuotationAmountExcGST;
                    //    //item.QuotationAmount = Math.Round(Convert.ToDouble(item.QuotationAmountExcGST), decimalpoints).ToString();
                    //    item.QuotationAmount = Math.Round(Convert.ToDouble(item.QuotationAmount), decimalpoints).ToString();
                    //}
                    //commented on 23 May 2017
                    //if (this.PurchaseQuotationList != null)
                    //    this.PurchaseQuotationList = this.PurchaseQuotationList.Where(x => x.ExcIncGST == false).ToList();
                }
            }
            else
            {
                this.CurrencyName   = "USD";
                this.CurrencyCode   = "USD";
                this.CurrencyFormat = "en-US";
                this.DateFormat     = "dd/MM/yyyy";
            }
            var objDefaultTax = pandsRepository.GetTaxes().FirstOrDefault();

            if (objDefaultTax != null)
            {
                this.TaxName = objDefaultTax.TaxName;
            }
            else
            {
                this.TaxName = "GST";
            }
        }
Example #16
0
        private string GetOptionByName(string name, int definedID)
        {
            OptionsEntity oEntity = new OptionsEntity();

            oEntity.ClientID   = CurrentUserInfo.ClientID;
            oEntity.OptionName = name;
            oEntity.DefinedID  = definedID;
            return(new OptionsBLL(CurrentUserInfo).GetOptionByName(oEntity).ToJSON());
        }
Example #17
0
 /// <summary>
 /// 通过optionname删除option
 /// </summary>
 /// <param name="entity"> clientID optionName 必传</param>
 public void DeleteOptionByName(OptionsEntity entity)
 {
     if (!string.IsNullOrEmpty(entity.ClientID) && entity.ClientID != "0")
     {
         return;
     }
     OptionsEntity[] pEntity = this.GetOptionByName(entity);
     this.Delete(pEntity);
 }
        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);
        }
Example #19
0
        public void GetCountAndAdjustStock(string scNo)
        {
            // Mouse.OverrideCursor = Cursors.Wait;
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            CountAndAdjustStockForm pqf = casRepository.GetCountAndAdjustStock(scNo);

            this.StockCountNo = pqf.CountAndAdjustStock.StockCountNo;
            DateTime Dateinstr = (DateTime)pqf.CountAndAdjustStock.StockDate;

            this.StockDateStr = Dateinstr.ToString(oData.DateFormat);

            if (pqf.CountAndAdjustStock.Type == Convert.ToInt16(Stock_Type.IncreaseDecreaseStock))
            {
                IsIncreaseDecreaseStock = true;
                IsStockDamaged          = false;
                IsStockTake             = false;
                SharedValues.StockType  = Convert.ToInt16(Stock_Type.IncreaseDecreaseStock);
            }
            else if (pqf.CountAndAdjustStock.Type == Convert.ToInt16(Stock_Type.StockDamaged))
            {
                IsIncreaseDecreaseStock = false;
                IsStockDamaged          = true;
                IsStockTake             = false;
                SharedValues.StockType  = Convert.ToInt16(Stock_Type.StockDamaged);
            }
            else if (pqf.CountAndAdjustStock.Type == Convert.ToInt16(Stock_Type.StockTake))
            {
                IsIncreaseDecreaseStock = false;
                IsStockDamaged          = false;
                IsStockTake             = true;
                SharedValues.StockType  = Convert.ToInt16(Stock_Type.StockTake);
            }

            this.PSDetailsEntity = new ObservableCollection <DataGridViewModel>();
            foreach (var item in pqf.CountAndAdjustStockDetails)
            {
                DataGridViewModel pqEntity = new DataGridViewModel(ProductList);
                pqEntity.SelectedPSID = item.PSID;
                pqEntity.PandSCode    = item.PandSCode;
                pqEntity.PandSName    = item.PandSName;
                pqEntity.SystemQty    = item.SystemQty;
                pqEntity.CountQty     = item.CountQty;
                pqEntity.Difference   = item.Difference;

                pqEntity.AvgCost   = Convert.ToString(item.AverageCost);
                pqEntity.Amount    = item.Amount;
                pqEntity.AmountStr = item.AmountStr;

                PSDetailsEntity.Add(pqEntity);
            }
        }
Example #20
0
        public CountAndAdjustStockForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            CountAndAdjustStockForm CSForm = new CountAndAdjustStockForm();

            CSForm.CountAndAdjustStockDetails = new List <CountAndAdjustStockDetailsEntity>();
            CountAndAdjustStockEntity model = new CountAndAdjustStockEntity();

            model.StockCountNo = this.StockCountNo;
            model.StockDate    = DateTime.ParseExact(this.StockDateStr, oData.DateFormat, null);

            if (IsIncreaseDecreaseStock == true)
            {
                model.StockType = Convert.ToByte(Stock_Type.IncreaseDecreaseStock);
            }
            if (IsStockDamaged == true)
            {
                model.StockType = Convert.ToByte(Stock_Type.StockDamaged);
            }
            if (IsStockTake == true)
            {
                model.StockType = Convert.ToByte(Stock_Type.StockTake);
            }

            CSForm.CountAndAdjustStock = model;

            foreach (var item in PSDetailsEntity.Where(e => e.CountQty != 0))
            {
                if (item.SelectedPSID != 0)
                {
                    CountAndAdjustStockDetailsEntity pqEntity = new CountAndAdjustStockDetailsEntity();
                    pqEntity.PSID              = item.SelectedPSID;
                    pqEntity.PandSCode         = item.PandSCode;
                    pqEntity.PandSName         = item.PandSName;
                    pqEntity.SystemQty         = item.SystemQty;
                    pqEntity.CountQty          = item.CountQty;
                    pqEntity.Difference        = item.Difference;
                    pqEntity.AvgCost           = item.AvgCost;
                    pqEntity.Amount            = item.Amount;
                    pqEntity.AdjustedAmount    = Convert.ToDecimal(AdjustedAmountStr);
                    pqEntity.AdjustedAmountStr = AdjustedAmountStr;
                    if (item.SelectedPSID != 0 && Convert.ToInt32(item.SelectedPSID) > 0)
                    {
                        CSForm.CountAndAdjustStockDetails.Add(pqEntity);
                    }
                }
            }
            return(CSForm);
        }
        void GetOptionsandTaxValues()
        {
            OptionsEntity             oData           = new OptionsEntity();
            ICreditNoteListRepository SalesRepository = new CreditNoteListRepository();

            oData = SalesRepository.GetOptionSettings();
            if (oData != null)
            {
                this.CurrencyName   = oData.CurrencyCode;   //there is no currency name field in database
                this.CurrencyCode   = oData.CurrencyCode;
                this.CurrencyFormat = oData.NumberFormat;
                this.DateFormat     = oData.DateFormat;
                this.DecimalPlaces  = oData.DecimalPlaces;
                if (oData.ShowAmountIncGST == true)
                {
                    this.IncludingGSTTrue  = true;
                    this.IncludingGSTFalse = false;
                }
                else
                {
                    this.IncludingGSTTrue  = false;
                    this.IncludingGSTFalse = true;
                    int decimalpoints = Convert.ToInt32(DecimalPlaces);

                    if (this.CreditNoteList != null)
                    {
                        this.CreditNoteList = this.CreditNoteList.OrderBy(x => x.CustomerName).ToList();
                    }
                }
            }
            else
            {
                this.CurrencyName   = "USD";
                this.CurrencyCode   = "USD";
                this.CurrencyFormat = "en-US";
                this.DateFormat     = "dd/MM/yyyy";
            }

            TaxModel objDefaultTax = new TaxModel();

            objDefaultTax = SalesRepository.GetDefaultTaxes();
            if (objDefaultTax != null)
            {
                this.TaxName = objDefaultTax.TaxName;
                //this.TaxName = objDefaultTax.TaxRate;
            }
            else
            {
                this.TaxName = "GST Free";
                //this.TaxRate = 0;
            }
        }
Example #22
0
        private string Delete(int definedID)
        {
            string        res    = "[{success:false}]";
            OptionsEntity entity = new OptionsEntity();

            entity.DefinedID = definedID;
            entity.ClientID  = CurrentUserInfo.ClientID;
            //这里为单个删除
            new OptionsDefinedBLL(CurrentUserInfo).Delete(definedID, null);
            new OptionsBLL(CurrentUserInfo).DeleteOptionByName(entity);
            res = "[{success:true}]";
            return(res);
        }
Example #23
0
        private void GetRefundToCustomerDetails(string cashChequeNo)
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            IsNew = false;
            RefundToCustomerForm pqf       = psRepository.GetRefundToCustomerDetails(cashChequeNo);
            DateTime             Dateinstr = (DateTime)pqf.RefundToCustomer.Date;

            this.DateStr = Dateinstr.ToString(oData.DateFormat);
            GetModelData(pqf);
        }
        public RefundFromSupplierForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

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

            PQForm.RefundFromSupplierDetails = new List <RefundFromSupplierDetailsEntity>();
            RefundFromSupplierEntity model = new RefundFromSupplierEntity();

            //  this.ID = pqf.RefundFromSupplier.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.RefundFromSupplier = model;

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

                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.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.RefundFromSupplierDetails.Add(pqEntity);
            }
            return(PQForm);
        }
Example #25
0
        private void GetPaymentToSupplierDetails(string cashChequeNo)
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            this.ListSuppliers = supplierRepository.GetAllSupplier().ToList();
            IsNew = false;
            PaymentToSupplierForm pqf = psRepository.GetPaymentToSupplierDetails(cashChequeNo);
            DateTime Dateinstr        = (DateTime)pqf.PaymentToSupplier.Date;

            this.DateStr = Dateinstr.ToString(oData.DateFormat);
            GetModelData(pqf);
        }
Example #26
0
        void GetOptionsandTaxValues()
        {
            OptionsEntity oData = new OptionsEntity();
            IPurchaseOrderListRepository purchaseRepository = new PurchaseOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            if (oData != null)
            {
                CurrencyName = oData.CurrencyCode;
                DateFormat   = oData.DateFormat;
            }
            TaxModel objDefaultTax = new TaxModel();

            objDefaultTax = purchaseRepository.GetDefaultTaxes().FirstOrDefault();
        }
Example #27
0
        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);
        }
Example #28
0
        public async Task <HttpResponseMessage> PostAnswerSheet(AssessmentResultModel assessmentResultModel)
        {
            try
            {
                AssessmentResultEntity assessmentResultEntity = new AssessmentResultEntity();
                assessmentResultEntity.UserId                 = assessmentResultModel.UserId;
                assessmentResultEntity.AssessmentId           = assessmentResultModel.AssessmentId;
                assessmentResultEntity.QuestionPaperId        = assessmentResultModel.QuestionPaperId;
                assessmentResultEntity.TotalQuestionsCount    = assessmentResultModel.TotalQuestionsCount;
                assessmentResultEntity.RightAnsweredCount     = assessmentResultModel.RightAnsweredCount;
                assessmentResultEntity.IsWriteAssessmentLater = assessmentResultModel.IsWriteAssessmentLater;
                List <QuestionEntity> listQuestionPaperEntity = new List <QuestionEntity>();

                foreach (var questionModel in assessmentResultModel.QuestionPaper)
                {
                    QuestionEntity questionPaperEntity = new QuestionEntity();
                    questionPaperEntity.ID               = questionModel.ID;
                    questionPaperEntity.Number           = questionModel.Number;
                    questionPaperEntity.OptionType       = questionModel.OptionType;
                    questionPaperEntity.Options          = new List <OptionsEntity>();
                    questionPaperEntity.SelectedOptionId = questionModel.SelectedOptionId;
                    questionPaperEntity.WrittenAnswer    = questionModel.WrittenAnswer;

                    foreach (var optionModel in questionModel.Options)
                    {
                        OptionsEntity optionEntity = new OptionsEntity();
                        optionEntity.ID         = optionModel.ID;
                        optionEntity.OptionText = optionModel.OptionText;
                        questionPaperEntity.Options.Add(optionEntity);
                    }
                    questionPaperEntity.QuestionText  = questionModel.QuestionText;
                    questionPaperEntity.RightOptionId = questionModel.RightOptionId;
                    listQuestionPaperEntity.Add(questionPaperEntity);
                }
                assessmentResultEntity.AnsweredSheet = listQuestionPaperEntity;



                BusinessFactory.CreateQuestionPaperBusinessInstance().SaveAssessmentResultAndAnsweredSheet(assessmentResultEntity);


                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            catch (System.Exception e)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e));
            }
        }
        /// <summary>
        /// Loads the product models background.
        /// </summary>
        public void LoadOptionsBackground()
        {
            SelectedOptions = null; // Unselects last selection. Essential, as assignment below won't clear other control's SelectedItems
            var Options = new OptionsEntity();

            IOptionsService OptionsDetails = new OptionsService();
            var             results        = OptionsDetails.GetOptionsDetails();

            results.ShowAmountIncGST = true;


            int  minHeight   = 300;
            int  headerRows  = 490;//180+40+30+10;
            var  height      = System.Windows.SystemParameters.PrimaryScreenHeight - headerRows - 155;
            bool validHeight = int.TryParse(height.ToString(), out minHeight);

            results.OptionGridHeight = minHeight;
            IPurchaseQuotationListRepository purchaseRepository = new PurchaseQuotationListRepository();

            this.DateFormat = purchaseRepository.GetDateFormat();

            SelectedOptions = results;
            //int compId = 0;
            Mouse.OverrideCursor = Cursors.Wait;

            //run time-consuming operations on a background thread
            BackgroundWorker worker = new BackgroundWorker();

            //Set the WorkerReportsProgress property to true if you want the BackgroundWorker to support progress updates.
            //When this property is true, user code can call the ReportProgress method to raise the ProgressChanged event.
            worker.WorkerReportsProgress = true;

            //This event is raised when you call the RunWorkerAsync method. This is where you start the time-consuming operation.
            worker.DoWork += new DoWorkEventHandler(this.LoadOptionsBackground);

            // This event is raised when you call the ReportProgress method.
            //worker.ProgressChanged += new ProgressChangedEventHandler(this.LoadProductsBackgroundProgress);

            //The RunWorkerCompleted event is raised when the background worker has completed.
            //Depending on whether the background operation completed successfully, encountered an error,
            //or was canceled, update the user interface accordingly
            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.LoadOptionsBackgroundComplete);

            //Starts running a background operation
            worker.RunWorkerAsync();
        }
Example #30
0
        void GetOptionsandTaxValues()
        {
            OptionsEntity oData = new OptionsEntity();
            IPurchaseOrderListRepository purchaseRepository = new PurchaseOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            if (oData != null)
            {
                CurrencyName = oData.CurrencyCode;
                DateFormat   = oData.DateFormat;
                if (!string.IsNullOrWhiteSpace(oData.DefCashBankAcc))
                {
                    this.SelectedCashBankAcntID = Convert.ToInt32(oData.DefCashBankAcc);
                    CheckAccountDetails(null);
                }
            }
        }