public override void OnNavigatedTo(NavigationParameters parameters) { var eventSignUp = _eventSignUpService.Create(); eventSignUp.EventDate = DateTime.Now; eventSignUp.ActiveRuleSet = Constants.PageOneRule; // now only PageOne rules are enforced on this page. eventSignUp.CheckAllRules(); this.EventSignUp = eventSignUp; }
public EventSignUp Create(AddPropertyNamesToIndexerErrorMessage addPropertyNamesToIndexerErrorMessage = AddPropertyNamesToIndexerErrorMessage.Yes) { var eventSignUp = new EventSignUp(); eventSignUp.ActiveRuleSet = GlobalConstants.InsertRule; eventSignUp.CheckAllRules(); eventSignUp.AddPropertyNamesToIndexerErrorMessage = addPropertyNamesToIndexerErrorMessage; return(eventSignUp); }
private void addItemToList(int contactId, List <CartItem> itmArr, int catId, int cost) { EventSignUp sup = new EventSignUp(); sup.EventCategoryTypeID = catId; sup.ContactID = contactId; sup.EventID = eventID; int rez = sup.addEventSignUp(); CartItem itm = new CartItem(); itm.itemCost = cost; itm.EventSignUpID = rez; itm.StrSessionID = Session.SessionID; itmArr.Add(itm); }
public override void OnNavigatedTo(NavigationParameters parameters) { if (parameters != null && parameters.ContainsKey(GlobalConstants.Key)) { var eventSignUp = parameters[GlobalConstants.Key] as EventSignUp; if (eventSignUp != null) { eventSignUp.ActiveRuleSet = GlobalConstants.InsertRule; // change rule set to insert to match the operation we are doing. eventSignUp.CheckAllRules(); // check all rules based on Insert Rule eventSignUp.EndLoading(); // set is dirty to false to hide errors until properties on this page have been entered this.EventSignUp = eventSignUp; return; } } base.DisplayDialog(GlobalConstants.Error, "Parameters are null, key is missing, or parameter was not event sign up", GlobalConstants.OK, () => base.GoBack()); }
private void addLine(int contactId, List <CartItem> items, int itemCount, int eventCategoryId) { int cost = getCost(itemCount); EventSignUp sup = new EventSignUp(); sup.EventCategoryTypeID = eventCategoryId; sup.ContactID = contactId; sup.EventID = eventID; int rez = sup.addEventSignUp(); CartItem itm = new CartItem(); itm.itemCost = cost; itm.EventSignUpID = rez; itm.StrSessionID = Session.SessionID; items.Add(itm); }
private void processButton() { setGlobals(); bool redirectError = false; try { String xcxcx = Session.SessionID; int contactID = addContact(); int coachID = addCoach(contactID); List <CartItem> itmArr = new List <CartItem>(); CartItem itm; EventSignUp sup; try { sup = new EventSignUp(); sup.ContactID = contactID; sup.EventID = eventID; sup.EventCategoryTypeID = 26; int rez = sup.addEventSignUp(); itm = new CartItem(); itm.itemCost = (dtToday > dtApril4) ? 25 : 20; itm.EventSignUpID = rez; itm.StrSessionID = Session.SessionID; itmArr.Add(itm); addShirt(contactID, itmArr); addTickets(contactID, itmArr); } catch (Exception ex) { throw ex; } finally { sup = null; itm = null; } try { // instructor Session.Add("schoolName", txtSchool.Value); Session.Add("instructorName", txtInstrName.Value); Session.Add("instructorEmail", txtInstrEmail.Value); Session.Add("instructorPhone", txtInstrWebsite.Value); //contact Session.Add("address", txtAddress.Value); Session.Add("city", txtCity.Value); Session.Add("state", ddlStates.Value); Session.Add("postal", postal.Value); Session.Add("email", txtEmail.Value); Session.Add("phone", txtPhone.Value); } catch { // swallow these because we don't care if they fail } // Add items to shopping cart int rezCart = 0; foreach (CartItem i in itmArr) { rezCart = i.addCartItem(); } try { Response.Redirect(@"~/Cart2.aspx?s=" + Session.SessionID, false); } catch (ThreadAbortException taex) { // don't worry about it redirectError = true; } } catch (Exception ex) { if (redirectError != true) //don't ignore this error { StringBuilder sb = new StringBuilder(); sb.AppendLine("Cookie[MySessionID].Value: " + Request.Cookies["MySessionID"].Value); sb.AppendLine("Session Values"); for (int i = 0; i < Session.Contents.Count; i++) { var key = Session.Keys[i]; var value = Session[i]; sb.AppendLine("Key: " + key + " - Value: " + value); } sb.AppendLine("Stack Trace: " + ex.StackTrace); ErrorLogger.LogError(ex.Message, sb.ToString(), "Coach.processButton"); throw ex; } } }
private void processButton() { bool redirectError = false; try { int eventID = int.Parse(System.Configuration.ConfigurationManager.AppSettings["eventDatabaseID"]); eventID = 12; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!################################## Warning, do not use this after 205 ################################!!!!!!!!!!!!!!!!!!!!!!!! String xcxcx = Session.SessionID; CartItem itm; EventSignUp sup; try { sup = new EventSignUp(); sup.ContactID = 444; sup.EventID = eventID; sup.EventCategoryTypeID = 36; int rez = sup.addEventSignUp(); itm = new CartItem(); itm.itemCost = int.Parse(Session["price"].ToString()); itm.EventSignUpID = rez; itm.StrSessionID = Session.SessionID; itm.addCartItem(); } catch (Exception ex) { throw ex; } finally { //clean up sup = null; itm = null; } try { Session.Add("MySessionID", Session.SessionID); Response.Cookies["MySessionID"].Value = Session.SessionID; Response.Cookies["MySessionID"].Expires = DateTime.Now.AddDays(1); Response.Redirect(@"~/Cart2.aspx?s=" + Session.SessionID, false); } catch (Exception ex) { // don't worry about it redirectError = true; String ewerwer = ex.Message; } } catch (Exception ex) { if (redirectError != true) //ignore this error { throw ex; } } }