Ejemplo n.º 1
0
 public Department GetDepById(int depId)
 {
     try
     {
         DLL.Dep obj = new DLL.Dep();
         return(obj.GetDepById(depId));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Ejemplo n.º 2
0
 public IEnumerable <Department> GetAllDep()
 {
     try
     {
         DLL.Dep obj = new DLL.Dep();
         return(obj.GetAllDep());
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Ejemplo n.º 3
0
 public bool DepartmentExists(int?depId)
 {
     try
     {
         if (depId != null)
         {
             DLL.Dep obj = new DLL.Dep();
             return(obj.DepartmentExists(depId));
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Ejemplo n.º 4
0
 public bool Insert(Department dep)
 {
     try
     {
         if (dep != null)
         {
             DLL.Dep department = new DLL.Dep();
             return(department.Insert(dep));
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Ejemplo n.º 5
0
 public bool Delete(int?depId)
 {
     try
     {
         if (depId != null)
         {
             DLL.Dep department = new DLL.Dep();
             return(department.Delete(depId));
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Ejemplo n.º 6
0
        public bool Update(int id, Department dep)
        {
            try
            {
                if (id != dep.Did)
                {
                    return(false);
                }

                if (dep.Did.ToString() != String.Empty && dep.Dname != String.Empty)
                {
                    DLL.Dep department = new DLL.Dep();
                    return(department.Update(id, dep));
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }