public static T_COM_Master_EntityCollection GetAll()
        {
            T_COM_Master_EntityCollection items = new T_COM_Master_EntityCollection();

            string key  = String.Format(SETTINGS_ALL_KEY, CustomerAuthorize.CurrentUser.EmployeeCode);
            object obj2 = HttpCache.Get(key);

            if ((obj2 != null))
            {
                return((T_COM_Master_EntityCollection)obj2);
            }
            T_COM_Master_EntityCollection filter = new T_COM_Master_EntityCollection();

            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_EntityCollection>().GetAwaiter().GetResult();
                }
            }
            if (items.Count > 0 && CustomerAuthorize.CurrentUser != null)
            {
                foreach (T_COM_Master_Entity b in items)
                {
                    if (CustomerAuthorize.CurrentUser.EntityID == b.EntityId)
                    {
                        filter.Add(b);
                    }
                }
            }
            HttpCache.Max(key, filter);
            return(items);
        }
Esempio n. 2
0
        public static T_COM_Master_EntityCollection Search(SearchFilter SearchKey)
        {
            T_COM_Master_EntityCollection collection = new T_COM_Master_EntityCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_COM_Master_Entity_Search", SearchFilterManager.SqlSearchParamNoCompany(SearchKey)))
            {
                while (reader.Read())
                {
                    T_COM_Master_Entity obj = new T_COM_Master_Entity();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Esempio n. 3
0
        public static T_COM_Master_EntityCollection GetbyEmployeeCode(int EmployeeCode)
        {
            T_COM_Master_EntityCollection collection = new T_COM_Master_EntityCollection();
            T_COM_Master_Entity           obj;

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_COM_Master_Entity_GetAll_byEmployeeCode", new SqlParameter("@EmployeeCode", EmployeeCode)))
            {
                while (reader.Read())
                {
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Esempio n. 4
0
        public static T_COM_Master_EntityCollection GetAllItem()
        {
            T_COM_Master_EntityCollection collection = new T_COM_Master_EntityCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_COM_Master_Entity_GetAll", null))
            {
                while (reader.Read())
                {
                    T_COM_Master_Entity obj = new T_COM_Master_Entity();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }