// ******************************************************************** /// <summary> /// Show Error in a messagebox with a specific message in addition to exception text /// </summary> /// <param name="msg">This is the user text message</param> /// <param name="e">This is the exception to display</param> public static void Show(string msg, Exception e) { try { if (ErrorMode == ErrorModeType.DisplayFullMessage) { MessageBox.Show(msg + " - " + e.ToString(), "Error occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (e is NeoException) { NeoException te = e as NeoException; MessageBox.Show(te.LastError, "Error occured.", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show(msg + ": " + e.Message, "Error occurred", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch { MessageBox.Show("Internal error: unable to display Exception error", "Internal error occured", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
// ******************************************************************** /// <summary> /// Show Error in a messagebox - shows exception text /// </summary> /// <param name="e">Exception handler</param> public static void Show(Exception e) { try { if (e == null) { MessageBox.Show("Possible internal problem! NeoSystems.WinFormsUtils.General.Error.Show called with null parameter!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (ErrorMode == ErrorModeType.DisplayFullMessage) { MessageBox.Show(e.ToString(), "Error occurred.", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (e is NeoException) { NeoException te = e as NeoException; MessageBox.Show(te.LastError, "Error occured.", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("An exception occured: " + e.Message, "Error occured.", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch { MessageBox.Show("Internal error: unable to display Exception error", "Internal error occured", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ActionResult Cleanup() { try { UserDataRepository repository = new UserDataRepository(); repository.Cleanup(); } catch (Exception exc) { NeoException.Handle(exc); } return(View("Index")); }
public ActionResult FindVoucherByCode() { List <BetData> bets = new List <BetData>(); try { IBetDataRepository repository = new BetDataRepository(); bets = repository.SelectVouchersByCode(Request["tbVoucherCode"]); } catch (Exception exc) { NeoException.Handle(exc); } return(PartialView("_VoucherByCodePartial", bets)); }
public EventData Insert(EventData data) { try { var p = new DynamicParameters(); p.Add("BetGuid", data.BetGuid); p.Add("UserID", data.UserID); p.Add("ActivityID", data.ActivityID); this._db.Execute("spSUP_Event_Insert", p, commandType: CommandType.StoredProcedure); } catch (Exception e) { NeoException.Handle(e); } return(data); }
public ActionResult VouchersCashIn(List <BetData> bets) { foreach (BetData b in bets) { if (b.CashIn) { Guid betGUID; bool isGUID = Guid.TryParse(b.Guid.ToString(), out betGUID); try { //najprej spremenimo status stave IBetDataRepository repository = new BetDataRepository(); if (isGUID) { //ČE JE BET SKLENJEN DAMO STATUS NA PRVI UNOVČEN KUPON, DRUGAČE JE PRVI KUPON UNOVČEN IN DAMO STATUS NA DRUGI UNOVČEN KUPON int newBetStatusID = Convert.ToInt32(b.BetStatusID) == 110 ? 112 : 113; repository.VoucherUpdateStatusAndReference(betGUID, newBetStatusID, Request["tbReference"]); b.BetStatusID = newBetStatusID.ToEnum <BetStatus>(); b.Voucher1Reference = Request["tbReference"]; //ZAPIŠEMO HISTORY!!! //NI PRAV NI PRAV NI PRAV NI PRAV NI PRAV NI PRAV NI PRAV NI PRAV //UPDATE: MALO MANJ NI PRAV AMPAK ZDAJ NE VEMO KATER AGENT JE AKTIVIRAL KUPON new EventData(betGUID, newBetStatusID == 112 ? -1 : -2, 204).Add(); } bets = repository.SelectVouchersByCode(b.Voucher1Code); } catch (Exception exc) { NeoException.Handle(exc); } } } //IBetDataRepository repository2 = new BetDataRepository(); //bets = repository2.SelectVouchersByCode(Request["hfVoucherCode"]); return(PartialView("_VoucherByCodePartial", bets)); }
public FileData Insert(FileData data) { try { var p = new DynamicParameters(); p.Add("FileTypeID", data.FileTypeID); p.Add("BetGuid", data.BetGuid); p.Add("FilePath", data.FilePath); p.Add("FileExtension", data.FileExtension); p.Add("InsertUserID", WebSecurity.CurrentUserId); p.Add("InsertUsername", WebSecurity.CurrentUserName); this._db.Execute("spSUP_File_Insert", p, commandType: CommandType.StoredProcedure); } catch (Exception e) { NeoException.Handle(e); } return(data); }