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; }
public dbModel.Personnel ToPersonnelDBModel() { dbModel.Personnel model = new dbModel.Personnel() { Name = PersonnelName, Address = PersonnelAddress, Email = PersonnelEmail, Password = PersonnelPassword, Position = PersonnelPostion, Role = "Admin" }; return(model); }
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); }
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); }