public List <AcitvePromoInfo> GetActivePromoInfo(SearchPromo searchPromo) { List <AcitvePromoInfo> pricePlanInfos = new List <AcitvePromoInfo>(); string query = "dbo.usp_GetActivePromoBasedonProdCode"; 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("@ProductCode", searchPromo.ProductCode.Trim()); command.Parameters.AddWithValue("@CountryCode", string.Join(",", searchPromo.CountryCode)); command.Parameters.AddWithValue("@PricePlanID", searchPromo.PricePlanId); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { pricePlanInfos.Add(new AcitvePromoInfo { PriceSchemeId = Convert.ToInt32(reader["PriceSchemeID"]), ProductCode = reader["ProdCode"].ToString(), ProductDesc = Convert.ToString(reader["ProdName"]), StartDate = Convert.ToDateTime(reader["StartDate"]).ToString("dd MMM yyyy hh:mm tt"), EndDate = Convert.ToDateTime(reader["EndDate"]).ToString("dd MMM yyyy hh:mm tt"), SchemeName = Convert.ToString(reader["PriceSchemeName"]), RegularPrice = Convert.ToDecimal(reader["RegularPrice"]), PromoPrice = Convert.ToDecimal(reader["FullPrice"]), IsRetail = Convert.ToBoolean(reader["IsRetail"]), CountryName = Convert.ToString(reader["CountryName"]), CountryCode = Convert.ToString(reader["CountryCode"]), PriceSchemeIds = Convert.ToString(reader["PriceSchemeIds"]), }); } } } return(pricePlanInfos); }
public List <AcitvePromoInfo> GetActivePromoInfo(SearchPromo searchPromo) { return(iPromoLaunchRepository.GetActivePromoInfo(searchPromo)); }
public ActionResult GetActivePromoInfo([FromBody] SearchPromo searchPromo) { return(Json(iPromoLaunchService.GetActivePromoInfo(searchPromo))); }