Пример #1
0
        public static T_COM_Master_Employee_PositionCollection Search(SearchFilter value)
        {
            T_COM_Master_Employee_PositionCollection items = new T_COM_Master_Employee_PositionCollection();
            string key = string.Format(SETTINGS_Search_KEY, value.Keyword, value.Page, value.PageSize, value.OrderBy, value.OrderDirection, value.Condition);

            if (SystemConfig.AllowSearchCache)
            {
                object obj2 = HttpCache.Get(key);

                if ((obj2 != null))
                {
                    return((T_COM_Master_Employee_PositionCollection)obj2);
                }
            }

            using (var client = WebApiHelper.myclient(HouseEndpoint, SystemConst.APIJosonReturnValue))
            {
                HttpResponseMessage response = client.PostAsJsonAsync(Resource + "?method=search", value).GetAwaiter().GetResult();

                if (response.IsSuccessStatusCode)
                {
                    items = response.Content.ReadAsAsync <T_COM_Master_Employee_PositionCollection>().GetAwaiter().GetResult();
                }
            }

            if (SystemConfig.AllowSearchCache)
            {
                HttpCache.Max(key, items);
            }
            return(items);
        }
Пример #2
0
        public ContentResult Search(SearchFilter SearchKey)
        {
            SearchKey.OrderBy = string.IsNullOrEmpty(SearchKey.OrderBy) ? "ID" : SearchKey.OrderBy;
            T_COM_Master_Employee_PositionCollection collection = T_COM_Master_Employee_PositionManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(collection), "application/json"));
        }
Пример #3
0
        /// <summary>
        /// use for scrolling page
        /// </summary>
        /// <returns></returns>
        public ContentResult GetPg(int page, int pagesize)
        {
            string       condition = "";
            SearchFilter SearchKey = SearchFilter.SearchPG(1, page, pagesize, "ID", "ID", "Desc", condition);
            T_COM_Master_Employee_PositionCollection objItem = T_COM_Master_Employee_PositionManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
Пример #4
0
        public ActionResult EmpPosition(int EmployeeCode)
        {
            SearchFilter SearchKey = BindSearch("");

            SearchKey.Condition      = "  (EmployeeCode=" + EmployeeCode + ") ";
            SearchKey.OrderBy        = "EffectiveFrom";
            SearchKey.OrderDirection = "Desc";
            T_COM_Master_Employee_PositionCollection collection = T_COM_Master_Employee_PositionManager.Search(SearchKey);

            return(View(ViewFolder + "EmpPosition.cshtml", collection));
        }
Пример #5
0
        public JsonResult GetGata([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel)
        {
            SearchFilter SearchKey = SearchFilter.SearchData(1, requestModel, "ID", "ID");
            T_COM_Master_Employee_PositionCollection collection = T_COM_Master_Employee_PositionManager.Search(SearchKey);
            int TotalRecord = 0;

            if (collection.Count > 0)
            {
                TotalRecord = collection[0].TotalRecord;
            }
            return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet));
        }
Пример #6
0
        public JsonResult GetSearchData([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel, string searchprm)
        {
            SearchFilter SearchKey = BindSearch(searchprm);

            SearchKey = SearchFilter.SearchData(SearchKey, requestModel);
            T_COM_Master_Employee_PositionCollection collection = T_COM_Master_Employee_PositionManager.Search(SearchKey);
            int TotalRecord = 0;

            if (collection.Count > 0)
            {
                TotalRecord = collection[0].TotalRecord;
            }
            //{{Class}Collection data = {{Class}}Manager.GetAll(CurrentUser.CompanyID);
            return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet));
        }
Пример #7
0
        public static T_COM_Master_Employee_PositionCollection GetbyUser(string CreatedUser)
        {
            T_COM_Master_Employee_PositionCollection collection = new T_COM_Master_Employee_PositionCollection();
            T_COM_Master_Employee_Position           obj;

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_COM_Master_Employee_Position_GetAll_byUser", new SqlParameter("@CreatedUser", CreatedUser)))
            {
                while (reader.Read())
                {
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Пример #8
0
        public static T_COM_Master_Employee_PositionCollection Search(SearchFilter SearchKey)
        {
            T_COM_Master_Employee_PositionCollection collection = new T_COM_Master_Employee_PositionCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_COM_Master_Employee_Position_Search", SearchFilterManager.SqlSearchConditionNoCompany(SearchKey)))
            {
                while (reader.Read())
                {
                    T_COM_Master_Employee_Position obj = new T_COM_Master_Employee_Position();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Пример #9
0
        public static T_COM_Master_Employee_PositionCollection GetAllItem()
        {
            T_COM_Master_Employee_PositionCollection collection = new T_COM_Master_Employee_PositionCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_COM_Master_Employee_Position_GetAll", null))
            {
                while (reader.Read())
                {
                    T_COM_Master_Employee_Position obj = new T_COM_Master_Employee_Position();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Пример #10
0
        /// <summary>
        /// ExportExcel File
        /// </summary>
        /// <returns></returns>
        public string ExportExcel()
        {
            T_COM_Master_Employee_PositionCollection collection = T_COM_Master_Employee_PositionManager.GetAll();
            DataTable dt       = collection.ToDataTable <T_COM_Master_Employee_Position>();
            string    fileName = "T_COM_Master_Employee_Position_" + SystemConfig.CurrentDate.ToString("MM-dd-yyyy");

            string[] RemoveColumn = { "CompanyID", "TargetDisplayID", "ReturnDisplay", "TotalRecord", "CreatedUser", "CreatedDate" };
            for (int i = 0; i < RemoveColumn.Length; i++)
            {
                if (dt.Columns.Contains(RemoveColumn[i]))
                {
                    dt.Columns.Remove(RemoveColumn[i]);
                }
            }
            FileInputHelper.ExportExcel(dt, fileName, "T_COM_Master_Employee_Position List", false);
            return(fileName);
        }
Пример #11
0
        public static T_COM_Master_Employee_PositionCollection GetAll()
        {
            T_COM_Master_Employee_PositionCollection items = new T_COM_Master_Employee_PositionCollection();
            string key  = SETTINGS_ALL_KEY;
            object obj2 = HttpCache.Get(key);

            if ((obj2 != null))
            {
                return((T_COM_Master_Employee_PositionCollection)obj2);
            }
            using (var client = WebApiHelper.myclient(HouseEndpoint, SystemConst.APIJosonReturnValue))
            {
                HttpResponseMessage response = client.GetAsync(Resource).GetAwaiter().GetResult();

                if (response.IsSuccessStatusCode)
                {
                    items = response.Content.ReadAsAsync <T_COM_Master_Employee_PositionCollection>().GetAwaiter().GetResult();
                }
            }
            HttpCache.Max(key, items);
            return(items);
        }