public static List <classificationOutput> GetClassificationList(DistrictMemListInput obj, out int totalPages) { List <classificationOutput> Result = new List <classificationOutput>(); try { MySqlParameter[] param = new MySqlParameter[5]; param[0] = new MySqlParameter("?grpID", obj.grpID); param[1] = new MySqlParameter("?PageNo", string.IsNullOrEmpty(obj.pageNo) ? "1" : obj.pageNo); param[2] = new MySqlParameter("?NoOfRecord", string.IsNullOrEmpty(obj.recordCount) ? "100" : obj.recordCount); param[3] = new MySqlParameter("?TotalCount", DbType.Int32); param[4] = new MySqlParameter("?SearchText", string.IsNullOrEmpty(obj.searchText) ? "" : obj.searchText); param[3].Direction = ParameterDirection.Output; DataSet dsClassification = MySqlHelper.ExecuteDataset(GlobalVar.strAppConn, CommandType.StoredProcedure, "V7GetDistrictClassifications", param); totalPages = Convert.ToInt32(param[3].Value); if (dsClassification != null) { if (dsClassification.Tables[0].Rows.Count > 0) { Result = GlobalFuns.DataTableToList <classificationOutput>(dsClassification.Tables[0]); } } } catch { throw; } return(Result); }
public static List <DistrictMemListResult> GetDistrictMemberList(DistrictMemListInput obj, out int totalPages) { List <DistrictMemListResult> memberList = new List <DistrictMemListResult>(); try { if (!string.IsNullOrEmpty(obj.searchText)) { obj.searchText = obj.searchText.Replace(" ", "%"); } MySqlParameter[] param = new MySqlParameter[6]; param[0] = new MySqlParameter("?masterUID", obj.masterUID); param[1] = new MySqlParameter("?groupID", obj.grpID); param[2] = new MySqlParameter("?SearchText", string.IsNullOrEmpty(obj.searchText)?"":obj.searchText); param[3] = new MySqlParameter("?PageNo", string.IsNullOrEmpty(obj.pageNo)?"1":obj.pageNo); param[4] = new MySqlParameter("?NoOfRecord", string.IsNullOrEmpty(obj.recordCount)?"100":obj.recordCount); param[5] = new MySqlParameter("?TotalCount", DbType.Int32); param[5].Direction = ParameterDirection.InputOutput; DataSet dsMember = MySqlHelper.ExecuteDataset(GlobalVar.strAppConn, CommandType.StoredProcedure, "V7_USPGetDistrictDirectoryList", param); totalPages = Convert.ToInt32(param[5].Value); if (dsMember != null) { if (dsMember.Tables[0].Rows.Count > 0) { memberList = GlobalFuns.DataTableToList <DistrictMemListResult>(dsMember.Tables[0]); foreach (DistrictMemListResult mem in memberList) { if (!string.IsNullOrEmpty(mem.pic)) { string ImageName = mem.pic.ToString(); string path = ConfigurationManager.AppSettings["imgPath"] + "Documents/directory/"; mem.pic = path + ImageName; } } } } } catch { throw; } return(memberList); }
public object GetMemberByClassification(DistrictMemListInput cls) { dynamic MemberListResult; List <DistrictMemListResult> Result = new List <DistrictMemListResult>(); try { Result = District.GetMemberByClassification(cls.classification, cls.grpID); if (Result != null) { MemberListResult = new { status = "0", message = "success", Result }; } else { MemberListResult = new { status = "0", message = "Record not found" }; } } catch { MemberListResult = new { status = "1", message = "failed" }; } return(new { MemberListResult }); }
public object GetDistrictMemberList(DistrictMemListInput obj) { dynamic MemberDirectoryResult; int totalPages = 0; try { List <DistrictMemListResult> Result = District.GetDistrictMemberList(obj, out totalPages); if (Result != null) { MemberDirectoryResult = new { status = "0", message = "success", resultCount = Result.Count.ToString(), TotalPages = totalPages.ToString(), currentPage = obj.pageNo.ToString(), Result }; } else { MemberDirectoryResult = new { status = "1", message = "falied" }; } } catch (Exception ex) { MemberDirectoryResult = new { status = "1", message = "falied", ex.Message }; } return(MemberDirectoryResult); }
public object GetClassificationList(DistrictMemListInput obj) { dynamic ClassificationListResult; List <classificationOutput> Result = new List <classificationOutput>(); int totalPages = 0; try { Result = District.GetClassificationList(obj, out totalPages); if (Result != null) { ClassificationListResult = new { status = "0", message = "success", resultCount = Result.Count.ToString(), TotalPages = totalPages.ToString(), currentPage = obj.pageNo.ToString(), Result }; } else { ClassificationListResult = new { status = "0", message = "Record not found" }; } } catch { ClassificationListResult = new { status = "1", message = "failed" }; } return(new { ClassificationListResult }); }