Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }