public BaseWebModule(string modulePath) : base(modulePath) { this.Log = LogManager.GetLogger(this.GetType().Name); //Updated by Action_Chen 20150805 //EventHandling & Logger框架程式 this.baseLogger = new _BaseLogger(); }
public int AddCampaign(Model.EF.Campaign campaign, AccountUser user) { //Updated by Action_Chen 20150805 //EventHandling & Logger框架程式範例 var baseLogger = new _BaseLogger(); //Updated by Action_Chen 20150805 //EventHandling & Logger框架程式範例 try { using (var scope = new DbContextScope(DbContextScopePurpose.Writing)) { campaign.DateCreated = DateTime.Now; campaign.DateModified = campaign.DateCreated; this.RepoCampaign.Insert(campaign); scope.SaveChanges(); } } //Updated by Action_Chen 20150805 //EventHandling & Logger框架程式範例 //catch (DbUpdateException ex) catch (Exception ex) { //throw new MigoDbUpdateException(); throw new MigoCommitFailedException(user); } return campaign.CampaignID; }
//Updated by Eric 20150728 //EventHandling & Logger測試方法 private Negotiator ErrorTestAction(dynamic parameter) { var baseLogger = new _BaseLogger(); try { throw new MigoDbUpdateException(this.GetCurrentUser()); } catch (MigoDbUpdateException ex) { baseLogger.Error(ex); } return Negotiate.WithOnlyJson(new RspFrame(CustomStatusCode.不正確的參數)); }