public void UpdateRecord(string paraSessionID, string paraCurrentObjectName, string paraUserID, SP_GetCartProductDetail_Result order, string[] conn) { BISPL_CRMDBEntities db = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn)); List <SP_GetCartProductDetail_Result> getRec = new List <SP_GetCartProductDetail_Result>(); getRec = GetExistingTempDataBySessionIDObjectName(paraSessionID, paraUserID, paraCurrentObjectName, conn); SP_GetCartProductDetail_Result updateRec = new SP_GetCartProductDetail_Result(); updateRec = getRec.Where(g => g.Sequence == order.Sequence).FirstOrDefault(); updateRec.ProductPrice = order.ProductPrice; updateRec.PerUnitDiscount = order.PerUnitDiscount; updateRec.IsDiscountPercent = order.IsDiscountPercent; //updateRec.DiscountID = updateRec.DiscountID"]; updateRec.RateAfterDiscount = order.RateAfterDiscount; updateRec.Quantity = order.Quantity; /*If New Amount AfterDiscount <> Old Amount After Discount then Calculate Tax*/ //if (updateRec.AmountAfterDiscount != order.AmountAfterDiscount) //{ CallCalcuatedTax = true; } /*End*/ updateRec.AmountAfterDiscount = order.AmountAfterDiscount; updateRec.TotalTaxAmount = order.TotalTaxAmount; updateRec.AmountAfterTax = order.AmountAfterTax; //updateRec.Remark = updateRec.Remark"]; SaveTempDataToDB(getRec, paraSessionID, paraUserID, paraCurrentObjectName, conn); //return CallCalcuatedTax; /*Delete Record in Table TempCartProductLevelTaxDetail*/ DataSet ds = new DataSet(); ds = fillds("insert into TempCartProductLevelTaxDetailNEW select * from TempCartProductLevelTaxDetail where TempCartProductLevelTaxDetail.IsChecked=1 delete from TempCartProductLevelTaxDetail where SessionID = '" + paraSessionID + "'", conn); }
/// <summary> /// /// </summary> /// <param name="paraSessionID"></param> /// <param name="paraCurrentObjectName"></param> /// <param name="paraCartSequence"></param> /// <param name="paraUserID"></param> /// <returns></returns> public SP_GetCartProductDetail_Result GetCartProductDetailBySequence(string paraSessionID, string paraCurrentObjectName, long paraCartSequence, string paraUserID, string[] conn) { BISPL_CRMDBEntities db = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn)); SP_GetCartProductDetail_Result result = new SP_GetCartProductDetail_Result(); List <SP_GetCartProductDetail_Result> productDetailList = new List <SP_GetCartProductDetail_Result>(); productDetailList = GetExistingTempDataBySessionIDObjectName(paraSessionID, paraUserID, paraCurrentObjectName, conn); // result = productDetailList.Where(p => p.Sequence == Convert.ToInt64(paraCartSequence)).FirstOrDefault(); result = productDetailList.Where(p => p.ProductID == Convert.ToInt64(paraCartSequence)).FirstOrDefault(); return(result); }
public string UpdateTaxAmount() { UCApplyTaxService.iUCApplyTaxClient ApplyTaxServie = new UCApplyTaxService.iUCApplyTaxClient(); string TotalTaxAmount = "0"; try { CustomProfile profile = CustomProfile.GetProfile(); string ProductID = Request.QueryString["PrdID"].ToString(); if (ProductID == "undefined") { ProductID = "0"; } long PrdID = Convert.ToInt64(ProductID); // TotalTaxAmount = ApplyTaxServie.UpdateCalculatedTaxList(Request.QueryString["Object"].ToString(), Session.SessionID, Convert.ToInt64(Request.QueryString["CartSeq"].ToString()), Convert.ToDecimal(lblTaxableAmount.Text), hdnTaxSelectedRec.Value.ToString(), profile.DBConnection._constr); TotalTaxAmount = ApplyTaxServie.UpdateCalculatedTaxList(Request.QueryString["Object"].ToString(), Session.SessionID, PrdID, Convert.ToDecimal(lblTaxableAmount.Text), hdnTaxSelectedRec.Value.ToString(), profile.DBConnection._constr); ApplyTaxServie.Close(); AddToCartService.iAddToCartClient addtocartclient = new AddToCartService.iAddToCartClient(); SP_GetCartProductDetail_Result updateRec = new SP_GetCartProductDetail_Result(); // updateRec = addtocartclient.GetCartProductDetailBySequence(Session.SessionID, Request.QueryString["Object"].ToString(), Convert.ToInt64(Request.QueryString["CartSeq"].ToString()), profile.Personal.UserID.ToString(), profile.DBConnection._constr); updateRec = addtocartclient.GetCartProductDetailBySequence(Session.SessionID, Request.QueryString["Object"].ToString(), PrdID, profile.Personal.UserID.ToString(), profile.DBConnection._constr); if (updateRec != null) { updateRec.TotalTaxAmount = Convert.ToDecimal(TotalTaxAmount); updateRec.AmountAfterTax = updateRec.AmountAfterDiscount + Convert.ToDecimal(TotalTaxAmount); addtocartclient.UpdateRecord(Session.SessionID, Request.QueryString["Object"].ToString(), profile.Personal.UserID.ToString(), updateRec, profile.DBConnection._constr); addtocartclient.Close(); GridTaxList.DataSource = null; GridTaxList.DataBind(); hdnTaxSelectedRec.Value = ""; } } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "UCApplyTax", "UpdateTaxAmount"); } finally { ApplyTaxServie.Close(); } return(TotalTaxAmount); }