public ActionResult SignatureEdit(SIGNATURES signatures) { try { if (ModelState.IsValid) { HttpPostedFileBase file = Request.Files["ImageData"]; SIGNATURES updatemodel = _repository.Find<SIGNATURES>(signatures.Id); updatemodel.Signimage = ConvertToBytes(file); updatemodel.Signname = signatures.Signname; updatemodel.Signtitle = signatures.Signtitle; updatemodel.State = MyEnums.StatusOptions.Added; updatemodel.Maker = User.Identity.GetUserName(); _repository.SaveUpdate(updatemodel); _sharedCls.LogAudit(User.Identity.GetUserName(), "Edited", Request.UserHostName, "Edited Salutation :" + signatures.Signname, "Edit", "AuditLetters"); } return RedirectToAction("SignatureIndex"); } catch (Exception ex) { return View(); } }
public ActionResult SignatureCreate(SIGNATURES signatures) { try { HttpPostedFileBase file = Request.Files["ImageData"]; signatures.Id = Guid.NewGuid(); signatures.Maker = User.Identity.GetUserName(); signatures.Osysdate = System.DateTime.Now; signatures.Signimage = ConvertToBytes(file); signatures.State = MyEnums.StatusOptions.Added; //signatures.DefaultActive =false; _repository.SaveNew(signatures); _sharedCls.LogAudit(User.Identity.GetUserName(), "Created", Request.UserHostName, "Created Salutation :" + signatures.Signname, "Creat", "AuditLetters"); return RedirectToAction("SignatureIndex"); } catch (Exception ex) { return View(); } }