Exemple #1
0
        public ActionResult Create(Organization organization)
        {
            var          dateCreated = DateTime.Now;
            const string createdBy   = "jhendrikse";
            const bool   isActive    = true;
            const bool   isDeleted   = false;

            if (ModelState.IsValid)
            {
                var organizationModel = new OrganizationModel();

                // TODO: fix created-by field
                var createOrganization = organizationModel.CreateOrganization(organization.Description, organization.Telephone_Number, organization.Fax_Number, organization.Email_Address, isActive, isDeleted, dateCreated, createdBy);

                if (createOrganization == null)
                {
                    ViewBag.Message = "An Error Occurred, Please contact support";
                    return(View(organization));
                }

                return(RedirectToAction("Index", "Organization"));
            }

            return(View(organization));
        }