public ActionResult GetCompany(Company model) { using (OrganisationEntities db = new OrganisationEntities()) { var company = db.Companies.Where(x => x.CompanyName == model.CompanyName).FirstOrDefault(); if (company != null) { return(RedirectToAction("Login", company)); } } return(null); }
public IHttpActionResult GetDepartment() { IList <Departments> departments = null; using (var ctx = new OrganisationEntities()) { departments = ctx.Departments .Select(s => new Departments() { DeptId = s.Id, DeptName = s.Name, Guid = s.IDGUID }).ToList <Departments>(); } if (departments.Count == 0) { return(NotFound()); } return(Ok(departments)); }
public EmployeeController() { _context = new OrganisationEntities(); }
public OrganisationEntities Init() { return(dbContext ?? (dbContext = new OrganisationEntities())); }