Exemplo n.º 1
0
        public IActionResult Register(Company newCompany)
        {
            IActionResult    response         = Unauthorized();
            CompanyViewModel registerdCompany = company.GetCompanyList().SingleOrDefault(x => x.Emailaddress == newCompany.Emailaddress);

            if (registerdCompany == null)
            {
                newCompany.UserType = "Manager";
                company.InsertCompany(newCompany);
                return(Ok("{}"));
            }
            return(response);
        }
Exemplo n.º 2
0
        public async Task <JsonResult> GetCompanyList()
        {
            DataTableResultModel <CompanyModel> resultModel = await _company.GetCompanyList();

            return(await Task.Run(() =>
            {
                return Json(new { draw = 1, data = resultModel.ResultList });
            }));
        }
Exemplo n.º 3
0
 public IEnumerable <CompanyViewModel> Get()
 {
     return(company.GetCompanyList());
 }
Exemplo n.º 4
0
 public static IList <CompanyInfo> GetCompanyList(int startRowIndexId, int maxNumberRows, string keyword)
 {
     return(dal.GetCompanyList(startRowIndexId, maxNumberRows, DataSecurity.FilterBadChar(keyword)));
 }
Exemplo n.º 5
0
        CompanyViewModel AuthenticateUser(Company loginCredentials)
        {
            CompanyViewModel singleCompany = company.GetCompanyList().SingleOrDefault(x => x.Name == loginCredentials.Name && x.Password == loginCredentials.Password);

            return(singleCompany);
        }