示例#1
0
        public NDbResult ActiveChanged()
        {
            NDbResult result = new NDbResult();

            result.Success();
            TANofifyService.Instance.RaiseActiveTSBChanged();
            return(result);
        }
示例#2
0
        public NDbResult ShiftChanged()
        {
            NDbResult result = new NDbResult();

            result.Success();
            TANofifyService.Instance.RaiseChangeShift();
            return(result);
        }
        public NDbResult ChangeShift([FromBody] TSBShift value)
        {
            NDbResult result;

            if (null == value)
            {
                result = new NDbResult <Shift>();
                result.ParameterIsNull();
            }
            else
            {
                result = TSBShift.ChangeShift(value);
                if (!result.errors.hasError)
                {
                    var plaza = ConfigManager.Instance.Plaza;
                    if (null != plaza)
                    {
                        var taApp  = plaza.TAApp;
                        var todApp = plaza.TODApp;
                        if (null != taApp && null != taApp.Http)
                        {
                            var http = taApp.Http;
                            NRestClient.WebProtocol protocol = (http.Protocol == "http") ?
                                                               NRestClient.WebProtocol.http : NRestClient.WebProtocol.https;
                            string hostName = http.HostName;
                            int    portNo   = http.PortNumber;
                            var    client   = new NRestClient(protocol, hostName, portNo);
                            if (null != client)
                            {
                                client.Execute2 <NRestResult>(RouteConsts.Notify.ShiftChanged.Url, new { });
                            }
                        }
                        if (null != todApp && null != todApp.Http)
                        {
                            var http = todApp.Http;
                            NRestClient.WebProtocol protocol = (http.Protocol == "http") ?
                                                               NRestClient.WebProtocol.http : NRestClient.WebProtocol.https;
                            string hostName = http.HostName;
                            int    portNo   = http.PortNumber;
                            var    client   = new NRestClient(protocol, hostName, portNo);
                            if (null != client)
                            {
                                client.Execute2 <NRestResult>(RouteConsts.Notify.ShiftChanged.Url, new { });
                            }
                        }
                    }
                }
            }
            return(result);
        }
示例#4
0
        public NDbResult <Lane> GetPlazaLane([FromBody] Search.Plaza.LaneByNo value)
        {
            NDbResult <Lane> result;

            if (null == value)
            {
                result = new NDbResult <Lane>();
                result.ParameterIsNull();
            }
            else
            {
                result = Lane.GetPlazaLane(value.PlazaId, value.LaneNo);
            }
            return(result);
        }
示例#5
0
        public NDbResult <List <Lane> > GetPlazaGroupLanes([FromBody] PlazaGroup value)
        {
            NDbResult <List <Lane> > result;

            if (null == value)
            {
                result = new NDbResult <List <Lane> >();
                result.ParameterIsNull();
            }
            else
            {
                result = Lane.GetPlazaGroupLanes(value);
            }
            return(result);
        }
        public NDbResult <TSBShift> Create([FromBody] TSBShiftCreate value)
        {
            NDbResult <TSBShift> result;

            if (null == value)
            {
                result = new NDbResult <TSBShift>();
                result.ParameterIsNull();
            }
            else
            {
                result = TSBShift.Create(value.Shift, value.User);
            }
            return(result);
        }
示例#7
0
        public NDbResult <LaneAttendance> GetCurrentAttendancesByLane([FromBody] Search.Lanes.Current.AttendanceByLane value)
        {
            NDbResult <LaneAttendance> result;

            if (null == value)
            {
                result = new NDbResult <LaneAttendance>();
                result.ParameterIsNull();
            }
            else
            {
                result = LaneAttendance.GetCurrentByLane(value.Lane);
            }
            return(result);
        }
示例#8
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);
        }
示例#9
0
        public NDbResult <User> GetById([FromBody] Search.Users.ById value)
        {
            NDbResult <User> result;

            if (null == value)
            {
                result = new NDbResult <User>();
                result.ParameterIsNull();
            }
            else
            {
                result = Models.User.GetUser(value.UserId);
            }
            return(result);
        }
示例#10
0
        public NDbResult <TSBCouponBalance> GetTSBBalance([FromBody] TSB value)
        {
            NDbResult <TSBCouponBalance> result;

            if (null == value)
            {
                result = new NDbResult <TSBCouponBalance>();
                result.ParameterIsNull();
            }
            else
            {
                result = TSBCouponBalance.GetTSBBalance(value);
            }
            return(result);
        }
示例#11
0
        public NDbResult <List <LaneAttendance> > GetAllNotHasRevenueEntryByUser([FromBody] User value)
        {
            NDbResult <List <LaneAttendance> > result;

            if (null == value)
            {
                result = new NDbResult <List <LaneAttendance> >();
                result.ParameterIsNull();
            }
            else
            {
                result = LaneAttendance.GetAllNotHasRevenueEntryByUser(value);
            }
            return(result);
        }
        public NDbResult <UserShiftRevenue> GetRevenueShift([FromBody] Search.Revenues.PlazaShift value)
        {
            NDbResult <UserShiftRevenue> result;

            if (null == value)
            {
                result = new NDbResult <UserShiftRevenue>();
                result.ParameterIsNull();
            }
            else
            {
                result = UserShiftRevenue.GetPlazaRevenue(value.Shift, value.PlazaGroup);
            }
            return(result);
        }
示例#13
0
        public NDbResult SaveTransactions([FromBody] List <TSBCouponTransaction> values)
        {
            NDbResult result;

            if (null == values)
            {
                result = new NDbResult();
                result.ParameterIsNull();
            }
            else
            {
                result = TSBCouponTransaction.SaveTransactions(values);
            }
            return(result);
        }
示例#14
0
        public NDbResult <List <LaneAttendance> > GetAttendancesByDate([FromBody] Search.Lanes.Attendances.ByDate value)
        {
            NDbResult <List <LaneAttendance> > result;

            if (null == value)
            {
                result = new NDbResult <List <LaneAttendance> >();
                result.ParameterIsNull();
            }
            else
            {
                result = LaneAttendance.Search(value.Date);
            }
            return(result);
        }
示例#15
0
        public NDbResult SaveAttendances([FromBody] List <LaneAttendance> values)
        {
            NDbResult result;

            if (null == values)
            {
                result = new NDbResult();
                result.ParameterIsNull();
            }
            else
            {
                result = LaneAttendance.SaveLaneAttendances(values);
            }
            return(result);
        }
示例#16
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);
        }
示例#17
0
        public NDbResult <Lane> SaveLane([FromBody] Lane value)
        {
            NDbResult <Lane> result;

            if (null == value)
            {
                result = new NDbResult <Lane>();
                result.ParameterIsNull();
            }
            else
            {
                result = Lane.Save(value);
            }
            return(result);
        }
示例#18
0
        public NDbResult <List <User> > SearchById([FromBody] Search.Users.ById value)
        {
            NDbResult <List <User> > result;

            if (null == value)
            {
                result = new NDbResult <List <User> >();
                result.ParameterIsNull();
            }
            else
            {
                result = Models.User.SearchById(value.UserId, value.Roles);
            }
            return(result);
        }
示例#19
0
        public NDbResult <TSB> SaveTSB([FromBody] TSB value)
        {
            NDbResult <TSB> result;

            if (null == value)
            {
                result = new NDbResult <TSB>();
                result.ParameterIsNull();
            }
            else
            {
                result = TSB.Save(value);
            }
            return(result);
        }
示例#20
0
        public NDbResult <Role> GetRole([FromBody] Search.Roles.ById value)
        {
            NDbResult <Role> result;

            if (null == value)
            {
                result = new NDbResult <Role>();
                result.ParameterIsNull();
            }
            else
            {
                result = Role.GetRole(value.RoleId);
            }
            return(result);
        }
示例#21
0
        public NDbResult <List <TSBCouponSummary> > GetTSBCouponSummaries([FromBody] TSB value)
        {
            NDbResult <List <TSBCouponSummary> > result;

            if (null == value)
            {
                result = new NDbResult <List <TSBCouponSummary> >();
                result.ParameterIsNull();
            }
            else
            {
                result = TSBCouponSummary.GetTSBCouponSummaries(value);
            }
            return(result);
        }
示例#22
0
        public NDbResult <LaneAttendance> Create([FromBody] LaneAttendanceCreate value)
        {
            NDbResult <LaneAttendance> result;

            if (null == value)
            {
                result = new NDbResult <LaneAttendance>();
                result.ParameterIsNull();
            }
            else
            {
                result = LaneAttendance.Create(value.Lane, value.User);
            }
            return(result);
        }
示例#23
0
        public NDbResult <User> SaveUser([FromBody] User value)
        {
            NDbResult <User> result;

            if (null == value)
            {
                result = new NDbResult <User>();
                result.ParameterIsNull();
            }
            else
            {
                result = Models.User.SaveUser(value);
            }
            return(result);
        }
示例#24
0
        public NDbResult <List <TSBCouponTransaction> > GetTSBCouponTransactions([FromBody] TSB value)
        {
            NDbResult <List <TSBCouponTransaction> > result;

            if (null == value)
            {
                result = new NDbResult <List <TSBCouponTransaction> >();
                result.ParameterIsNull();
            }
            else
            {
                result = TSBCouponTransaction.GetTSBCouponTransactions(value);
            }
            return(result);
        }
示例#25
0
        public NDbResult <Role> SaveRole([FromBody] Role value)
        {
            NDbResult <Role> result;

            if (null == value)
            {
                result = new NDbResult <Role>();
                result.ParameterIsNull();
            }
            else
            {
                result = Role.Save(value);
            }
            return(result);
        }
示例#26
0
        public NDbResult <Plaza> SavePlaza([FromBody] Plaza value)
        {
            NDbResult <Plaza> result;

            if (null != value)
            {
                result = new NDbResult <Plaza>();
                result.ParameterIsNull();
            }
            else
            {
                result = Plaza.Save(value);
            }
            return(result);
        }
示例#27
0
        public NDbResult <Shift> SaveShift([FromBody] Shift value)
        {
            NDbResult <Shift> result;

            if (null == value)
            {
                result = new NDbResult <Shift>();
                result.ParameterIsNull();
            }
            else
            {
                result = Shift.Save(value);
            }
            return(result);
        }
示例#28
0
        public NDbResult <List <PlazaGroup> > GetTSBPlazaGroups([FromBody] TSB value)
        {
            NDbResult <List <PlazaGroup> > result;

            if (null == value)
            {
                result = new NDbResult <List <PlazaGroup> >();
                result.ParameterIsNull();
            }
            else
            {
                result = PlazaGroup.GetTSBPlazaGroups(value);
            }
            return(result);
        }
示例#29
0
        public NDbResult <PlazaGroup> SavePlazaGroup([FromBody] PlazaGroup value)
        {
            NDbResult <PlazaGroup> result;

            if (null == value)
            {
                result = new NDbResult <PlazaGroup>();
                result.ParameterIsNull();
            }
            else
            {
                result = PlazaGroup.Save(value);
            }
            return(result);
        }
示例#30
0
        public NDbResult <List <LaneAttendance> > GetAllAttendancesByUserShift([FromBody] UserShift value)
        {
            NDbResult <List <LaneAttendance> > result;

            if (null == value)
            {
                result = new NDbResult <List <LaneAttendance> >();
                result.ParameterIsNull();
            }
            else
            {
                result = LaneAttendance.Search(value);
            }
            return(result);
        }