예제 #1
0
        public ActionResult AddressCreate(AUDITORADDRESS auditoraddress)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    auditoraddress.Id = Guid.NewGuid();
                    auditoraddress.Maker = User.Identity.GetUserName();
                    auditoraddress.Osysdate = System.DateTime.Now;

                    auditoraddress.State = MyEnums.StatusOptions.Added;
                    _repository.SaveNew(auditoraddress);
                    getVals.LogAudit(User.Identity.GetUserName(), "Created", Request.UserHostName, "Created Address :" + auditoraddress.Address1, "Created", "AuditLetters");
                }

                return RedirectToAction("AddressIndex", new { id = auditoraddress.AuditorId });
            }
            catch (Exception ex)
            {
                return View();
            }
        }
예제 #2
0
        public ActionResult AddressEdit(AUDITORADDRESS auditoraddress)
        {
            try
            {
                AUDITORADDRESS newAuditoraddress = _repository.Find<AUDITORADDRESS>(auditoraddress.Id);
                if (ModelState.IsValid)
                {
                    newAuditoraddress.Address1 = auditoraddress.Address1;
                    newAuditoraddress.Address2 = auditoraddress.Address2;
                    newAuditoraddress.Address3 = auditoraddress.Address3;
                    newAuditoraddress.Address4 = auditoraddress.Address4;
                    newAuditoraddress.Email = auditoraddress.Email;
                    newAuditoraddress.Maker = User.Identity.GetUserName();

                    newAuditoraddress.State = MyEnums.StatusOptions.Added;
                    _repository.SaveUpdate(newAuditoraddress);
                    getVals.LogAudit(User.Identity.GetUserName(), "Edited", Request.UserHostName, "Edited Address :" + auditoraddress.Address1, "Edit", "AuditLetters");
                }

                return RedirectToAction("AddressIndex", new { id = newAuditoraddress.AuditorId });
            }
            catch
            {
                return View();
            }
        }