private IList <GeneralMasterClass> fnGeneralMasterClass_List(GeneralMasterClass apiObject, ref string strResult) { string strReturnCode = "000"; string strReturnMsg = "UnDefined"; string crCnString = UtilityLib.GetConnectionString(); IList <GeneralMasterClass> objGeneralClassModelList = new List <GeneralMasterClass>(); DataSet usersInfoDS = DAL_GeneralMasterClass.GeneralMasterClass_List(crCnString, apiObject.RequestType, apiObject.SearchBy, apiObject.SearchString, apiObject.IntID, 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 GeneralMasterClass(); apiObject.GeneralMasterClassId = UtilityLib.FormatNumber(dr["GeneralMasterClassId"].ToString()); apiObject.GeneralMasterClassName = (string)dr["GeneralMasterClassName"]; apiObject.CompanyId = (Guid)(dr["CompanyId"]); objGeneralClassModelList.Add(apiObject); } } else { strReturnCode = "002"; apiObject.ReturnMessage = "Fail-Record Not Found"; } strResult = strReturnCode + "|" + strReturnMsg; return(objGeneralClassModelList); }
public static IList <GeneralMasterClass> GetGeneralClassList(int?IntID, int selectionType, string SearchBy, string SearchString, Guid?CompanyId, int ItemsPerPage, int RequestPage, int CurrentPageNo) { ArrayList paramList = new ArrayList(); string resultString; IList <GeneralMasterClass> objGeneralMasterModel = null; GeneralMasterClass obj = new GeneralMasterClass(); obj.SearchString = SearchString; obj.RequestType = selectionType; obj.IntID = IntID; obj.CompanyId = CompanyId; obj.ItemsPerPage = ItemsPerPage; obj.RequestPageNo = RequestPage; paramList.Add(obj); using (var client = new HttpClient()) { Uri baseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["UriPath"]); client.BaseAddress = baseAddress; resultString = client.PostAsJsonAsync("api/GeneralMasterClass/GeneralMasterClass_List", paramList) .Result .Content.ReadAsStringAsync().Result; } objGeneralMasterModel = (IList <GeneralMasterClass>)Newtonsoft.Json.JsonConvert.DeserializeObject(resultString, typeof(IList <GeneralMasterClass>)); return(objGeneralMasterModel); }
public IList <GeneralMasterClass> GeneralMasterClass_List(ArrayList paramList) { GeneralMasterClass apiObject = new GeneralMasterClass(); string strResult = ""; IList <GeneralMasterClass> apiObjectList = null; apiObject = Newtonsoft.Json.JsonConvert.DeserializeObject <GeneralMasterClass>(paramList[0].ToString()); /// ============= apiObjectList = fnGeneralMasterClass_List(apiObject, ref strResult); return(apiObjectList); }