public static dynamic volunteerDetails(familyModel obj) { dynamic objdata = new ExpandoObject(); try { string captchaverify = new captchahelper().GetCaptchVerify(obj); if (captchaverify == "Success") { obj.type = "2"; DataTable dt = familyProc(obj); if (dt != null && dt.Rows.Count > 0) { objdata.success = true; objdata.result = dt; } else { objdata.success = false; objdata.result = "Your Aadhaar Number is not surveyed !!!"; } } else { objdata.Status = "102"; objdata.result = "Invalid Captcha"; } } catch (Exception ex) { objdata.success = false; objdata.result = ex.Message.ToString(); } return(objdata); }
public static dynamic citizenDetailsSub(NewaadherModel obj) { dynamic objdata = new ExpandoObject(); try { string captchaverify = new captchahelper().GetCaptchVerify(obj); if (captchaverify == "Success") { obj.type = "4"; DataTable dt = citizenGrevProc(obj); if (dt != null && dt.Rows.Count > 0) { objdata.success = true; objdata.result = dt; string message = "క్లస్టర్ నందు హౌస్ హోల్డ్ మాపింగ్ చేసుకొనుటకు మీ యొక్క రిక్వెస్ట్ ను మీ సచివాలయం యొక్క పంచాయితీ సెక్రటరీ కు పంపబడినది.\n"; message += "మీ యొక్క రిక్వెస్ట్ ఐ డి నెంబర్ : " + dt.Rows[0]["GREVIANCE_ID"].ToString() + "\n"; message += "పంచాయితీ సెక్రటరీ మొబైల్ నెంబర్ : " + dt.Rows[0]["MOBILE_NUMBER"].ToString() + "\n"; message += "సచివాలయం పేరు : " + dt.Rows[0]["SEC_NAME"].ToString() + "\n"; SMSService.SMSService objSMS = new SMSService.SMSService(); objSMS.SendTeluguSMS(obj.mobileNumber, message); } else { objdata.success = false; objdata.result = "Failed to submit details, Please try again !!!"; } } else { objdata.Status = false; objdata.result = "Invalid Captcha"; } } catch (Exception ex) { string message = ex.Message.ToString(); if (message.Contains("ORA-00001")) { objdata.success = false; objdata.result = "Grevenance Aleary raised, Please contact your secretariat Panchayat Secretary !!!"; } else { objdata.success = false; objdata.result = message; } } return(objdata); }
public dynamic GetCountsData(dynamic data) { captchahelper _chel = new captchahelper(); string jsondata = JsonConvert.SerializeObject(data); try { LoginModel val = JsonConvert.DeserializeObject <LoginModel>(jsondata); return(Ok(_Loginhel.GetCountsData_Helper(val))); } catch (Exception ex) { _response.Status = 102; _response.Reason = "Something Went wrong Please Try again"; return(Ok(_response)); } }
public dynamic GetCaptcha(dynamic data) { dynamic _response = new ExpandoObject(); captchahelper _chel = new captchahelper(); string jsondata = JsonConvert.SerializeObject(data); try { captch val = JsonConvert.DeserializeObject <captch>(jsondata); return(Ok(_chel.check_s_captch(val))); } catch (Exception ex) { _response.Status = 102; _response.Reason = "Something Went wrong Please Try again"; return(Ok(_response)); } }
public dynamic GetRoleAccess(dynamic data) { captchahelper _chel = new captchahelper(); string jsondata = token_gen.Authorize_aesdecrpty(data); try { captch val = JsonConvert.DeserializeObject <captch>(jsondata); return(Ok(_chel.GetroleAccess(val))); } catch (Exception ex) { _response.Status = 102; _response.Reason = ex.Message.ToString(); return(Ok(_response)); } }
public dynamic GetCaptcha(dynamic data) { dynamic objdata = new ExpandoObject(); string jsondata = JsonConvert.SerializeObject(data); captch val = JsonConvert.DeserializeObject <captch>(jsondata); //olog.WriteLogParameters(ologmodel); try { captchahelper _chel = new captchahelper(); // #region Captcha("In the WebController => GetCaptcha: " + jsondata.ToString()); return(Ok(_chel.check_s_captch(val))); } catch (Exception ex) { //_log.Error("An error occurred in WebController => GetCaptcha: " + ex.Message + "__" + ex.InnerException + "__" + ex.StackTrace.ToString()); objdata.Status = 102; objdata.Reason = "Something Went wrong Please Try again"; return(Ok(objdata)); } }
public dynamic RBStatus(dynamic objdata) { dynamic objResponse = new ExpandoObject(); try { //string Apidata = objdata.data; //string Apid = objdata.last; string captcha = objdata.Captcha; string Confirm = objdata.ConfirmCaptch; string captchaverify = new captchahelper().CaptchVerify(captcha, Confirm); if (captchaverify == "Success") { using (var client = new HttpClient()) { ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return(true); }; var req = (HttpWebRequest)WebRequest.Create(ConfigurationManager.AppSettings["AgricultureApiBaseAddress"].ToString() + "Agriculture/v1/api/v1/agriculture"); req.ContentType = "application/json"; req.Method = "POST"; req.Headers.Add("Authorization", "Bearer 7d1a2c9a-72d2-3b6e-8663-e91f4e58d578"); req.AllowAutoRedirect = false; string str = JsonConvert.SerializeObject(objdata); str = str.Replace("null", "\"\""); var _jsonObject = str; if (!String.IsNullOrEmpty(_jsonObject)) { using (System.IO.Stream s = req.GetRequestStream()) { using (System.IO.StreamWriter sw = new System.IO.StreamWriter(s)) sw.Write(_jsonObject); } } var resp = (HttpWebResponse)req.GetResponse(); var sr = new StreamReader(resp.GetResponseStream()); if ((resp.StatusCode == HttpStatusCode.Redirect) || (resp.StatusCode == HttpStatusCode.SeeOther) || (resp.StatusCode == HttpStatusCode.RedirectMethod)) { objResponse.Status = "Failed"; objResponse.data = ""; } else { string data = sr.ReadToEnd().Trim(); dynamic RBData = JsonConvert.DeserializeObject <dynamic>(data); JArray userInfo = RBData.Details; if (userInfo != null) { string status = userInfo[0]["STATUS"].ToString(); if (status == "Belong To Beneficiary Family") { objResponse.REASON1 = BeneficiaryStatus(objdata); } } objResponse.Status = "100"; objResponse.REASON = data; } } } else { objResponse.Status = 102; objResponse.REASON = "Invalid Captcha"; } } catch (WebException ex) { objResponse.Status = "Failed"; objResponse.REASON = ex.Message.ToString(); } return(objResponse); }