예제 #1
0
        internal Models.DutyModal.GetDutyResp GetDuty(Models.DutyModal.GetDutyReq req)
        {
            Models.DutyModal.GetDutyResp rsp = new Models.DutyModal.GetDutyResp();
            rsp.apiErrors = new APIErrors();
            rsp.apiErrors = ApiError_defs.err_Invalid_Request;
            List <ITAttendentDuty> iDuty = _storage.GetDuty(req.nEntityId, req.day, req.month, req.year);

            if (iDuty != null && iDuty.Count > 0)
            {
                List <Models.DutyModal.dutyInfo> dutyInfo = new List <Models.DutyModal.dutyInfo>();
                Models.DutyModal.dutyInfo        DI;
                foreach (ITAttendentDuty duty in iDuty)
                {
                    DI             = new Models.DutyModal.dutyInfo();
                    DI.nDutyId     = duty.n;
                    DI.dStampStart = duty.dStampStart;
                    DI.dStampStop  = duty.dStampStop;
                    DI.sRegNo      = _storage.GetBusById(duty.nBusFK).sRegNo;
                    dutyInfo.Add(DI);
                }
                rsp.apiErrors = ApiError_defs.ok;
                rsp.duties    = dutyInfo;
            }
            else
            {
                rsp.apiErrors.sErrorMessage = "Unable to add user";
            }

            return(rsp);
        }
예제 #2
0
 public object GetDuty([FromBody] Models.DutyModal.GetDutyReq req)
 {
     BLLfiles.Bll_Duty            bllRoute = new BLLfiles.Bll_Duty();
     Models.DutyModal.GetDutyResp resp     = bllRoute.GetDuty(req);
     return(resp);
 }