public Department GetDepById(int depId) { try { DLL.Dep obj = new DLL.Dep(); return(obj.GetDepById(depId)); } catch (Exception ex) { return(null); } }
public IEnumerable <Department> GetAllDep() { try { DLL.Dep obj = new DLL.Dep(); return(obj.GetAllDep()); } catch (Exception ex) { return(null); } }
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); } }
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); } }
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); } }
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); } }