public HttpResponseMessage GetLeadAI(string direct) { coreRangeViewModel = new CoreRangeViewModel(); try { coreRangeServ = new CoreRangeService(); coreRangeViewModel.LeadAIList = coreRangeServ.GetLeadUICode(); CacheObjectWrapper.Add("CoreRangeDirect", direct); return(Request.CreateResponse(HttpStatusCode.OK, coreRangeViewModel)); } catch (Exception ex) { NameValueCollection additionalInfo = new NameValueCollection(); additionalInfo.Add("PageName", "CoreRange"); ExceptionManager.Publish(ex, additionalInfo); Message = "Error in GetLeadAI method of Corerange controller"; errEntity.ErrorNumber = 420; errEntity.ErrorMess = Message; coreRangeViewModel.ErrorBE = errEntity; return(Request.CreateResponse(HttpStatusCode.OK, coreRangeViewModel)); } }
public HttpResponseMessage GetCoreRangeDetails(string selectedleadAI, string selectedformulation) { coreRangeServ = new CoreRangeService(); coreRangeViewModel = new CoreRangeViewModel(); try { int index = selectedformulation.IndexOf(Constants.HYPHEN); //int leadAIIndex = selectedleadAI.IndexOf(Constants.HYPHEN); if (!selectedleadAI.Equals("-1")) { int formulation = selectedformulation.Equals("SELECT", StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty(selectedformulation) ? 0 : Convert.ToInt32(selectedformulation.Substring(0, index)); int leadAI = Convert.ToInt32(selectedleadAI); coreRangeViewModel = coreRangeServ.GetCoreRangeDetails(leadAI, formulation); if (selectedformulation.Contains(Constants.const_AddedToCoreRangeStatus)) { coreRangeViewModel.FormulationStatus = Constants.const_Status; } } return(Request.CreateResponse(HttpStatusCode.OK, coreRangeViewModel)); } catch (Exception ex) { NameValueCollection additionalInfo = new NameValueCollection(); additionalInfo.Add("PageName", "CoreRange"); ExceptionManager.Publish(ex, additionalInfo); Message = "Error in GetCoreRangeDetails method of Corerange controller"; errEntity.ErrorNumber = 420; errEntity.ErrorMess = Message; coreRangeViewModel.ErrorBE = errEntity; return(Request.CreateResponse(HttpStatusCode.OK, coreRangeViewModel)); } }
public HttpResponseMessage GetFormulationForLeadAI(string leadAIValue) { coreRangeViewModel = new CoreRangeViewModel(); coreRangeServ = new CoreRangeService(); //int index = leadAIValue.IndexOf(Constants.HYPHEN); try { if (!string.IsNullOrEmpty(leadAIValue)) { int intIndex = leadAIValue.IndexOf(Constants.HYPHEN); if (intIndex > 0) { int leadAI = Convert.ToInt32(leadAIValue.Substring(0, intIndex)); coreRangeViewModel.Formulation = coreRangeServ.GetFormulation(leadAI); } else { List <SelectListItem> newList = new List <SelectListItem>(); newList.Add(new SelectListItem() { Text = "SELECT", Value = "SELECT", Selected = true }); coreRangeViewModel.Formulation = newList; } if (leadAIValue.Contains(Constants.const_AddedToCoreRangeStatus)) { coreRangeViewModel.LeadAIStatus = Constants.const_Status; } } return(Request.CreateResponse(HttpStatusCode.OK, coreRangeViewModel)); } catch (Exception ex) { NameValueCollection additionalInfo = new NameValueCollection(); additionalInfo.Add("PageName", "CoreRange"); ExceptionManager.Publish(ex, additionalInfo); Message = "Error in GetFormulationForLeadAI method of Corerange controller"; errEntity.ErrorNumber = 420; errEntity.ErrorMess = Message; coreRangeViewModel.ErrorBE = errEntity; return(Request.CreateResponse(HttpStatusCode.OK, coreRangeViewModel)); } }