public void CreateGridData(DepartmentModel model)
 {
     if (model != null)
     {
         var dep = Mapper.Map<Department>(model);
         this.departmentsRepo.SaveOrUpdate(dep);
     }
 }
 public void DeleteGridData(DepartmentModel model)
 {
     if (model != null)
     {
         var dep = this.departmentsRepo.FindOne(new ByIdSpecify<Department>(model.Id));
         this.departmentsRepo.Delete(dep);
     }
 }
        public void UpdateGridData(DepartmentModel model)
        {
            if (model != null)
            {
                var dep = this.departmentsRepo.FindOne(new ByIdSpecify<Department>(model.Id));
                Mapper.Map(model, dep);

                this.departmentsRepo.SaveOrUpdate(dep);
            }
        }