public void CopyFrom(EndorseStamp eStamp) { if (eStamp != null) { this.Id = eStamp.Id; this.Code = eStamp.Code; this.StampDate = eStamp.StampDate; this.StampExpiredDate = eStamp.StampExpiredDate; this.Invoice = eStamp.Invoice; this.SMTime = eStamp.SMTime; this.UpdateInfo = eStamp.UpdateInfo; this.IsCancel = eStamp.IsCancel; } }
public ActionResult _DeleteEndorseStamp(int endorseId, int id) { EndorseStamp endorseStamp = endorseStampRepo.GetOne(endorseId, id); if (endorseStamp != null) { try { //Delete the record endorseStampRepo.DoDelete(endorseStamp); new RecordDeletedEvent("EndorseStamp", endorseStamp.Id, endorseId, endorseStamp.Code, null, null).Raise(); } catch { return(RedirectToAction("_EditEndorseStamp", new { endorseId, id })); } } return(Content(Globals.ModalDetailUpdateOK)); }
public ActionResult _SaveEndorseStamp(bool isCreate, int endorseId, int id = 0) { EndorseStamp endorseStamp; if (!isCreate && id > 0) { endorseStamp = endorseStampRepo.GetOne(endorseId, id); } else { endorseStamp = new EndorseStamp(endorseId); } this.endorseStampRepo.CurrentUserName = HttpContext.User.Identity.Name; try { if (isCreate) { endorseStampRepo.DoNewRecord(endorseStamp); } UpdateModel(endorseStamp); endorseStampRepo.DoSave(endorseStamp, isCreate); return(Content(Globals.ModalDetailUpdateOK)); } catch (RulesException ex) { ex.CopyTo(ModelState); } catch { //do nothing } if (isCreate) { return(_InsertEndorseStamp(endorseId)); } return(_EditEndorseStamp(endorseId, id)); }
public EndorseStampLite(EndorseStamp eStamp) { this.CopyFrom(eStamp); }