Esempio n. 1
0
 public List <LanePayment> GetPaymentsByLane([FromBody] Search.Lanes.Payments.ByLane value)
 {
     if (null == value)
     {
         return(new List <LanePayment>());
     }
     return(LanePayment.Search(value.Lane));
 }
Esempio n. 2
0
 public LanePayment GetCurrentPaymentsByLane([FromBody] Search.Lanes.Current.PaymentByLane value)
 {
     if (null == value)
     {
         return(null);
     }
     return(LanePayment.GetCurrentByLane(value.Lane));
 }
Esempio n. 3
0
 public List <LanePayment> GetPaymentsByUserShifts([FromBody] Search.Lanes.Payments.ByUserShift value)
 {
     if (null == value)
     {
         return(new List <LanePayment>());
     }
     return(LanePayment.Search(value.Shift));
 }
Esempio n. 4
0
 public LanePayment Create([FromBody] LanePaymentCreate value)
 {
     if (null == value)
     {
         return(null);
     }
     return(LanePayment.Create(value.Lane, value.User,
                               value.Payment, value.Date, value.Amount));
 }
Esempio n. 5
0
        public void SavePayment([FromBody] LanePayment value)
        {
            if (null == value)
            {
                return;
            }
            Random rand = new Random();

            if (string.IsNullOrWhiteSpace(value.ApproveCode))
            {
                value.ApproveCode = rand.Next(10000000).ToString("D8"); // auto generate.
            }
            LanePayment.Save(value);
        }
Esempio n. 6
0
        public NDbResult <LanePayment> GetCurrentPaymentsByLane([FromBody] Search.Lanes.Current.PaymentByLane value)
        {
            NDbResult <LanePayment> result;

            if (null == value)
            {
                result = new NDbResult <LanePayment>();
                result.ParameterIsNull();
            }
            else
            {
                result = LanePayment.GetCurrentByLane(value.Lane);
            }
            return(result);
        }
Esempio n. 7
0
        public NDbResult <List <LanePayment> > GetPaymentsByLane([FromBody] Search.Lanes.Payments.ByLane value)
        {
            NDbResult <List <LanePayment> > result;

            if (null == value)
            {
                result = new NDbResult <List <LanePayment> >();
                result.ParameterIsNull();
            }
            else
            {
                result = LanePayment.Search(value.Lane);
            }
            return(result);
        }
Esempio n. 8
0
        public NDbResult <LanePayment> Create([FromBody] LanePaymentCreate value)
        {
            NDbResult <LanePayment> result;

            if (null == value)
            {
                result = new NDbResult <LanePayment>();
                result.ParameterIsNull();
            }
            else
            {
                result = LanePayment.Create(value.Lane, value.User,
                                            value.Payment, value.Date, value.Amount);
            }
            return(result);
        }
Esempio n. 9
0
        public NDbResult <LanePayment> SavePayment([FromBody] LanePayment value)
        {
            NDbResult <LanePayment> result;

            if (null == value)
            {
                result = new NDbResult <LanePayment>();
                result.ParameterIsNull();
            }
            else
            {
                if (string.IsNullOrWhiteSpace(value.ApproveCode))
                {
                    Random rand = new Random();
                    value.ApproveCode = rand.Next(10000000).ToString("D8"); // auto generate.
                }
                result = LanePayment.Save(value);
            }
            return(result);
        }
            public NRestResult <LanePayment> SavePayment(LanePayment 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.SavePayment.Url, value);
                }
                else
                {
                    ret = new NRestResult <LanePayment>();
                    ret.ParameterIsNull();
                }
                return(ret);
            }
Esempio n. 11
0
 public void SavePayment(LanePayment value)
 {
     NRestClient.Create(port: 9000).Execute(
         RouteConsts.Lane.SavePayment.Url, value);
 }