public ActiveComborPromo GetComboPromoInfo(ComboSearchInfo searchPromo) { ActiveComborPromo pricePlanInfos = new ActiveComborPromo(); int _Id = 0; string query = "[dbo].[usp_GetActiveComboPromo]"; string ad = string.Join(",", searchPromo.CountryCode); using (SqlConnection con = new SqlConnection(this.settings.Value.GQNet)) { con.Open(); using (SqlCommand command = new SqlCommand(query, con)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@PriceSchemeIds", searchPromo.PriceSchemeIds); command.Parameters.AddWithValue("@CountryCode", searchPromo.CountryCode); SqlDataReader reader = command.ExecuteReader(); if (reader.Read()) { pricePlanInfos.IR_RegularPrice = Convert.ToDecimal(reader["IR_RegularRice"]); pricePlanInfos.IR_PromoPrice = Convert.ToDecimal(reader["IR_RegularRice"]); pricePlanInfos.Retail_RegPrice = Convert.ToDecimal(reader["IR_RegularRice"]); pricePlanInfos.Retail_PromoPrice = Convert.ToDecimal(reader["IR_RegularRice"]); } if (reader.NextResult()) { pricePlanInfos.ComboPriceDetails = new List <ActiveComboPriceDetails>(); while (reader.Read()) { pricePlanInfos.ComboPriceDetails.Add(new ActiveComboPriceDetails { Id = _Id + 1, ProductCode = reader["ProdCode"].ToString(), IRPrice = Convert.ToDecimal(reader["IR_RegularRice"]), IRPromoPrice = Convert.ToDecimal(reader["IR_PromoPrice"]), RetailPrice = Convert.ToDecimal(reader["Retail_Regular"]), RetailPromoPrice = Convert.ToDecimal(reader["Retail_Promo"]) }); } } } } return(pricePlanInfos); }
public SelectedPromoInfo GetSelectedPromo(ComboSearchInfo searchPromo) { SelectedPromoInfo selectedPromoInfo = new SelectedPromoInfo(); string query = "dbo.usp_GetSelectedPromoInfo"; using (SqlConnection con = new SqlConnection(this.settings.Value.GQNet)) { con.Open(); using (SqlCommand command = new SqlCommand(query, con)) { command.CommandType = CommandType.StoredProcedure; command.CommandTimeout = 120; command.Parameters.AddWithValue("@PriceSchemeIds", searchPromo.PriceSchemeIds); command.Parameters.AddWithValue("@CountryCode", searchPromo.CountryCode); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { selectedPromoInfo.ProductCode = Convert.ToString(reader["ProdCode"]); selectedPromoInfo.PricePlan = Convert.ToString(reader["Description"]); selectedPromoInfo.IRRegularPrice = Convert.ToDecimal(reader["IRRegularPrice"]); selectedPromoInfo.RetailRegularPrice = Convert.ToDecimal(reader["RetailRegularPrice"]); selectedPromoInfo.PromoPrice = Convert.ToDecimal(reader["PromoPrice"]); selectedPromoInfo.RetailPromoPrice = Convert.ToDecimal(reader["RetailPromoPrice"]); selectedPromoInfo.StartDate = Convert.ToDateTime(reader["StartDate"]); selectedPromoInfo.EndtDate = Convert.ToDateTime(reader["EndDate"]); selectedPromoInfo.CUV = (Convert.ToInt32(reader["CUV"]) * 1000).ToString(); selectedPromoInfo.CountryCode = Convert.ToString(reader["CountryCode"]); selectedPromoInfo.CountryName = Convert.ToString(reader["CountryName"]); selectedPromoInfo.Currency = Convert.ToString(reader["Currency"]); selectedPromoInfo.Currency = Convert.ToString(reader["Currency"]); selectedPromoInfo.ShipFee = Convert.ToDecimal(reader["ShipFee"]); selectedPromoInfo.RSP = Convert.ToDecimal(reader["RSP"]); } } } return(selectedPromoInfo); }
public ActiveComborPromo GetComboPromoInfo(ComboSearchInfo searchPromo) { return(iPromoLaunchRepository.GetComboPromoInfo(searchPromo)); }
public SelectedPromoInfo GetSelectedPromo(ComboSearchInfo searchPromo) { return(iPromoLaunchRepository.GetSelectedPromo(searchPromo)); }
public ActionResult GetActiveCombo([FromBody] ComboSearchInfo searchPromo) { return(Json(iPromoLaunchService.GetComboPromoInfo(searchPromo))); }
public ActionResult GetSelectedPromo([FromBody] ComboSearchInfo searchPromo) { return(Json(iPromoLaunchService.GetSelectedPromo(searchPromo))); }