public BookingCalculatedPriceResponse GetCalculatedPriceForBooking(JObject input) { BookingCalculatedPriceResponse objresponse = new BookingCalculatedPriceResponse(); try { objresponse = objBookingBal.GetCalculatedPriceForBooking(input); } catch (Exception ex) { } return(objresponse); }
public BookingCalculatedPriceResponse GetCalculatedPriceForBooking(JObject input) { BookingCalculatedPriceResponse objresponse = new BookingCalculatedPriceResponse(); try { BookingPriceCalcRequest objrequest = new BookingPriceCalcRequest(); objrequest.FromCounterId = Convert.ToInt32(CommonMethods.URLKeyDecrypt(Convert.ToString(input["CounterId"]))); objrequest.GCType = Convert.ToInt32(input["GCTypeId"]); objrequest.ProductType = Convert.ToInt32(input["ProductTypeId"]); objrequest.ShipmentValue = Convert.ToDecimal(input["ShipmentValue"]); objrequest.ToCounterId = Convert.ToString(input["ToCounter"]); objrequest.TranshipmentPoints = Convert.ToString(input["TranshipmentPoints"]); objrequest.LoginId = Convert.ToInt32(CommonMethods.URLKeyDecrypt(Convert.ToString(input["LoginId"]))); DataTable dtweights = new DataTable(); dtweights.Columns.Add("ParcelType", typeof(int)); dtweights.Columns.Add("CalculationType", typeof(int)); dtweights.Columns.Add("NumberOfPieces", typeof(int)); dtweights.Columns.Add("ActualWeight", typeof(decimal)); dtweights.Columns.Add("TotalWeight", typeof(decimal)); if (input["ParcelItems"] != null) { JArray parcelitems = (JArray)input["ParcelItems"]; foreach (JObject item in parcelitems) { DataRow dr = dtweights.NewRow(); dr["ParcelType"] = Convert.ToInt32(item["ParcelType"]); dr["CalculationType"] = Convert.ToInt32(item["CalculationType"]); dr["NumberOfPieces"] = Convert.ToInt32(item["NumberOfPieces"]); dr["ActualWeight"] = Convert.ToDecimal(item["ActualWeight"]); dr["TotalWeight"] = Convert.ToDecimal(item["TotalWeight"]); dtweights.Rows.Add(dr); } } objresponse = objBookingDal.GetCalculatedPriceForBooking(objrequest, dtweights); } catch (Exception ex) { } return(objresponse); }