예제 #1
0
 public PersonnelListModel(dbModel.Personnel model)
 {
     Id       = model.Id;
     Name     = model.Name;
     Address  = model.Address;
     Email    = model.Email;
     Position = model.Position;
     IsActive = model.IsActive;
     Role     = model.Role;
 }
예제 #2
0
 public dbModel.Personnel ToPersonnelDBModel()
 {
     dbModel.Personnel model = new dbModel.Personnel()
     {
         Name     = PersonnelName,
         Address  = PersonnelAddress,
         Email    = PersonnelEmail,
         Password = PersonnelPassword,
         Position = PersonnelPostion,
         Role     = "Admin"
     };
     return(model);
 }
예제 #3
0
 public dbModel.Personnel ToDBModel()
 {
     dbModel.Personnel model = new dbModel.Personnel()
     {
         Id         = Id,
         Name       = Name,
         Address    = Address,
         Email      = Email,
         Password   = Password,
         Position   = Position,
         IsActive   = IsActive,
         Role       = Role == "Admin" ? "Admin" : "Personnel",
         BusinessId = BusinessId
     };
     return(model);
 }
예제 #4
0
 public dbModel.Personnel ToUpdateDBModel(dbModel.Personnel personnel)
 {
     dbModel.Personnel model = new dbModel.Personnel()
     {
         Id         = personnel.Id,
         Name       = Name == null ? personnel.Name : Name,
         Address    = Address == null ? personnel.Address : Address,
         Email      = personnel.Email,
         Password   = Password == null ? personnel.Password : Password,
         Position   = Position == null ? personnel.Position : Position,
         IsActive   = IsActive == false ? personnel.IsActive : IsActive,
         Role       = personnel.Role,
         BusinessId = personnel.BusinessId
     };
     return(model);
 }