//public override async Task<HsborsResponse<bool>> Delete(long id) //{ // var hsbors_server = new HsborsResponse<bool>(); // await hsbors_server.RequestServer(HsborsApiUrl.delete_unit_cost, id); // return hsbors_server; //} public override async Task <HsborsResponse <T> > Get <T>(string id) { var hsbors_server = new HsborsResponse <T>(); await hsbors_server.RequestServer(HsborsApiUrl.get_unitcost, null, id); string hsDate = HSDate.ToHSDate((DateTime)(hsbors_server.Model as UnitCost).date); (hsbors_server.Model as UnitCost).hsdate = hsDate; return(hsbors_server); }
public override async Task <HsborsResponse <List <T> > > Search <T, SearchUnitCostRequest>(SearchUnitCostRequest filter) { var hsbors_server = new HsborsResponse <List <T> >(); await hsbors_server.RequestServer(HsborsApiUrl.search_unit_by_filters, filter); foreach (var item in hsbors_server.Model) { (item as UnitCost).hsdate = HSDate.ToHSDate((item as UnitCost).date); } return(hsbors_server); }
public override async Task <HsborsResponse <UnitCost> > Add <UnitCost>() { var hsbors_server = new HsborsResponse <UnitCost>(); Dictionary <string, object> fund = new Dictionary <string, object> { [nameof(this.cancel_cost)] = cancel_cost, [nameof(this.date)] = date, [nameof(this.fund_id)] = fund_id, [nameof(this.issue_cost)] = issue_cost }; await hsbors_server.RequestServer(HsborsApiUrl.add_unit_cost, fund); return(hsbors_server); }
//public override async Task<HsborsResponse<List<Account>>> Search<Account, SearchAccountRequest>(SearchAccountRequest filter) //{ // var hsbors_server = new HsborsResponse<List<Account>>(); // await hsbors_server.RequestServer(HsborsApiUrl.search_account_by_filters, filter); // return hsbors_server; //} public async override Task <HsborsResponse <Account> > Add <Account>() { var hsbors_server = new HsborsResponse <Account>(); Dictionary <string, object> account = new Dictionary <string, object> { [nameof(this.accounter_id)] = accounter_id, [nameof(this.fund_id)] = fund_id, [nameof(this.name)] = name, [nameof(this.no)] = no }; await hsbors_server.RequestServer(HsborsApiUrl.add_account, account); return(hsbors_server); }