Exemple #1
0
 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);
 }
Exemple #2
0
        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();
 }
Exemple #4
0
 public OrganisationEntities Init()
 {
     return(dbContext ?? (dbContext = new OrganisationEntities()));
 }