示例#1
0
        public static async Task <Branch> GetBranchByIdAsync(IRestDataMapper mapper, int branchId)
        {
            Branch reds = new Branch();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"branch/api/v1/branches/{branchId}";

            reds = await mapper.GetDataAsync <Branch>(url);

            return(reds);
        }
示例#2
0
        public static async Task <ObservableCollection <SupplierCriteria> > GetSupplierAttribsByBranchIdAsync(IRestDataMapper mapper, int branchId)
        {
            ObservableCollection <SupplierCriteria> data = new ObservableCollection <SupplierCriteria>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"supplier/api/v1/suppliers/attribs/{branchId}";

            data = await mapper.GetDataAsync <ObservableCollection <SupplierCriteria> >(url);

            return(data);
        }
        public static async Task <ObservableCollection <CashBook> > GetCashBookByBranchIdAsync(IRestDataMapper mapper, string dect)
        {
            ObservableCollection <CashBook> data = new ObservableCollection <CashBook>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"cashbook/api/v1/cashbooks/dec/{dect}";

            data = await mapper.GetDataAsync <ObservableCollection <CashBook> >(url);

            return(data);
        }
        public static async Task <ItemGroup> GetItemGroupByNameAsync(IRestDataMapper mapper, string groupName)
        {
            ItemGroup reds = new ItemGroup();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"item/api/v1/itemgroups/{groupName}";

            reds = await mapper.GetDataAsync <ItemGroup>(url);

            return(reds);
        }
示例#5
0
        public static async Task <Supplier> GetSupplierByParamAndBranchIdAsync(IRestDataMapper mapper, string flag, string codeOrName, int branchId)
        {
            Supplier reds = new Supplier();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"supplier/api/v1/suppliers/{flag}/{codeOrName}/{branchId}";

            reds = await mapper.GetDataAsync <Supplier>(url);

            return(reds);
        }
        public static async Task <Unit> GetAllUnitByNameAsync(IRestDataMapper mapper, string unitName)
        {
            Unit data = new Unit();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"item/api/v1/units/name/{unitName}";

            data = await mapper.GetDataAsync <Unit>(url);

            return(data);
        }
        public static async Task <UnitOfMeasurement> GetAllUnitOfMeasurementByDescriptionAsync(IRestDataMapper mapper, string desc)
        {
            UnitOfMeasurement data = new UnitOfMeasurement();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"item/api/v1/uoms/description/{desc}";

            data = await mapper.GetDataAsync <UnitOfMeasurement>(url);

            return(data);
        }
示例#8
0
        public static async Task <ObservableCollection <Purchase> > GetPurchaseByYearAsync(IRestDataMapper mapper, int bid, int year)
        {
            ObservableCollection <Purchase> reds = new ObservableCollection <Purchase>();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"purchasing/api/v1/purchases/years/{bid}/{year}";

            reds = await mapper.GetDataAsync <ObservableCollection <Purchase> >(url);

            return(reds);
        }
示例#9
0
        public static async Task <ObservableCollection <PurchaseItem> > GetAllPurchaseItemByParamAsync(IRestDataMapper mapper, int bid, string flag, long id)
        {
            ObservableCollection <PurchaseItem> data = new ObservableCollection <PurchaseItem>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"purchasing/api/v1/purchases/items/{bid}/{flag}/{id}";

            data = await mapper.GetDataAsync <ObservableCollection <PurchaseItem> >(url);

            return(data);
        }
示例#10
0
        public static async Task <ObservableCollection <Purchase> > GetAllPurchaseBySupplierIdAsync(IRestDataMapper mapper, int bid, long id)
        {
            ObservableCollection <Purchase> data = new ObservableCollection <Purchase>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"purchasing/api/v1/purchases/suppliers/{bid}/{id}";

            data = await mapper.GetDataAsync <ObservableCollection <Purchase> >(url);

            return(data);
        }
示例#11
0
        public static async Task <ObservableCollection <Purchase> > GetPurchaseByDayAndMonthAsync(IRestDataMapper mapper, int bid, int day, int month)
        {
            ObservableCollection <Purchase> reds = new ObservableCollection <Purchase>();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"purchasing/api/v1/purchases/daymonths/{bid}/{day}/{month}";

            reds = await mapper.GetDataAsync <ObservableCollection <Purchase> >(url);

            return(reds);
        }
示例#12
0
        public static async Task <ObservableCollection <Customer> > GetCustomerByBranchIdAsync(IRestDataMapper mapper, int branchId)
        {
            ObservableCollection <Customer> data = new ObservableCollection <Customer>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"customer/api/v1/customers/{branchId}";

            data = await mapper.GetDataAsync <ObservableCollection <Customer> >(url);

            return(data);
        }
示例#13
0
        public static async Task <Customer> GetCustomerByIdAndBranchIdAsync(IRestDataMapper mapper, long cusId, int branchId)
        {
            Customer reds = new Customer();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"customer/api/v1/customers/{cusId}/{branchId}";

            reds = await mapper.GetDataAsync <Customer>(url);

            return(reds);
        }
示例#14
0
        public static async Task <Branch> GetBranchByCodeOrNameAsync(IRestDataMapper mapper, string flag, string paramVal)
        {
            Branch reds = new Branch();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"branch/api/v1/branches/{flag}/{paramVal}";

            reds = await mapper.GetDataAsync <Branch>(url);

            return(reds);
        }
        public static async Task <StoreInfor> GetStoreInforByItemIdAndBranchAsync(IRestDataMapper mapper, long itemId, int branchId)
        {
            StoreInfor reds = new StoreInfor();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"item/api/v1/itemstores/{itemId}/{branchId}";

            reds = await mapper.GetDataAsync <StoreInfor>(url);

            return(reds);
        }
示例#16
0
        public static async Task <ObservableCollection <PurchaseItem> > GetPurchaseItemByExpireDateRangeAsync(IRestDataMapper mapper, int bid, DateTime sDate, DateTime eDate)
        {
            ObservableCollection <PurchaseItem> reds = new ObservableCollection <PurchaseItem>();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"purchasing/api/v1/purchases/items/date/{bid}/{sDate}/{eDate}";

            reds = await mapper.GetDataAsync <ObservableCollection <PurchaseItem> >(url);

            return(reds);
        }
        public static async Task <ObservableCollection <Unit> > GetAllUnitAsync(IRestDataMapper mapper)
        {
            ObservableCollection <Unit> data = new ObservableCollection <Unit>();

            if (mapper == null)
            {
                return(data);
            }
            string url = "item/api/v1/units";

            data = await mapper.GetDataAsync <ObservableCollection <Unit> >(url);

            return(data);
        }
示例#18
0
        public static async Task <Purchase> GetAllPurchaseByIdAsync(IRestDataMapper mapper, int bid, long id)
        {
            Purchase data = new Purchase();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"purchasing/api/v1/purchases/{bid}/{id}";

            data = await mapper.GetDataAsync <Purchase>(url);

            return(data);
        }
        public static async Task <ObservableCollection <UnitOfMeasurement> > GetAllUnitOfMeasurementByTypeAsync(IRestDataMapper mapper, string unitType)
        {
            ObservableCollection <UnitOfMeasurement> data = new ObservableCollection <UnitOfMeasurement>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"item/api/v1/uoms/type/{unitType}";

            data = await mapper.GetDataAsync <ObservableCollection <UnitOfMeasurement> >(url);

            return(data);
        }
示例#20
0
        public static async Task <Purchase> GetAllPurchaseByInvoiceNoAndRecordStAsync(IRestDataMapper mapper, int bid, string inv, string rst)
        {
            Purchase data = new Purchase();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"purchasing/api/v1/purchases/invs/{bid}/{inv}/{rst}";

            data = await mapper.GetDataAsync <Purchase>(url);

            return(data);
        }
        public static async Task <ObservableCollection <ItemGroup> > GetAllItemGroupAsync(IRestDataMapper mapper)
        {
            ObservableCollection <ItemGroup> data = new ObservableCollection <ItemGroup>();

            if (mapper == null)
            {
                return(data);
            }
            string url = "item/api/v1/itemgroups";

            data = await mapper.GetDataAsync <ObservableCollection <ItemGroup> >(url);

            return(data);
        }
        public static async Task <ObservableCollection <Item> > GetItemByGroupOrSubGroupAsync(IRestDataMapper mapper, string flag, string paramVal)
        {
            ObservableCollection <Item> data = new ObservableCollection <Item>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"item/api/v1/items/lists/{flag}/{paramVal}";

            data = await mapper.GetDataAsync <ObservableCollection <Item> >(url);

            return(data);
        }
示例#23
0
        public static async Task <Supplier> GetSupplierByIdAndBranchIdAsync(IRestDataMapper mapper, long supId, int branchId)
        {
            Supplier reds = new Supplier();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"supplier/api/v1/suppliers/{supId}/{branchId}";

            reds = await mapper.GetDataAsync <Supplier>(url);

            return(reds);
        }
        public static async Task <Item> GetItemByParamAsync(IRestDataMapper mapper, string flag, string paramVal)
        {
            Item reds = new Item();

            if (mapper == null)
            {
                return(reds);
            }
            string url = $"item/api/v1/items/{flag}/{paramVal}";

            reds = await mapper.GetDataAsync <Item>(url);

            return(reds);
        }
示例#25
0
        public static async Task <ObservableCollection <Supplier> > GetAllSupplierAsync(IRestDataMapper mapper)
        {
            ObservableCollection <Supplier> data = new ObservableCollection <Supplier>();

            if (mapper == null)
            {
                return(data);
            }
            string url = "supplier/api/v1/suppliers";

            data = await mapper.GetDataAsync <ObservableCollection <Supplier> >(url);

            return(data);
        }
        public static async Task <ObservableCollection <ItemCriteria> > GetItemAttribsByBranchIdAsync(IRestDataMapper mapper)
        {
            ObservableCollection <ItemCriteria> data = new ObservableCollection <ItemCriteria>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"item/api/v1/items/attribs";

            data = await mapper.GetDataAsync <ObservableCollection <ItemCriteria> >(url);

            return(data);
        }
        public static async Task <ObservableCollection <CashBook> > GetAllCashBookAsync(IRestDataMapper mapper, DateTime trdate)
        {
            ObservableCollection <CashBook> data = new ObservableCollection <CashBook>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"cashbook/api/v1/cashbooks/trd/{trdate}";

            data = await mapper.GetDataAsync <ObservableCollection <CashBook> >(url);

            return(data);
        }
        public static async Task <ObservableCollection <StoreInfor> > GetAllStoreInforByItemIdAsync(IRestDataMapper mapper, long itemId)
        {
            ObservableCollection <StoreInfor> data = new ObservableCollection <StoreInfor>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"item/api/v1/itemstores/{itemId}";

            data = await mapper.GetDataAsync <ObservableCollection <StoreInfor> >(url);

            return(data);
        }
示例#29
0
        public static async Task <ObservableCollection <Bank> > GetAllBankAsync(IRestDataMapper mapper)
        {
            ObservableCollection <Bank> data = new ObservableCollection <Bank>();

            if (mapper == null)
            {
                return(data);
            }
            string url = "bank/api/v1/banks";

            data = await mapper.GetDataAsync <ObservableCollection <Bank> >(url);

            return(data);
        }
示例#30
0
        public static async Task <ObservableCollection <BranchAccount> > GetAllBranchAccountAsync(IRestDataMapper mapper, int brId)
        {
            ObservableCollection <BranchAccount> data = new ObservableCollection <BranchAccount>();

            if (mapper == null)
            {
                return(data);
            }
            string url = $"branch/api/v1/brancheacs/{brId}";

            data = await mapper.GetDataAsync <ObservableCollection <BranchAccount> >(url);

            return(data);
        }