public void UpdatePandS(PandSDetailsModel pandsModel)
 {
     try
     {
         using (SASEntitiesEDM objEntities = new SASEntitiesEDM())
         {
             ProductsAndService pands = objEntities.ProductsAndServices.Where(p => p.ID == pandsModel.ID).SingleOrDefault();
             if (pands != null)
             {
                 pands.PandS_Code          = pandsModel.PSCode;
                 pands.PandS_Name          = pandsModel.PSName;
                 pands.PandS_Type          = pandsModel.PSType;
                 pands.PandS_Cat1          = pandsModel.PSCategory1;
                 pands.PandS_Cat2          = pandsModel.PSCategory2;
                 pands.Tax_Rate            = pandsModel.TaxRate;
                 pands.Tax_ID              = pandsModel.TaxID;
                 pands.PandS_Description   = pandsModel.PSDescription;
                 pands.PandS_Inactive      = pandsModel.IsInActive == null ? null : pandsModel.IsInActive;
                 pands.PandS_Stock_Picture = pandsModel.ImgSource;
                 //Standard Sell and cost price
                 pands.PandS_Std_Sell_Price_bef_GST = Convert.ToDecimal(pandsModel.StandardSellPriceBeforeGST);
                 pands.PandS_Std_Sell_Price_aft_GST = Convert.ToDecimal(pandsModel.StandardSellPriceAfterGST);
                 pands.PandS_Std_Cost_Price_bef_GST = Convert.ToDecimal(pandsModel.StandardCostpriceBeforeGST);
                 pands.PandS_Std_Cost_Price_aft_GST = Convert.ToDecimal(pandsModel.StandardCostpriceAfterGST);
                 //Average
                 pands.PandS_Ave_Sell_Price_bef_GST = Convert.ToDecimal(pandsModel.AverageSellPriceBeforeGST);
                 pands.PandS_Ave_Sell_Price_aft_GST = Convert.ToDecimal(pandsModel.AverageSellPriceAfterGST);
                 pands.PandS_Ave_Cost_Price_bef_GST = Convert.ToDecimal(pandsModel.AverageCostPriceBeforeGST);
                 pands.PandS_Ave_Cost_Price_aft_GST = Convert.ToDecimal(pandsModel.AverageCostPriceAfterGST);
                 //Last
                 pands.PandS_Last_Sold_Price_bef_GST = Convert.ToDecimal(pandsModel.LastSoldPriceBeforeGST);
                 pands.PandS_Last_Sold_Price_aft_GST = Convert.ToDecimal(pandsModel.LastSoldPriceAfterGST);
                 pands.PandS_Last_Pur_Price_bef_GST  = Convert.ToDecimal(pandsModel.LastPurchasePriceBeforeGST);
                 pands.PandS_Last_Pur_Price_aft_GST  = Convert.ToDecimal(pandsModel.LastPurchasePriceAfterGST);
                 //Stock
                 pands.PandS_Min_Qty      = pandsModel.MinimumQuantity;
                 pands.PandS_Qty_in_stock = pandsModel.QuantityInStock;
                 pands.PandS_Qty_for_SO   = pandsModel.ReservedForSalesOrders;
                 pands.PandS_Qty_on_PO    = pandsModel.OnPurchaseOrders;
                 pands.PandS_Stock_Value  = pandsModel.StockValue;
                 pands.ModifiedBy         = pandsModel.LoggedinUserID;
                 pands.ModifiedDate       = DateTime.Now;
                 pands.IsRefresh          = false;
                 pands.RefreshDate        = null;
                 objEntities.SaveChanges();
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public void DeletePandS(PandSDetailsModel pandsModel)
 {
     try
     {
         using (SASEntitiesEDM objEntities = new SASEntitiesEDM())
         {
             ProductsAndService pands = objEntities.ProductsAndServices.Where(p => p.ID == pandsModel.ID).SingleOrDefault();
             if (pands != null)
             {
                 pands.IsDeleted    = true;
                 pands.ModifiedBy   = pandsModel.LoggedinUserID;
                 pands.ModifiedDate = DateTime.Now;
                 objEntities.SaveChanges();
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public void UpdatePandS(PandSDetailsModel pandsModel)
        {
            IPandSDetailsOperationDAL pandsOPDAL = new PandSDetailsOperationDAL();

            pandsOPDAL.UpdatePandS(pandsModel);
        }
        public int SavePandS(PandSDetailsModel pandsModel)
        {
            IPandSDetailsOperationDAL pandsOPDAL = new PandSDetailsOperationDAL();

            return(pandsOPDAL.SavePandS(pandsModel));
        }
        public void DeletePandS(PandSDetailsModel pandSModel)
        {
            IPandSDetailsOperationBL pandsBL = new PandSDetailsOperationBL();

            pandsBL.DeletePandS(pandSModel);
        }
        public void UpdatePandS(PandSDetailsModel pandsModel)
        {
            IPandSDetailsOperationBL pandsBL = new PandSDetailsOperationBL();

            pandsBL.UpdatePandS(pandsModel);
        }
        public int SavePandS(PandSDetailsModel pandsModel)
        {
            IPandSDetailsOperationBL pandSBL = new PandSDetailsOperationBL();

            return(pandSBL.SavePandS(pandsModel));
        }