private LandLineNumberValidation landlinenumbervalidation(string landlinenumber, long Amount = 0) { //string type = "1"; string userid = Session["UserId"].ToString(); var serviceslist = _payment.ServiceDetail(userid); LandLineNumberValidation response = new LandLineNumberValidation(); response.Code = "1"; response.Message = "Invalid Number!!"; if (string.IsNullOrEmpty(landlinenumber)) { response.Message = "Number is Invalid!!"; return(response); } if (landlinenumber.Length > 9 && landlinenumber.Substring(0, 3) == "977") { landlinenumber = landlinenumber.Substring(3); } if (!landlinenumberLengthValidate(landlinenumber)) { response.Code = "1"; response.Message = "Please Enter Valid LandLine Number with Area Code"; return(response); } landlinenumber = landlinenumber.TrimStart(new Char[] { '0' }); if (landlinenumber.Substring(0, 2) == "12" || landlinenumber.Substring(0, 3) == "512")//UTL { var serviceInfo = serviceslist.FirstOrDefault(x => x.ProductId == "18"); response.Code = "0"; response.Message = serviceInfo.ProductLabel; response.ProductLogo = "/Content/assets/images/service logos/" + serviceInfo.ProductLogo; response.MinAmount = string.IsNullOrEmpty(serviceInfo.MinAmount) ? "1" : serviceInfo.MinAmount; response.MaxAmount += string.IsNullOrEmpty(serviceInfo.MaxAmount) ? "1000" : " " + serviceInfo.MaxAmount; response.ProductId += serviceInfo.ProductId; response.CommissionValue += serviceInfo.CommissionValue; response.CommissionType += serviceInfo.CommissionType; response.ServiceCode = "0"; response.CompanyCode = "582"; return(response); } else//NTC { var serviceInfo = serviceslist.FirstOrDefault(x => x.ProductId == "15"); response.Code = "0"; response.Message = serviceInfo.ProductLabel; response.ProductLogo = "/Content/assets/images/service logos/" + serviceInfo.ProductLogo; response.MinAmount = string.IsNullOrEmpty(serviceInfo.MinAmount) ? "1" : serviceInfo.MinAmount; response.MaxAmount += string.IsNullOrEmpty(serviceInfo.MaxAmount) ? "3000" : " " + serviceInfo.MaxAmount; response.ProductId += serviceInfo.ProductId; response.CommissionValue += serviceInfo.CommissionValue; response.CommissionType += serviceInfo.CommissionType; response.ServiceCode = "0"; response.CompanyCode = "585"; return(response); } }
public async System.Threading.Tasks.Task <JsonResult> CheckLandLineNumber(string LandLineNo) { LandLineNumberValidation response = landlinenumbervalidation(LandLineNo); string Code = response.Code; string Message = response.Message; string LogoUrl = response.ProductLogo; string MinAmount = response.MinAmount; string MaxAmount = response.MaxAmount; string ProductId = response.ProductId; string CommissionValue = response.CommissionValue; string CommissionType = response.CommissionType; Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary.Add("Subscriberno", LandLineNo); Dictionary <string, string> Denomitation = getdenominationlist(ProductId, dictionary); return(Json(new { Code, Message, LogoUrl, MinAmount, MaxAmount, ProductId, CommissionValue, CommissionType, response.CompanyCode, response.ServiceCode, Denomitation }, JsonRequestBehavior.AllowGet)); }