public StaffClass ValidateStaff(StaffClass model, bool ICreate) { if (ICreate == true) { if (String.IsNullOrEmpty(model.PID)) { model.PID = UniqueIDCreator.CreateID(); } if (String.IsNullOrEmpty(model.Mail)) { model.Mail = "n/a"; } if (String.IsNullOrEmpty(model.Mobile)) { model.Mobile = "n/a"; } if (String.IsNullOrEmpty(model.Department)) { model.Department = "none"; } if (String.IsNullOrEmpty(model.Designation)) { model.Designation = "none"; } } else { if (String.IsNullOrEmpty(model.PID)) { model.PID = UniqueIDCreator.CreateID(); } if (String.IsNullOrEmpty(model.Mail)) { model.Mail = "n/a"; } if (String.IsNullOrEmpty(model.Mail)) { model.Mail = "n/a"; } if (String.IsNullOrEmpty(model.Mobile)) { model.Mobile = "n/a"; } if (String.IsNullOrEmpty(model.Department)) { model.Department = "none"; } if (String.IsNullOrEmpty(model.Designation)) { model.Designation = "none"; } } return(model); }
public StaffClass FillStaffInfo(StaffList model) { StaffClass obj = new StaffClass(); obj.PersonnelKey = model.PersonnelKey; obj.PID = model.PID; obj.PName = model.PName; obj.Mobile = model.Mobile; obj.Mail = model.Mail; obj.Pic = model.Pic; obj.Designation = model.Designation; obj.Department = model.Department; obj.PicType = model.PicType; obj.Usergr = model.Usergr; obj.Username = model.Username; obj.Password = model.Password; return(obj); }