public bool SellProductBL(SellBO objSellBO) { SellDA objSellDA = new SellDA(); int ProductID = objSellDA.GetProductID(objSellBO.ProductName); TypeDA objTypeDA = new TypeDA(); int OldTypeCount = objTypeDA.GetOldTypeCount(objSellBO.TypeName, ProductID); Constants.RemainingProduct = OldTypeCount; if (OldTypeCount < objSellBO.ProductCount) { return(false); } int NewTypeCount = OldTypeCount - objSellBO.ProductCount; objTypeDA.DecreaseFromStock(objSellBO.TypeName, ProductID, NewTypeCount); decimal Price = objSellDA.GetPriceOfProduct(objSellBO, ProductID); objSellBO.ProductPrice = Price * objSellBO.ProductCount; objSellDA.SellProductDA(objSellBO); decimal oldLoan = objSellDA.GetOldLoan(objSellBO); decimal newLoan = oldLoan + objSellBO.ProductPrice; objSellDA.AddLoanDA(objSellBO, newLoan); return(true); }
public decimal CalculatePriceBL(SellBO objSellBO) { SellDA objSellDA = new SellDA(); int ProductID = objSellDA.GetProductID(objSellBO.ProductName); decimal Price = objSellDA.GetPriceOfProduct(objSellBO, ProductID); objSellBO.ProductPrice = Price * objSellBO.ProductCount; return(objSellBO.ProductPrice); }
public void DeleteTypeBL(string ProductName, string TypeName) { TypeDA objTypeDA = new TypeDA(); SellDA objSellDA = new SellDA(); int ProductID = objSellDA.GetProductID(ProductName); objTypeDA.DeleteTypeBL(ProductID, TypeName); }
public void DeleteProductBL(string ProductName) { SellDA objSellDA = new SellDA(); ProductDA objProductDA = new ProductDA(); TypeDA objTypeDA = new TypeDA(); int ProductID = objSellDA.GetProductID(ProductName); objProductDA.DeleteProductBL(ProductName); objTypeDA.DeleteTypeBL(ProductID); }
public DataSet PopulateGridViewCustomerHistoryBL() { SellDA objSellDA = new SellDA(); DataSet ds = objSellDA.PopulateGridViewCustomerHistoryDA(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { decimal dec = Convert.ToDecimal(ds.Tables[0].Rows[i][4]); string decStr = dec.ToString("0.##"); ds.Tables[0].Rows[i].SetField(4, decStr); ds.AcceptChanges(); } return(ds); }
public bool PayLoanDA(SellBO objSellBO, decimal payment) { SellDA objSellDA = new SellDA(); CostumerDA objCostumerDA = new CostumerDA(); decimal oldLoan = objSellDA.GetOldLoan(objSellBO); decimal newLoan = 0; if (oldLoan < payment) { return(false); } else { newLoan = oldLoan - payment; objCostumerDA.PayLoanDA(objSellBO, newLoan); return(true); } }
public decimal GetTotalLoanBL() { SellDA objSellDA = new SellDA(); return(objSellDA.GetTotalLoanDA()); }
public void ClearSellHistoryBL() { SellDA objSellDA = new SellDA(); objSellDA.ClearSellHistoryDA(); }
public int GetProductID(string ProductName) { SellDA objSellDA = new SellDA(); return(objSellDA.GetProductID(ProductName)); }