Esempio n. 1
0
        public bool DepartmentDelete(Department department)
        {
            return Execute<bool>(dal =>
            {
                Department departmentDelete = dal.Department.Where(x => x.DepartmentID == department.DepartmentID).FirstOrDefault();
                if (departmentDelete != null)
                {
                    dal.Department.DeleteOnSubmit(departmentDelete);
                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
Esempio n. 2
0
        public bool DepartmentUpdate(Department department)
        {
            return Execute<bool>(dal =>
               {
               Department departmentUpdate = dal.Department.Where(x => x.DepartmentID == department.DepartmentID).FirstOrDefault();
               if (departmentUpdate != null)
               {
                   departmentUpdate.DepartmentID = department.DepartmentID;
                   departmentUpdate.Name = department.Name;
                   departmentUpdate.GroupName = department.GroupName;
                   departmentUpdate.ModifiedDate = department.ModifiedDate;

                   dal.SubmitChanges();
                   return true;
               }
               return false;

               });
        }
 partial void DeleteDepartment(Department instance);
 partial void UpdateDepartment(Department instance);
 partial void InsertDepartment(Department instance);
 public void DepartmentUpdate(Department department)
 {
     adventureWorks_BC.DepartmentUpdate(department);
 }
 public void DepartmentAdd(Department department)
 {
     adventureWorks_BC.DepartmentAdd(department);
 }