Пример #1
0
        public static districtCommittee getDistrictCommitteeList(districtCommitteeInput Obj)
        {
            try
            {
                MySqlParameter[] param = new MySqlParameter[2];

                param[0] = new MySqlParameter("@p_groupId", Obj.groupID);
                param[1] = new MySqlParameter("@p_searchText", Obj.searchText);
                DataSet Result = MySqlHelper.ExecuteDataset(GlobalVar.strAppConn, CommandType.StoredProcedure, "API_districtCommitteeList", param);

                DataTable dt_WithoutCatlist = Result.Tables[0];
                DataTable dt_withcatlist    = Result.Tables[1];

                List <districtCommitteeWithoutCatList> WithoutCategoryList = new List <districtCommitteeWithoutCatList>();
                List <districtCommitteeWithCatList>    WithDirectoryList   = new List <districtCommitteeWithCatList>();

                if (dt_WithoutCatlist.Rows.Count > 0)
                {
                    foreach (DataRow item in dt_WithoutCatlist.Rows)
                    {
                        if (item["img"].ToString() != "")
                        {
                            if (item["fk_Member_profileID"].ToString() == "0")
                            {
                                string profile_Image = item["img"].ToString();
                                string path          = ConfigurationManager.AppSettings["imgPath"] + "Documents/DistrictCommittee/Group" + Obj.groupID + "/thumb/";
                                item["img"] = path + profile_Image;
                            }
                            else
                            {
                                string profile_Image = item["img"].ToString();
                                string path          = ConfigurationManager.AppSettings["imgPath"] + "Documents/directory/";
                                item["img"] = path + profile_Image;
                            }
                        }
                        else
                        {
                            item["img"] = "";
                        }
                    }

                    WithoutCategoryList = GlobalFuns.DataTableToList <districtCommitteeWithoutCatList>(dt_WithoutCatlist);
                }

                if (dt_withcatlist.Rows.Count > 0)
                {
                    WithDirectoryList = GlobalFuns.DataTableToList <districtCommitteeWithCatList>(dt_withcatlist);
                }

                districtCommittee obj = new districtCommittee();
                obj.districtCommitteeWithoutCatList = WithoutCategoryList;
                obj.districtCommitteeWithCatList    = WithDirectoryList;

                return(obj);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public object districtCommitteeSearchList(districtCommitteeInput attendance)
        {
            dynamic TBDistrictCommitteeResult;

            try
            {
                districtCommittee Result = DistrictCommittee.getDistrictCommitteeSearchList(attendance);

                if (Result != null)
                {
                    TBDistrictCommitteeResult = new { status = "0", message = "success", Result };
                }
                else
                {
                    TBDistrictCommitteeResult = new { status = "0", message = "Record not found" };
                }
            }
            catch
            {
                TBDistrictCommitteeResult = new { status = "1", message = "failed" };
            }

            return(new { TBDistrictCommitteeResult });
        }