Example #1
0
 public Status GetAllStaff()
 {
     this._logger.LogWarning("The Server execute GetAllStaff Function  --" + DateTime.Now.ToString());
     using (SchoolCookHouseContext dbcontext = new SchoolCookHouseContext())
     {
         var result = dbcontext.TStaff.ToList();
         if (result.Count > 0)
         {
             StaffStatus staffStatus = new StaffStatus
             {
                 StatusCode = 200,
                 Message    = "获取成功",
                 ReturnTime = DateTime.Now,
                 Staff      = result
             };
             return(staffStatus);
         }
         else
         {
             Status status = new Status
             {
                 StatusCode = 0,
                 Message    = "获取失败",
                 ReturnTime = DateTime.Now,
             };
             return(status);
         }
     }
 }
Example #2
0
 public Status GetConditionStaff(int id)
 {
     this._logger.LogWarning("The server execute GetConditionStaff Fuction  --" + DateTime.Now.ToString());
     using (SchoolCookHouseContext dbcontext = new SchoolCookHouseContext())
     {
         var result = dbcontext.TStaff.Where(a => a.Id == id).ToList();
         if (result.Count > 0)
         {
             StaffStatus staffStatus = new StaffStatus
             {
                 StatusCode = 200,
                 Message    = "查询成功",
                 ReturnTime = DateTime.Now,
                 Staff      = result
             };
             return(staffStatus);
         }
         else
         {
             Status status = new Status
             {
                 StatusCode = 0,
                 Message    = "查询失败",
                 ReturnTime = DateTime.Now,
             };
             return(status);
         }
     }
 }
Example #3
0
 public Staff(string iD, string firstName, string middleName, string lastName, string contactNo, string email, string streetNo, string streetName, string barangay, string username, string password, StaffMode mode, StaffStatus status)
 {
     this.iD         = iD;
     this.firstName  = firstName;
     this.lastName   = lastName;
     this.middleName = middleName;
     this.contactNo  = contactNo;
     this.email      = email;
     this.streetNo   = streetNo;
     this.streetName = streetName;
     this.barangay   = barangay;
     this.username   = username;
     this.password   = password;
     this.mode       = mode;
     this.status     = status;
 }
Example #4
0
 public Staff(Person inPersonData, StaffStatus inStatus)
 {
     this.personData = inPersonData;
     this.status = inStatus;
 }
Example #5
0
 public Staff()
 {
     this.personData = new Person();
     this.status = StaffStatus.NotSetted;
 }