public List <User> GetUsers(Role role)
            {
                var ret = NRestClient.Create(port: 9000).Execute <List <User> >(
                    RouteConsts.User.GetUsers.Url, role);

                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 Role GetRole(Search.Roles.ById value)
            {
                var ret = NRestClient.Create(port: 9000).Execute <Role>(
                    RouteConsts.User.GetRole.Url, value);

                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 <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 <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);
            }
Exemplo n.º 7
0
            public List <UserShift> GetUserShifts(User collector)
            {
                var ret = NRestClient.Create(port: 9000).Execute <List <UserShift> >(
                    RouteConsts.Job.GetUserShifts.Url, collector);

                return(ret);
            }
            public NRestResult <LanePayment> CreatePayment(Lane lane, User supervisor,
                                                           Payment payment, DateTime date, decimal amount)
            {
                NRestResult <LanePayment> ret;
                NRestClient client = NRestClient.CreateLocalClient();

                if (null == client)
                {
                    ret = new NRestResult <LanePayment>();
                    ret.RestInvalidConfig();
                    return(ret);
                }

                ret = client.Execute <LanePayment>(
                    RouteConsts.Lane.CreatePayment.Url,
                    new LanePaymentCreate()
                {
                    Lane    = lane,
                    User    = supervisor,
                    Payment = payment,
                    Date    = date,
                    Amount  = amount
                });
                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);
            }
Exemplo n.º 10
0
            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 <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 <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 <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);
            }
Exemplo n.º 14
0
            public List <Role> GetRoles()
            {
                var ret = NRestClient.Create(port: 9000).Execute <List <Role> >(
                    RouteConsts.User.GetRoles.Url, new { });

                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 <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);
            }
Exemplo n.º 17
0
            public User GetById(Search.Users.ById value)
            {
                var ret = NRestClient.Create(port: 9000).Execute <User>(
                    RouteConsts.User.GetById.Url, value);

                return(ret);
            }
            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 <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);
            }
Exemplo n.º 20
0
            public List <Lane> GetPlazaLanes(Plaza plaza)
            {
                var ret = NRestClient.Create(port: 9000).Execute <List <Lane> >(
                    RouteConsts.TSB.GetPlazaLanes.Url, plaza);

                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);
            }
Exemplo n.º 22
0
            public List <Lane> GetTSBLanes(TSB tsb)
            {
                var ret = NRestClient.Create(port: 9000).Execute <List <Lane> >(
                    RouteConsts.TSB.GetTSBLanes.Url, tsb);

                return(ret);
            }
Exemplo n.º 23
0
            public List <TSB> GetTSBs()
            {
                var ret = NRestClient.Create(port: 9000).Execute <List <TSB> >(
                    RouteConsts.TSB.GetTSBs.Url, new { });

                return(ret);
            }
Exemplo n.º 24
0
            public List <Shift> GetShifts()
            {
                var ret = NRestClient.Create(port: 9000).Execute <List <Shift> >(
                    RouteConsts.Shift.GetShifts.Url, new { });

                return(ret);
            }
Exemplo n.º 25
0
            public List <LaneAttendance> GetAttendancesByUserShift(
                Search.Lanes.Attendances.ByUserShift value)
            {
                var ret = NRestClient.Create(port: 9000).Execute <List <LaneAttendance> >(
                    RouteConsts.Lane.GetAttendancesByUserShift.Url, value);

                return(ret);
            }
Exemplo n.º 26
0
            public List <LanePayment> GetPaymentsByLane(
                Search.Lanes.Attendances.ByLane value)
            {
                var ret = NRestClient.Create(port: 9000).Execute <List <LanePayment> >(
                    RouteConsts.Lane.GetPaymentsByLane.Url, value);

                return(ret);
            }
Exemplo n.º 27
0
            public LaneAttendance GetCurrentAttendancesByLane(
                Search.Lanes.Current.AttendanceByLane value)
            {
                var ret = NRestClient.Create(port: 9000).Execute <LaneAttendance>(
                    RouteConsts.Lane.GetCurrentAttendancesByLane.Url, value);

                return(ret);
            }
Exemplo n.º 28
0
            public LanePayment GetCurrentPaymentsByLane(
                Search.Lanes.Current.PaymentByLane value)
            {
                var ret = NRestClient.Create(port: 9000).Execute <LanePayment>(
                    RouteConsts.Lane.GetCurrentPaymentsByLane.Url, value);

                return(ret);
            }
Exemplo n.º 29
0
 public bool BeginJob(UserShift shift)
 {
     if (null == shift)
     {
         return(false);
     }
     return(NRestClient.Create(port: 9000).Execute <bool>(
                RouteConsts.Job.BeginJob.Url, shift));
 }
Exemplo n.º 30
0
 public void EndJob(UserShift shift)
 {
     if (null == shift)
     {
         return;
     }
     NRestClient.Create(port: 9000).Execute(
         RouteConsts.Job.EndJob.Url, shift);
 }