Example #1
0
 public bool Add(clsEmployee obj, string code)
 {
     if (Exist(code))
     {
         return(false);
     }
     else
     {
         myList.Add(code, obj);
         return(true);
     }
 }
Example #2
0
 public bool Update(clsEmployee obj, string code)
 {
     if (!Exist(code))
     {
         return(false);
     }
     else
     {
         if (Delete(code))
         {
             myList.Add(code, obj);
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Example #3
0
        public static clsListEmployees GetEmployees()
        {
            clsListEmployees tmp = new clsListEmployees();

            IRemaxData rmx = new clsRemaxData();
            DataTable  tab = null;

            tab = rmx.getEmployees();

            foreach (DataRow row in tab.Rows)
            {
                clsEmployee emp = new clsEmployee(Convert.ToInt32(row["id"].ToString()), row["code"].ToString(), row["fullname"].ToString(),
                                                  (enumGender)Enum.Parse(typeof(enumGender), row["gender"].ToString()),
                                                  (enumCityzone)Enum.Parse(typeof(enumCityzone), row["cityzone"].ToString()),
                                                  row["username"].ToString(), row["password"].ToString(),
                                                  (enumEmployeeType)Enum.Parse(typeof(enumEmployeeType), row["type"].ToString()),
                                                  (enumLang)Enum.Parse(typeof(enumLang), row["lang"].ToString()), row["pic"].ToString());
                tmp.Add(emp, emp.Code);
                emp = null;
            }
            tab = null;
            return(tmp);
        }