Beispiel #1
0
 public static bool Exist(string id)
 {
     try
     {
         using (taxisEntities db = new taxisEntities())
         {
             EmployeeTable es = db.EmployeeTables.Where(e => e.EmployeeCode == id).FirstOrDefault();
             return(es != null);
         }
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Beispiel #2
0
 public static bool AddNew(EmployeeTable emp)
 {
     try
     {
         using (taxisEntities db = new taxisEntities())
         {
             db.EmployeeTables.Add(emp);
             db.SaveChanges();
             return(true);
         }
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Beispiel #3
0
        public static EmployeeTable Login(string id, string ps)
        {
            try
            {
                using (taxisEntities db = new taxisEntities())
                {
                    EmployeeTable es = db.EmployeeTables.Where(e => e.EmployeeCode == id && e.EmployeePassword == ps).FirstOrDefault();

                    if (es != null)
                    {
                        return(es);
                    }
                    return(null);
                }
            }
            catch (Exception e)
            {
                return(null);
            }
        }