Esempio n. 1
0
        public ActionResult AddApplication()
        {
            myCoalUser user = myCoalUser.GetInstance();

            ApplicationVM model = new ApplicationVM(user.RegistrationId);

            return PartialView(model);
        }
Esempio n. 2
0
        public ActionResult AddApplication(ApplicationVM model)
        {
            if (!ModelState.IsValid)
                return PartialView(model);

            try
            {
                myCoalUser user = myCoalUser.GetInstance();
                PermitDO newApplication = PermitBLL.CreateApplication(model.SelectedPermitKey, model.GetApplicationTypeEnumValue(), model.ApplicationDescription, model.ApplicationNumber, user.RegistrationId, DirectoryMapping.AttachmentContentFolder);
                AjaxResult result = new AjaxResult(AjaxResult.AjaxStatus.OK, "A new Application has been created");
                result.Data.Add("PermitKey", newApplication.PermitKey);
                return Json(result);
            }
            catch (Exception ex)
            {
                AjaxResult result = new AjaxResult(AjaxResult.AjaxStatus.ERROR, ex.Message);
                return Json(result);
            }
        }