public static IList <ProcessMasterModel> GetProcessMasterList(int?ProcessId, int selectionType, string SearchBy, string SearchString, Guid?CompanyId, int ItemsPerPage, int RequestPage, int CurrentPageNo) { ArrayList paramlist = new ArrayList(); string resultString; int ProsId = ProcessId == null?0:(int)ProcessId; //IList<ProcessMasterModel> objprocessMasterModel = null; ProcessMasterModel obj = new ProcessMasterModel(); obj.SearchString = SearchString; obj.RequestType = selectionType; obj.ProcessId = ProsId; obj.CompanyId = CompanyId; obj.ItemsPerPage = ItemsPerPage; obj.RequestPageNo = RequestPage; obj.CurrentPageNo = CurrentPageNo; paramlist.Add(obj); using (var client = new HttpClient()) { Uri baseAddres = new Uri(System.Configuration.ConfigurationManager.AppSettings["UriPath"]); client.BaseAddress = baseAddres; resultString = client.PostAsJsonAsync("api/ProcessMaster/ProcessMaster_List", paramlist) .Result .Content.ReadAsStringAsync().Result; } IList <ProcessMasterModel> objprocessMasterModel = (IList <ProcessMasterModel>)Newtonsoft.Json.JsonConvert.DeserializeObject(resultString, typeof(IList <ProcessMasterModel>)); return(objprocessMasterModel); }
public static ProcessMasterModel ProcessMasterModule_InsertUpdate(ProcessMasterModel objprocess) { ArrayList paramList = new ArrayList(); string resultString; ProcessMasterModel objReturnProcessModel = null; ProcessMasterModel obj = new ProcessMasterModel(); obj.ProcessId = objprocess.ProcessId; obj.ProcessName = objprocess.ProcessName; obj.QuantityFlag = objprocess.QuantityFlag; obj.ProcessVolume = objprocess.ProcessVolume; //obj.ProcessDuration = objprocess.ProcessDuration; obj.PackingFlag = objprocess.PackingFlag; obj.WastageFlag = objprocess.WastageFlag; obj.ByProduct = objprocess.ByProduct; obj.CreatedDate = objprocess.CreatedDate; obj.IsDelete = objprocess.IsDelete; obj.ProcessDuration = objprocess.ProcessDuration; obj.ProcessVolume = objprocess.ProcessVolume; obj.CompanyId = objprocess.CompanyId; paramList.Add(obj); using (var client = new HttpClient()) { Uri baseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["UriPath"]); client.BaseAddress = baseAddress; resultString = client.PostAsJsonAsync("api/ProcessMaster/ProcessMaster_InsertUpdate", paramList) .Result .Content.ReadAsStringAsync().Result; } objReturnProcessModel = (ProcessMasterModel)Newtonsoft.Json.JsonConvert.DeserializeObject(resultString, typeof(ProcessMasterModel)); return(objReturnProcessModel); }
public ActionResult ProcessInser_Update(ProcessMasterModel pbj) { pbj.CompanyId = Guid.Parse("5a6f68ba-2b74-479d-8e5d-525a42a6196b".ToString()); pbj = CommonCalls.ProcessMasterModule_InsertUpdate(pbj); if (pbj.ProcessId == 0) { ViewBag.ButtonCaption = "Add "; } else { ViewBag.ButtonCaption = "Update "; } if (pbj.ReturnCode == 0) { ViewBag.PopupMessage = pbj.ReturnMessage; return(RedirectToAction("Index", "ProcessMaster")); } else if (pbj.ReturnCode == 101) { ViewBag.PopupMessage = pbj.ReturnMessage; return(RedirectToAction("Index", "ProcessMaster")); } return(View()); }
public IList <ProcessMasterModel> Product_List(ArrayList paramList) { ProcessMasterModel apiObject = new ProcessMasterModel(); string strResult = ""; IList <ProcessMasterModel> apiObjectList = null; apiObject = Newtonsoft.Json.JsonConvert.DeserializeObject <ProcessMasterModel>(paramList[0].ToString()); apiObjectList = fnProcessMaster_List(apiObject, ref strResult); return(apiObjectList); }
public ActionResult Process_Delete(int id) { ProcessMasterModel pbj = new ProcessMasterModel(); pbj.ProcessId = id; pbj = CommonCalls.ProcessMasterModule_Delete(pbj); if (pbj.ReturnCode == 101) { ViewBag.PopupMessage = pbj.ReturnMessage; return(RedirectToAction("Index", "ProcessMaster")); } return(RedirectToAction("Index", "ProcessMaster")); }
public ActionResult ProcessInser_Update(int?ProcessId) { ProcessMasterModel objProcessMaster = new ProcessMasterModel(); string SearchBy = ""; string SearchString = ""; Guid?CompanyId = Guid.Parse("5a6f68ba-2b74-479d-8e5d-525a42a6196b".ToString()); int ItemsPerPage = 0; int RequestPage = 0; int RequestPageNo = 0; int CurrentPageNo = 0; int Id = 0; IList <UOMMasterModel> objUOMMaster = CommonCalls.GetUOMMasterList(0, 1, SearchBy, SearchString, CompanyId, ItemsPerPage, RequestPageNo, CurrentPageNo); string output = JsonConvert.SerializeObject(objUOMMaster); ViewBag.Menue = output; IList <ProcessMasterModel> objProcessList = CommonCalls.GetProcessMasterList(0, 1, SearchBy, SearchString, CompanyId, ItemsPerPage, RequestPage, CurrentPageNo); ViewBag.ProcessList = objProcessList; /*................General Masster List.......................*/ IList <GeneralMasterModel> objvolumeList = CommonCalls.GetGeneralMasterList(Id, 1, 3, SearchBy, SearchString, CompanyId, ItemsPerPage, RequestPage, CurrentPageNo); ViewBag.Volume = objvolumeList; /*................General Masster List.......................*/ IList <GeneralMasterModel> objdurationList = CommonCalls.GetGeneralMasterList(0, 1, 4, SearchBy, SearchString, CompanyId, ItemsPerPage, RequestPage, CurrentPageNo); ViewBag.duration = objdurationList; if (ProcessId == null || ProcessId == 0) { ViewBag.ButtonCaption = "Add "; ViewBag.PopupMessage = ""; } else { ViewBag.ButtonCaption = "Update"; IList <ProcessMasterModel> objReturnProcess = CommonCalls.GetProcessMasterList(ProcessId, 0, SearchBy, SearchString, CompanyId, ItemsPerPage, RequestPage, CurrentPageNo); objProcessMaster = objReturnProcess[0]; } return(View(objProcessMaster)); }
public static ProcessMasterModel ProcessMasterModule_Delete(ProcessMasterModel objprocess) { ArrayList paramList = new ArrayList(); string resultString; ProcessMasterModel objReturnProcessModel = null; ProcessMasterModel obj = new ProcessMasterModel(); obj.ProcessId = objprocess.ProcessId; paramList.Add(obj); using (var client = new HttpClient()) { Uri baseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["UriPath"]); client.BaseAddress = baseAddress; resultString = client.PostAsJsonAsync("api/ProcessMaster/ProcessMaster_Delete", paramList) .Result .Content.ReadAsStringAsync().Result; } objReturnProcessModel = (ProcessMasterModel)Newtonsoft.Json.JsonConvert.DeserializeObject(resultString, typeof(ProcessMasterModel)); return(objReturnProcessModel); }
public ProcessMasterModel Process_InsertUpdate(ArrayList paramList) { string strResult = ""; string strReturnCode = "000"; string strReturnMsg = "UnDefined"; ProcessMasterModel apiObject = new ProcessMasterModel(); apiObject = Newtonsoft.Json.JsonConvert.DeserializeObject <ProcessMasterModel>(paramList[0].ToString()); string crCnString = UtilityLib.GetConnectionString(); int Processinfo = DL_ProcessMaster.ProcessInsert(crCnString, apiObject.ProcessId, apiObject.ProcessName, apiObject.PackingFlag, apiObject.PackingFlag, apiObject.ProcessDuration, apiObject.ProcessVolume, apiObject.WastageFlag, apiObject.ProcessUnit, apiObject.CompanyId, apiObject.ByProduct); if (Processinfo == 0) { apiObject.ReturnCode = Processinfo; apiObject.ReturnMessage = "Process Added Successfully"; } else if (Processinfo == 1) { apiObject.ReturnCode = Processinfo; apiObject.ReturnMessage = "Process already exists"; } else if (Processinfo == 101) { apiObject.ReturnCode = Processinfo; apiObject.ReturnMessage = "Process updated successfully"; } else if (Processinfo == 2) { apiObject.ReturnCode = Processinfo; apiObject.ReturnMessage = "record is already updated by someone else"; } else { apiObject.ReturnCode = Processinfo; apiObject.ReturnMessage = "Fail-Record Not Inserted"; } strResult = strReturnCode + "|" + strReturnMsg; return(apiObject); }
private IList <ProcessMasterModel> fnProcessMaster_List(ProcessMasterModel apiObject, ref string strResult) { string strReturnCode = "000"; string strReturnMsg = "UnDefined"; string crCnString = UtilityLib.GetConnectionString(); IList <ProcessMasterModel> objFieldClassModelList = new List <ProcessMasterModel>(); DataSet usersInfoDS = DL_ProcessMaster.Process_List(crCnString, apiObject.RequestType, apiObject.SearchBy, apiObject.SearchString, apiObject.ProcessId, apiObject.CompanyId, apiObject.ItemsPerPage, apiObject.RequestPageNo, apiObject.CurrentPageNo); DataTable usersInfoDT = usersInfoDS.Tables[0]; if (usersInfoDT != null && usersInfoDT.Rows.Count > 0) { strReturnCode = "001"; strReturnMsg = "Success"; foreach (DataRow dr in usersInfoDT.Rows) { apiObject = new ProcessMasterModel(); apiObject.ProcessId = UtilityLib.FormatNumber(dr["ProcessId"].ToString()); apiObject.ProcessName = (string)dr["ProcessName"]; apiObject.QuantityFlag = UtilityLib.FormatBoolean(dr["QuantityFlag"].ToString()); apiObject.ByProduct = UtilityLib.FormatBoolean(dr["ByProduct"].ToString()); apiObject.WastageFlag = UtilityLib.FormatBoolean(dr["WastageFlag"].ToString()); apiObject.QuantityFlag = UtilityLib.FormatBoolean(dr["QuantityFlag"].ToString()); apiObject.IsDelete = UtilityLib.FormatBoolean(dr["IsDelete"].ToString()); apiObject.ProcessDuration = UtilityLib.FormatDate(dr["ProcessDuration"]).ToString(); apiObject.ProcessVolume = UtilityLib.FormatFloat(dr["ProcessVolume"]); //apiObject.CompanyId = (Guid)(dr["CompanyId"]); objFieldClassModelList.Add(apiObject); } } else { strReturnCode = "002"; strReturnMsg = "Fail-Record Not Found"; } strResult = strReturnCode + "|" + strReturnMsg; return(objFieldClassModelList); }
public ProcessMasterModel DeleteProcess(ArrayList paramList) { string strResult = ""; string strReturnCode = "000"; string strReturnMsg = "UnDefined"; ProcessMasterModel apiObject = new ProcessMasterModel(); apiObject = Newtonsoft.Json.JsonConvert.DeserializeObject <ProcessMasterModel>(paramList[0].ToString()); string crCnString = UtilityLib.GetConnectionString(); int Processinfo = DL_ProcessMaster.Delete_Process(crCnString, apiObject.ProcessId); if (Processinfo == 101) { apiObject.ReturnCode = Processinfo; apiObject.ReturnMessage = "Process delete successfully"; } else { apiObject.ReturnCode = Processinfo; apiObject.ReturnMessage = "Fail-Record Not Delete"; } strResult = strReturnCode + "|" + strReturnMsg; return(apiObject); }