public static dynamic loadPensioners(pensionModel obj) { dynamic objdata = new ExpandoObject(); try { obj.type = "3"; DataTable dt = unMappedPensionerMappingProc(obj); if (dt != null && dt.Rows.Count > 0) { objdata.status = 200; objdata.result = dt; } else { objdata.status = 400; objdata.result = "No Pensioner available for this secretariat !!!"; } } catch (Exception ex) { objdata.status = 500; objdata.result = ex.Message.ToString(); } return(objdata); }
public static dynamic assignClusterToPensioner(pensionModel obj) { dynamic objdata = new ExpandoObject(); try { obj.type = "4"; DataTable dt = unMappedPensionerMappingProc(obj); if (dt != null && dt.Rows.Count > 0 && dt.Rows[0][0].ToString() == "1") { objdata.status = 200; objdata.result = "cluster assgined successfully !!!"; } else { objdata.status = 400; objdata.result = "failed to assign cluster, please try again !!!"; } } catch (Exception ex) { objdata.status = 500; objdata.result = ex.Message.ToString(); } return(objdata); }
public static DataTable unMappedPensionerMappingProc(pensionModel obj) { try { List <inputModel> listInputObj = new List <inputModel>(); inputModel inputObj = new inputModel(); inputObj.paramName = "p_type"; inputObj.value = obj.type; inputObj.dataType = "Varchar2"; listInputObj.Add(inputObj); inputModel inputObj1 = new inputModel(); inputObj1.paramName = "p_cluster_id"; inputObj1.value = obj.cluster_id; inputObj1.dataType = "Varchar2"; listInputObj.Add(inputObj1); inputModel inputObj2 = new inputModel(); inputObj2.paramName = "p_uid"; inputObj2.value = obj.uid; inputObj2.dataType = "Varchar2"; listInputObj.Add(inputObj2); inputModel inputObj3 = new inputModel(); inputObj3.paramName = "p_secretariat"; inputObj3.value = obj.gsws_code; inputObj3.dataType = "Varchar2"; listInputObj.Add(inputObj3); requestModel procObj = new requestModel(); procObj.refcursorName = "pcur"; procObj.procedureName = "GSWS_HH_NON_MAPPED1"; procObj.inputs = listInputObj; procObj.key = key; string json = JsonConvert.SerializeObject(procObj); return(dbRouter.POST_Request(gswsRouterUrl, json)); } catch (Exception ex) { string mappath = HttpContext.Current.Server.MapPath("unMappedPensionerMappingProcedure"); string serialized_data = JsonConvert.SerializeObject(obj); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_ReportLog_Exception(mappath, serialized_data)); throw ex; } }