public dynamic LoadHabitationCode(LGDMasterModel oj) { dynamic obj = new ExpandoObject(); PRRDSPHelper spobj = new PRRDSPHelper(); try { DataTable dt = spobj.GetHabitationCode_SP(oj); if (dt != null && dt.Rows.Count > 0) { obj.Status = 100; obj.Reason = ""; obj.Details = dt; } else { obj.Status = 101; obj.Reason = "No Data Found"; } } catch (Exception ex) { string mappath = HttpContext.Current.Server.MapPath("JobcardHelperExceptions"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath, "Error Getting LoadHabitationCode:" + ex.ToString())); obj.Status = 102; obj.Reason = "Error Occued While Loading Data"; return(obj); } return(obj); }
public dynamic GetJobCardDataHel(JobCardModel Lobj) { PRRDSPHelper spobj = new PRRDSPHelper(); dynamic objdata = new ExpandoObject(); try { //_log.Info("In the PRRDHelper=>GetJobCardData : " + JsonConvert.SerializeObject(Lobj)); DataTable dtLgd = spobj.GetJobCardSP(Lobj); if (dtLgd != null && dtLgd.Rows.Count > 0) { objdata.Status = 100; objdata.Reason = "Data Loaded successfully"; objdata.DataList = dtLgd; } else { objdata.Status = 102; objdata.Reason = "No Data Found"; } } catch (Exception ex) { string mappath = HttpContext.Current.Server.MapPath("JobcardHelperExceptions"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath, "getting error GetJobCardDataHel :" + ex.Message.ToString())); objdata.Status = 102; objdata.Reason = "Data not found"; } return(objdata); }
public dynamic CreateJobCard_hel(List <JobCardModel> obj) { dynamic objdata = new ExpandoObject(); PRRDSPHelper spobj = new PRRDSPHelper(); DataTable dt = null; try { dt = spobj.CreateJobCard_SP(obj); if (dt != null && dt.Rows.Count > 0) { objdata.Status = 100; objdata.Reason = "JobCard Data Inserted successfully"; objdata.DataList = dt; } else { objdata.Status = 102; objdata.Reason = "Not Created"; } } catch (Exception ex) { string mappath = HttpContext.Current.Server.MapPath("JobcardHelperExceptions"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath, "Error CreateJobCard_hel :" + ex.Message.ToString())); objdata.Status = 102; objdata.Reason = "Not Created"; } return(objdata); }
public dynamic UpdateJobcardStatus(JobCardModel ObjLGD) { dynamic obj = new ExpandoObject(); PRRDSPHelper spobj = new PRRDSPHelper(); try { DataTable dt = spobj.UpdateStatus(ObjLGD); if (dt != null && dt.Rows.Count > 0) { obj.Status = 100; obj.Reason = ""; obj.Jobcarddetails = dt; } else { obj.Status = 101; obj.Reason = "No Data Found"; } } catch (Exception ex) { string mappath = HttpContext.Current.Server.MapPath("JobcardHelperExceptions"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath, "getting error UpdateJobcardStatus :" + ex.Message.ToString())); obj.Status = 102; obj.Reason = "Error Occued While Loading Data"; return(obj); } return(obj); }
public dynamic getSecretriattovolunteer(SecretriatVVModel root) { dynamic obj = new ExpandoObject(); PRRDSPHelper spobj = new PRRDSPHelper(); try { DataTable data = spobj.GetSecretraiatToVolunteer_Sp(root); if (data != null) { obj.Status = 100; obj.Reason = "Data Loaded Successfully."; obj.Details = data; } else { obj.Status = 102; obj.Reason = "No Data Found"; } } catch (Exception ex) { obj.Status = 102; obj.Reason = "Error Occured While Getting Volunteer Data"; } return(obj); }
public dynamic GetValunteerMapping_helper(VolunteerCls root) { dynamic obj = new ExpandoObject(); PRRDSPHelper spobj = new PRRDSPHelper(); try { DataTable data = spobj.GetValunteerMapping_data_helper(root); if (data != null) { obj.Status = 100; obj.Reason = "Data Loaded Successfully."; obj.Details = data; } else { obj.Status = 102; obj.Reason = "No Data Found"; } } catch (Exception ex) { obj.Status = 102; obj.Reason = "Error Occured While Getting Volunteer Data"; } return(obj); }
public dynamic LoadDistricts(DistrictsCls oj) { dynamic obj = new ExpandoObject(); PRRDSPHelper spobj = new PRRDSPHelper(); try { DataTable dt = spobj.LoadDistricts_helper(oj); if (dt != null && dt.Rows.Count > 0) { obj.Status = 100; obj.Reason = ""; obj.Details = dt; } else { obj.Status = 101; obj.Reason = "No Data Found"; } } catch (Exception ex) { obj.Status = 102; obj.Reason = "Error Occued While Loading Data"; return(obj); } return(obj); }
public dynamic GetJobCardDetailsbyTransIdandUIDhelper(dynamic val) { PRRDSPHelper spobj = new PRRDSPHelper(); try { objResponse = SendJobCardAPI(val); } catch (Exception ex) { string mappath = HttpContext.Current.Server.MapPath("JobcardHelperExceptions"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath, "getting error GetJobCardDetailsbyTransIdandUIDhelper :" + ex.Message.ToString())); } return(objResponse); }
public dynamic LoadNICPanchayats_helper(dynamic objdata) { try { PRRDSPHelper spobj = new PRRDSPHelper(); LGDMasterModel objl = new LGDMasterModel(); objl.FTYPE = "6"; objl.DISTCODE = objdata.seccode; var data = spobj.GetGSWS_SecretariatMaster_LGD_SP(objl); objResponse.Status = "Success"; objResponse.data = data; } catch (Exception ex) { objResponse.Status = "Failed"; objResponse.data = CommonSPHel.ThirdpartyMessage; } return(objResponse); }
public dynamic AuthentiateCall(dynamic jsonData) { dynamic responsedata = new ExpandoObject(); try { PRRDSPHelper spobj = new PRRDSPHelper(); LGDMasterModel objl = new LGDMasterModel(); var random = new Random(); int randomnumber = random.Next(); ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return(true); }; string url = "https://mpanchayat.ap.gov.in/PIM/authenticateGs.do"; HttpClient client = new HttpClient(); client.BaseAddress = new Uri(url); client.DefaultRequestHeaders.Accept.Clear(); MultipartFormDataContent content = new MultipartFormDataContent(); StringContent username = new StringContent("APITECGS", Encoding.UTF8, "multipart/form-data"); StringContent password = new StringContent(sha256_hash(sha256_hash("GSCPRRD#@2020") + randomnumber + Convert.ToString(jsonData.granttype) + Convert.ToString(jsonData.servicetype)), Encoding.UTF8, "multipart/form-data"); //StringContent password = new StringContent("GSCPRRD#@2020", Encoding.UTF8, "multipart/form-data"); StringContent gs_applid = new StringContent(randomnumber.ToString(), Encoding.UTF8, "multipart/form-data"); StringContent granttype = new StringContent(Convert.ToString(jsonData.granttype), Encoding.UTF8, "multipart/form-data"); StringContent servicetype = new StringContent(Convert.ToString(jsonData.servicetype), Encoding.UTF8, "multipart/form-data"); content.Add(username, "username"); content.Add(password, "password"); content.Add(gs_applid, "gs_applid"); content.Add(granttype, "granttype"); content.Add(servicetype, "servicetype"); HttpResponseMessage resp = client.PostAsync(url, content).Result; string returnString = resp.Content.ReadAsStringAsync().Result; if ((resp.StatusCode == HttpStatusCode.Redirect) || (resp.StatusCode == HttpStatusCode.SeeOther) || (resp.StatusCode == HttpStatusCode.RedirectMethod)) { responsedata.Status = "Failed"; responsedata.data = ""; responsedata.Reason = "Invalid request Service is not Respond"; } else { string data = returnString; responsedata.Status = "Success"; responsedata.username = "******"; responsedata.servicetype = Convert.ToString(jsonData.servicetype); responsedata.gs_applid = randomnumber; //PRRDSPHelper spobj = new PRRDSPHelper(); //LGDMasterModel objl = new LGDMasterModel(); objl.FTYPE = "6"; objl.DISTCODE = jsonData.seccode; //DataTable dt1=spobj.GetGSWS_SecretariatMaster_LGD_SP(objl); //responsedata.lgdgpcode = spobj.GetGSWS_SecretariatMaster_LGD_SP(objl); responsedata.data = JsonConvert.DeserializeObject <List <AuthenticateNOCMarriage> >(data); } } catch (Exception ex) { string mappath = HttpContext.Current.Server.MapPath("PRRDExceptionLogs"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath, "Error Getting AuthentiateCall NOC Application Data API:" + ex.Message.ToString())); //Logfile("Program:AuthentiateCall::Exception:CPID:" + cpkid, ex.Message, strPath); responsedata.Status = "Failed"; responsedata.data = ""; responsedata.Reason = "Department Service is not Working.Please Try Again."; Common_PRRD_Error(ex.Message.ToString(), "https://mpanchayat.ap.gov.in/PIM/authenticateGs.do", "2"); //return ex; } return(responsedata); }