public NRestResult <List <UserCreditBalance> > GetActiveUserCreditBalances(TSB value) { NRestResult <List <UserCreditBalance> > ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <List <UserCreditBalance> >(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <List <UserCreditBalance> >( RouteConsts.Credit.GetActiveUserCreditBalances.Url, value); } else { ret = new NRestResult <List <UserCreditBalance> >(); ret.ParameterIsNull(); ret.data = new List <UserCreditBalance>(); } return(ret); }
public NRestResult <TSBExchangeGroup> SaveTSBExchangeGroup( TSBExchangeGroup value) { NRestResult <TSBExchangeGroup> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <TSBExchangeGroup>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <TSBExchangeGroup>( RouteConsts.Exchange.SaveTSBExchangeGroup.Url, value); } else { ret = new NRestResult <TSBExchangeGroup>(); ret.ParameterIsNull(); ret.data = null; } return(ret); }
public NRestResult <TSBCouponTransaction> SaveTransaction(TSBCouponTransaction value) { NRestResult <TSBCouponTransaction> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <TSBCouponTransaction>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <TSBCouponTransaction>( RouteConsts.Coupon.SaveTSBCouponTransaction.Url, value); } else { ret = new NRestResult <TSBCouponTransaction>(); ret.ParameterIsNull(); ret.data = null; } return(ret); }
public NRestResult <List <TSBCreditTransaction> > GetReplaceTSBCreditTransaction(DateTime value) { NRestResult <List <TSBCreditTransaction> > ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <List <TSBCreditTransaction> >(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <List <TSBCreditTransaction> >( RouteConsts.Credit.GetReplaceTSBCreditTransaction.Url, value); } else { ret = new NRestResult <List <TSBCreditTransaction> >(); ret.ParameterIsNull(); ret.data = null; } return(ret); }
public NRestResult <TSBExchangeTransaction> GetTSBExchangeTransaction( Search.Exchanges.Transactions.Filter value) { NRestResult <TSBExchangeTransaction> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <TSBExchangeTransaction>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <TSBExchangeTransaction>( RouteConsts.Exchange.GetTSBExchangeTransaction.Url, value); } else { ret = new NRestResult <TSBExchangeTransaction>(); ret.ParameterIsNull(); ret.data = null; } return(ret); }
public NRestResult <List <TSBCouponSummary> > GetTSBCouponSummaries(TSB value) { NRestResult <List <TSBCouponSummary> > ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <List <TSBCouponSummary> >(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <List <TSBCouponSummary> >( RouteConsts.Coupon.GetTSBCouponSummaries.Url, value); } else { ret = new NRestResult <List <TSBCouponSummary> >(); ret.ParameterIsNull(); ret.data = new List <TSBCouponSummary>(); } return(ret); }
public NRestResult <TSBCouponBalance> GetTSBBalance(TSB value) { NRestResult <TSBCouponBalance> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <TSBCouponBalance>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <TSBCouponBalance>( RouteConsts.Coupon.GetTSBBalance.Url, value); } else { ret = new NRestResult <TSBCouponBalance>(); ret.ParameterIsNull(); ret.data = null; } return(ret); }
public NRestResult <List <TAServerCouponTransaction> > GetTAServerCouponTransactions( string tsbId, string userId, int?transactionType, int?couponType) { NRestResult <List <TAServerCouponTransaction> > ret; NRestClient client = NRestClient.CreateTAxTODClient(); if (null == client) { ret = new NRestResult <List <TAServerCouponTransaction> >(); ret.RestInvalidConfig(); return(ret); } var url = "api/users/coupons/getlist"; var value = new { tsbid = tsbId, userid = userId, transactiontype = transactionType, coupontype = couponType }; if (null != value) { ret = client.Execute <List <TAServerCouponTransaction> >(url, value); } else { ret = new NRestResult <List <TAServerCouponTransaction> >(); ret.ParameterIsNull(); } return(ret); }
public NRestResult <UserShift> GetCurrent(User value) { NRestResult <UserShift> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <UserShift>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <UserShift>( RouteConsts.UserShift.GetCurrent.Url, value); } else { ret = new NRestResult <UserShift>(); ret.ParameterIsNull(); ret.data = null; } return(ret); }
public NRestResult <LanePayment> GetCurrentPaymentsByLane( Search.Lanes.Current.PaymentByLane value) { NRestResult <LanePayment> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <LanePayment>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <LanePayment>( RouteConsts.Lane.GetCurrentPaymentsByLane.Url, value); } else { ret = new NRestResult <LanePayment>(); ret.ParameterIsNull(); } return(ret); }
public NRestResult <List <LanePayment> > GetPaymentsByUserShift( Search.Lanes.Attendances.ByUserShift value) { NRestResult <List <LanePayment> > ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <List <LanePayment> >(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <List <LanePayment> >( RouteConsts.Lane.GetPaymentsByUserShift.Url, value); } else { ret = new NRestResult <List <LanePayment> >(); ret.ParameterIsNull(); } return(ret); }
public NRestResult <List <LaneAttendance> > GetAttendancesByRevenue( RevenueEntry value) { NRestResult <List <LaneAttendance> > ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <List <LaneAttendance> >(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <List <LaneAttendance> >( RouteConsts.Lane.GetAttendancesByRevenue.Url, value); } else { ret = new NRestResult <List <LaneAttendance> >(); ret.ParameterIsNull(); } return(ret); }
public NRestResult <UserCreditBalance> SaveUserCreditBalance(UserCreditBalance value) { NRestResult <UserCreditBalance> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <UserCreditBalance>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <UserCreditBalance>( RouteConsts.Credit.SaveUserCreditBalance.Url, value); } else { ret = new NRestResult <UserCreditBalance>(); ret.ParameterIsNull(); ret.data = null; } return(ret); }
public NRestResult <UserCreditBalance> GetNoRevenueEntryUserCreditBalanceById( Search.UserCredits.GetActiveById value) { NRestResult <UserCreditBalance> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <UserCreditBalance>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <UserCreditBalance>( RouteConsts.Credit.GetNoRevenueEntryUserCreditBalanceById.Url, value); } else { ret = new NRestResult <UserCreditBalance>(); ret.ParameterIsNull(); ret.data = null; } return(ret); }
public static NRestResult ToRest(this NDbResult value) { NRestResult ret = new NRestResult(); if (null != value) { ret.errors.errNum = value.errors.errNum; ret.errors.errMsg = value.errors.errMsg; } else { ret.ParameterIsNull(); } return(ret); }
public static NRestResult <T> ToRest <T>(this NDbResult <T> value) where T : new() { NRestResult <T> ret = new NRestResult <T>(); if (null != value) { ret.data = value.data; ret.errors.errNum = value.errors.errNum; ret.errors.errMsg = value.errors.errMsg; } else { ret.ParameterIsNull(); } return(ret); }
public NRestResult SaveTransaction(TAServerCouponTransaction value) { NRestResult ret; NRestClient client = NRestClient.CreateTAxTODClient(); if (null == client) { ret = new NRestResult(); ret.RestInvalidConfig(); return(ret); } var url = "api/users/coupons/save"; if (null != value) { var inst = new { couponpk = value.CouponPK, transactiondate = value.TransactionDate, //transactionid = value.TransactionId, tsbid = value.TSBId, coupontype = value.CouponType, serialno = value.SerialNo, price = value.Price, userid = value.UserId, userreceivedate = value.UserReceiveDate, Couponstatus = value.CouponStatus, solddate = value.SoldDate, soldby = value.SoldBy, finishflag = value.FinishFlag }; ret = client.Execute <List <TAServerCouponTransaction> >(url, inst); } else { ret = new NRestResult(); ret.ParameterIsNull(); } return(ret); }
public NRestResult <Role> GetRole(Search.Roles.ById value) { NRestResult <Role> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <Role>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <Role>(RouteConsts.User.GetRole.Url, value); } else { ret = new NRestResult <Role>(); ret.ParameterIsNull(); } return(ret); }
public NRestResult ChangeShift(TSBShift value, List <Plaza> plazas) { NRestResult ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult(); ret.RestInvalidConfig(); return(ret); } if (null != value) { // set date value.Begin = DateTime.Now; ret = client.Execute(RouteConsts.Shift.ChangeShift.Url, value); if (ret.Ok && null != plazas && plazas.Count > 0) { // send to server SCWOperations server = SCWServiceOperations.Instance.Plaza; var inst = new SCWChiefOfDuty(); inst.networkId = 31; // TODO: network id required. inst.plazaId = Convert.ToInt32(plazas[0].SCWPlazaId); inst.staffId = value.UserId; inst.staffTypeId = 1; inst.beginDateTime = value.Begin; // send. server.TOD.SaveChiefOfDuty(inst); } } else { ret = new NRestResult(); ret.ParameterIsNull(); } return(ret); }
public NRestResult <User> SaveUser(User value) { NRestResult <User> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <User>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <User>(RouteConsts.User.SaveUser.Url, value); } else { ret = new NRestResult <User>(); ret.ParameterIsNull(); } return(ret); }
public NRestResult SetActive(TSB value) { NRestResult ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute(RouteConsts.TSB.SetActive.Url, value); } else { ret = new NRestResult(); ret.ParameterIsNull(); } return(ret); }
public NRestResult <List <User> > SearchById(Search.Users.ById value) { NRestResult <List <User> > ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <List <User> >(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <List <User> >(RouteConsts.User.SearchById.Url, value); } else { ret = new NRestResult <List <User> >(); ret.ParameterIsNull(); } return(ret); }
public NRestResult EndUserShift(UserShift value) { NRestResult ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute(RouteConsts.UserShift.EndUserShift.Url, value); } else { ret = new NRestResult(); ret.ParameterIsNull(); } return(ret); }
public NRestResult <List <Plaza> > GetPlazaGroupPlazas(PlazaGroup value) { NRestResult <List <Plaza> > ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <List <Plaza> >(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <List <Plaza> >(RouteConsts.TSB.GetPlazaGroupPlazas.Url, value); } else { ret = new NRestResult <List <Plaza> >(); ret.ParameterIsNull(); } return(ret); }
public NRestResult <Lane> SaveLane(Lane value) { NRestResult <Lane> ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <Lane>(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <Lane>(RouteConsts.TSB.SaveLane.Url, value); } else { ret = new NRestResult <Lane>(); ret.ParameterIsNull(); } return(ret); }
public NRestResult <List <TSBExchangeGroup> > GetTSBExchangeGroups(Search.Exchanges.Filter value) { NRestResult <List <TSBExchangeGroup> > ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <List <TSBExchangeGroup> >(); ret.RestInvalidConfig(); return(ret); } if (null != value) { ret = client.Execute <List <TSBExchangeGroup> >( RouteConsts.Exchange.GetTSBExchangeGroups.Url, value); } else { ret = new NRestResult <List <TSBExchangeGroup> >(); ret.ParameterIsNull(); } return(ret); }
public NRestResult SyncTransactions(List <TSBCouponTransaction> values) { NRestResult ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult(); ret.RestInvalidConfig(); return(ret); } if (null != values) { ret = client.Execute( RouteConsts.Coupon.SyncTSBCouponTransactions.Url, values); } else { ret = new NRestResult(); ret.ParameterIsNull(); } return(ret); }
public NRestResult SaveAttendances(List <LaneAttendance> values) { NRestResult ret; NRestClient client = NRestClient.CreateLocalClient(); if (null == client) { ret = new NRestResult <LaneAttendance>(); ret.RestInvalidConfig(); return(ret); } if (null != values) { ret = client.Execute( RouteConsts.Lane.SaveAttendances.Url, values); } else { ret = new NRestResult(); ret.ParameterIsNull(); } return(ret); }