Beispiel #1
0
        public IActionResult InsertCompany(CompanyVM companyVM)
        {
            User    currentAdmin = HttpContext.Session.Get <User>("currentUser");
            Company company      = new Company();

            if (ModelState.IsValid)
            {
                company.CompanyName   = companyVM.CompanyName;
                company.Overview      = companyVM.Overview;
                company.WebSite       = companyVM.WebSite;
                company.Location      = companyVM.Location;
                company.SubCategoryID = companyVM.SubCatID;
                company.Adress        = "defauladresdefauladresdefauladres";
                if (company != null)
                {
                    try
                    {
                        companyBLL.Add(company);
                        this._logger.LogInformation($"AdminID : {currentAdmin.ID} is created  CompanyID : {company.ID}.");
                    }
                    catch (Exception)
                    {
                        throw;
                    }
                }
            }
            return(View("Index"));
        }