public void DepartmentRepoSetup() { _dbController = new TestDbController(); _instance = DepartmentRepo.GetInstance(_dbController, practitioners); _departmentOne = new Department("TestDepartmentOne", "TestAddressOne"); _departmentTwo = new Department("TestDepartmentTwo", "TestAddressTwo"); }
static void Main(string[] args) { var repo = new DepartmentRepo(); var ITDepartment = repo.GetDepartmentById(1); Console.WriteLine(ITDepartment.ID + " " + ITDepartment.Name + " " + ITDepartment.Instructor); var nd = repo.GetDepartmentByName("HR"); Console.WriteLine("===================="); Console.WriteLine(nd.Name); var all = repo.GetAllDepartments(); Console.WriteLine("===================="); Console.WriteLine("All Departments"); foreach (var item in all) { Console.WriteLine(item.Name); } var highest = repo.GetHighestDepartment(); Console.WriteLine("====================="); Console.WriteLine("The highest budget department is: " + highest.Name); Console.ReadLine(); }
public List <DepartmentLookupBySupId> GetDepartmentsBySupId(int id) { DepartmentRepo repo = new DepartmentRepo(); List <DepartmentLookupBySupId> dep = repo.GetDepartmentsBySupId(id); return(dep); }
public static void LoadDepartments(ref ComboBox dropDown, bool includeAll = false) { var repo = new DepartmentRepo(); var allItems = repo.GetAllDepartments(); if (includeAll) { allItems.Insert(0, new Department { DepartmentName = "All Departments", Id = Base.IdForSelectAll }); } else { allItems.Insert(0, new Department { DepartmentName = "Select Department", Id = Base.IdForSelect }); } dropDown.DataSource = allItems; dropDown.DisplayMember = "DepartmentName"; dropDown.ValueMember = "Id"; dropDown.SelectedIndex = 0; }
public List <Department> GetAllDepartmentsAllInfo() { DepartmentRepo repo = new DepartmentRepo(); List <Department> departments = repo.GetDepartmentsAllInfo(); return(departments); }
public List <JobLookup> GetAllJobsByDepartmentId(int departmentId) { DepartmentRepo repo = new DepartmentRepo(); List <JobLookup> jobs = repo.GetJobsByDepartmentId(departmentId); return(jobs); }
public List <DepartmentLookup> GetAllDepartments() { DepartmentRepo repo = new DepartmentRepo(); List <DepartmentLookup> departments = repo.GetDepartments(); return(departments); }
public Department GetDepartmentBySupId(int id) { DepartmentRepo repo = new DepartmentRepo(); _d = repo.GetDepartmentBySupId(id); return(_d); }
public void ShouldUpdateARangeOfDepartmentEntities() { var categories = new List <Department> { new Department { Name = "Foo" }, new Department { Name = "Bar" }, new Department { Name = "FooBar" } }; _repo.AddRange(categories); categories[0].Name = "Foo1"; categories[1].Name = "Foo2"; categories[2].Name = "Foo3"; _repo.UpdateRange(categories, false); var count = _repo.SaveChanges(); Assert.Equal(3, count); var repo = new DepartmentRepo(); var cat = repo.GetFirst(); Assert.Equal("Foo1", cat.Name); }
public void AppointmentRepoSetup() { _dbController = new TestDbController(); _controller = Controller.GetInstance(); _departmentRepo = DepartmentRepo.GetInstance(_dbController, practitioners); departments = _departmentRepo.GetDepartments(); users = _controller.GetUsers(); _instance = AppointmentRepo.GetInstance(_dbController, users, departments); }
private List <SelectListItem> GetDepartmentSelectList() { return((from department in DepartmentRepo.GetAll() select new SelectListItem() { Text = department.DepartmentName, Value = department.DepartmentId.ToString() }).ToList()); }
public DepartmentHeadServiceImpl(RequisitionRepo rrepo, RequisitionDetailRepo rdrepo, EmployeeRepo erepo, DepartmentRepo drepo, IMailer mailservice, CollectionPointRepo crepo) { this.rrepo = rrepo; this.rdrepo = rdrepo; this.erepo = erepo; this.drepo = drepo; this.mailservice = mailservice; this.crepo = crepo; }
public void GetTestA() { InitializeDatabase(new HardcodedDataV2()); IDepartmentRepo _departmentRepo = new DepartmentRepo(); var ret = _departmentRepo.Get(); Assert.Equal(2, ret.Count()); }
public DepartmentsViewModel() { SearchValue = ""; _repository = new DepartmentRepo(); Departments = new DataView(); Departments.Table = _repository.dataSet.Tables[0].DefaultView.Table.Copy(); this.PropertyChanged += DepartmentsViewModel_PropertyChanged; FilteredDepartments = new DataView(); FilteredDepartments.Table = Departments.Table.Copy(); }
public DepartmentList(string apiEndpoint) { InitializeComponent(); ApiEndpoint = apiEndpoint; dRepo = new DepartmentRepo(ApiEndpoint); dhRepo = new DepartmentHeadRepo(ApiEndpoint); tRepo = new TeacherRepo(ApiEndpoint); }
public IHttpActionResult CreateDepartment(DepartmentModel dept) { string error = ""; DepartmentModel dm = DepartmentRepo.CreateDepartment(dept, out error); if (error != "" || dm == null) { return(Content(HttpStatusCode.BadRequest, error)); } return(Ok(dm)); }
public DepartmentEmpServiceImpl(RequisitionRepo rrepo, RequisitionDetailRepo rdrepo, ProductRepo prepo, EmployeeRepo erepo, DepartmentRepo drepo, CollectionPointRepo cprepo, IMailer mailservice) { this.rrepo = rrepo; this.rdrepo = rdrepo; this.prepo = prepo; this.erepo = erepo; this.drepo = drepo; this.cprepo = cprepo; this.mailservice = mailservice; }
public ActionResult DeleteConfirm(int id) { Responses responses = (DepartmentRepo.Delete(id)); if (responses.Success) { return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); } return(Json(new { success = false, message = "Error Msg" }, JsonRequestBehavior.AllowGet)); }
public FrmDept(string deptId = "") { InitializeComponent(); _repo = new DepartmentRepo(); _id = deptId; if (deptId != "") { lblTitle.Text = "Update Department"; GetItem(deptId); } }
public DepartmentForm(Department data = null) { InitializeComponent(); _deptRepo = new DepartmentRepo(); if (data != null) { lblId.Text = data.Id.ToString(); txtDeptName.Text = data.DepartmentName; txtDeptCode.Text = data.DepartmentCode; lblTitle.Text = "Update Department"; } }
public bool UpdateDepartment(Department d) { _d = d; DepartmentRepo repo = new DepartmentRepo(); ValidateForMod(); if (Errors.Count == 0) { return(repo.Update(_d)); } return(false); }
public TeacherCardsList(string apiEndpoint) { InitializeComponent(); ApiEndpoint = apiEndpoint; tcRepo = new TeacherCardRepo(ApiEndpoint); tciRepo = new TeacherCardItemRepo(ApiEndpoint); dRepo = new DepartmentRepo(ApiEndpoint); tRepo = new TeacherRepo(ApiEndpoint); pyrhRepo = new PositionYearRateHoursRepo(ApiEndpoint); }
public IHttpActionResult RejectDepartmentCollectionPoint(DepartmentCollectionPointModel dcpm) { string error = ""; dcpm.Status = ConDepartmentCollectionPoint.Status.REJECTED; dcpm = DepartmentRepo.UpdateDepartmentCollectionPoint(dcpm, out error); if (error != "" || dcpm == null) { return(Content(HttpStatusCode.BadRequest, error)); } return(Ok(dcpm)); }
/// <summary> /// Obtener cantidad de registros de Sancion /// Autor: Jair Guerrero /// Fecha: 2020-08-06 /// </summary> public int Count() { try { IRepository <Department> repo = new DepartmentRepo(context); return(repo.Count()); } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } }
public bool AddDepartment(Department d) { _d = d; DepartmentRepo repo = new DepartmentRepo(); ValidateForCreate(); if (Errors.Count == 0) { return(repo.Insert(_d)); } return(false); }
/// <summary> /// Crear registro de Sancion /// Autor: Jair Guerrero /// Fecha: 2020-08-06 /// </summary> public long Create(DepartmentAM entity) { try { var sancion = mapper.Map <Department>(entity); IRepository <Department> repo = new DepartmentRepo(context); return(repo.Create(sancion)); } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } }
public UnitOfWorkPersonTest() { var dbInMemory = DbInMemory.getDbInMemoryOptions(dbName); var personRepo = new PersonRepo(dbInMemory); var classRepo = new ClassRepo(dbInMemory); var scheduleRepo = new ScheduleRepo(dbInMemory); var semesterRepo = new SemesterRepo(dbInMemory); var departmentRepo = new DepartmentRepo(dbInMemory); db = new TCSContext(dbInMemory); mockBannerService = new Mock <IBannerService>(); unitPerson = new UnitOfWorkPerson(personRepo, scheduleRepo, classRepo, semesterRepo, departmentRepo, mockBannerService.Object); }
/// <summary> /// Obtener Sancion por Id /// Autor: Jair Guerrero /// Fecha: 2020-08-06 /// </summary> public DepartmentAM Get(long id) { try { IRepository <Department> repo = new DepartmentRepo(context); var sancion = repo.Get(id); return(mapper.Map <DepartmentAM>(sancion)); } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } }
/// <summary> /// Obtener cantidad de registros de Sancion según filtro /// Autor: Jair Guerrero /// Fecha: 2020-08-06 /// </summary> public int Count(Expression <Func <DepartmentAM, bool> > predicate) { try { var where = mapper.MapExpression <Expression <Func <Department, bool> > >(predicate); IRepository <Department> repo = new DepartmentRepo(context); return(repo.Count(where)); } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } }
public ActionResult Index() { IEnumerable <EmployeeListViewModel> model = from employee in EmployeeRepo.GetAll() join department in DepartmentRepo.GetAll() on employee.DepartmentId equals department.DepartmentId select new EmployeeListViewModel() { Name = employee.FirstName + " " + employee.LastName, Department = department.DepartmentName, Phone = employee.Phone, EmployeeId = employee.EmployeeId, }; return(View(model)); }