private static void ListAllGuests() { try { List <GuestBook> guestList = GuestBL.GetAllGuestBL(); if (guestList != null) { Console.WriteLine("******************************************************************************"); Console.WriteLine("GuestID\t\tName\t\tPhoneNumber"); Console.WriteLine("******************************************************************************"); foreach (GuestBook guest in guestList) { Console.WriteLine("{0}\t\t{1}\t\t{2}", guest.GuestID, guest.GuestName, guest.GuestContactNumber); } Console.WriteLine("******************************************************************************"); } else { Console.WriteLine("No Guest Details Available"); } } catch (GuestException ex) { Console.WriteLine(ex.Message); } }
private static void AddGuest() { try { GuestBook newGuest = new GuestBook(); //Console.WriteLine("Enter GuestID :"); //newGuest.GuestID = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter Guest Name :"); newGuest.GuestName = Console.ReadLine(); Console.WriteLine("Enter PhoneNumber :"); newGuest.GuestContactNumber = Console.ReadLine(); bool guestAdded = GuestBL.AddGuestBL(newGuest); if (guestAdded) { Console.WriteLine("Guest Added"); } else { Console.WriteLine("Guest not Added"); } } catch (GuestException ex) { Console.WriteLine(ex.Message); } catch (Exception e) { Console.WriteLine(e.Message); } }
private static void DeleteGuest() { try { int deleteGuestID; Console.WriteLine("Enter GuestID to Delete:"); deleteGuestID = Convert.ToInt32(Console.ReadLine()); GuestBook deleteGuest = GuestBL.SearchGuestBL(deleteGuestID); if (deleteGuest != null) { bool guestdeleted = GuestBL.DeleteGuestBL(deleteGuestID); if (guestdeleted) { Console.WriteLine("Guest Deleted"); } else { Console.WriteLine("Guest not Deleted "); } } else { Console.WriteLine("No Guest Details Available"); } } catch (GuestException ex) { Console.WriteLine(ex.Message); } }
private static void UpdateGuest() { try { int updateGuestID; Console.WriteLine("Enter GuestID to Update Details:"); updateGuestID = Convert.ToInt32(Console.ReadLine()); GuestBook updatedGuest = GuestBL.SearchGuestBL(updateGuestID); if (updatedGuest != null) { Console.WriteLine("Update Guest Name :"); updatedGuest.GuestName = Console.ReadLine(); Console.WriteLine("Update PhoneNumber :"); updatedGuest.GuestContactNumber = Console.ReadLine(); bool guestUpdated = GuestBL.UpdateGuestBL(updatedGuest); if (guestUpdated) { Console.WriteLine("Guest Details Updated"); } else { Console.WriteLine("Guest Details not Updated "); } } else { Console.WriteLine("No Guest Details Available"); } } catch (GuestException ex) { Console.WriteLine(ex.Message); } }
private static void UpdateOnlineReturn() { try { int updateReturnID; Console.WriteLine("Enter ReturnID to Update Details:"); updateReturnID = Convert.ToInt32(Console.ReadLine()); OnlineReturnBL onlineReturnBL = new OnlineReturnBL(); OnlineReturn updatedOnlineReturn = onlineReturnBL.(updateReturnID); if (updatedOnlineReturn != null) { Console.WriteLine("Update Purpose Of Return :"); updatedOnlineReturn.PurposeOfReturn = Console.ReadLine(); Console.WriteLine("Update No :"); updatedOnlineReturn.NoOfReturn = Console.ReadLine(); bool guestUpdated = GuestBL.UpdateGuestBL(updatedGuest); if (guestUpdated) { Console.WriteLine("Guest Details Updated"); } else { Console.WriteLine("Guest Details not Updated "); } } else { Console.WriteLine("No Guest Details Available"); } } catch (GuestPhoneBookException ex) { Console.WriteLine(ex.Message); } }
private static void SearchGuestByID() { try { int searchGuestID; Console.WriteLine("Enter GuestID to Search:"); searchGuestID = Convert.ToInt32(Console.ReadLine()); GuestBook searchGuest = GuestBL.SearchGuestBL(searchGuestID); if (searchGuest != null) { Console.WriteLine("******************************************************************************"); Console.WriteLine("GuestID\t\tName\t\tPhoneNumber"); Console.WriteLine("******************************************************************************"); Console.WriteLine("{0}\t\t{1}\t\t{2}", searchGuest.GuestID, searchGuest.GuestName, searchGuest.GuestContactNumber); Console.WriteLine("******************************************************************************"); } else { Console.WriteLine("No Guest Details Available"); } } catch (GuestException ex) { Console.WriteLine(ex.Message); } }
public ActionResult GuestRegister() { WslxEntity curWSLXModel = new WslHelper().validateWSL(); Session["w_user"] = curWSLXModel.WWSLX; ViewBag.homeid = "home"; GuestRegistrationModel guest = new GuestRegistrationModel(); GuestBL bl = new GuestBL(); guest = bl.GetGuestRegistrationBy(Session["w_user"].ToString()); if (guest == null) { GuestRegistrationModel _guest = new GuestRegistrationModel(); _guest.WSLX_ID = Session["w_user"].ToString(); if (_guest.PHONE != null) { _guest.phone1 = _guest.PHONE.Substring(0, 3); _guest.phone2 = _guest.PHONE.Substring(3, 3); _guest.phone3 = _guest.PHONE.Substring(6, 4); } return(View(_guest)); } if (guest.PHONE != null) { guest.phone1 = guest.PHONE.Substring(0, 3); guest.phone2 = guest.PHONE.Substring(3, 3); guest.phone3 = guest.PHONE.Substring(6, 4); } return(View(guest)); }
private static void AddOnlineReturn() { try { OnlineReturn newOnlineReturn = new OnlineReturn(); Console.WriteLine("Enter ReturnID :"); newOnlineReturn.ReturnID = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter Purpose Of Return :"); Console.WriteLine("Choose purpose of return"); Console.WriteLine("EnterA: Unsatisfactory Product "); Console.WriteLine("EnterB: Defective product"); Console.WriteLine("EnterC: Incomplete Product "); Console.WriteLine("EnterD: Wrong Product Ordered "); Console.WriteLine("EnterF: wrong Product shipped"); newOnlineReturn.GuestName = Console.ReadLine(); Console.WriteLine("Enter PhoneNumber :"); newGuest.GuestContactNumber = Console.ReadLine(); bool guestAdded = GuestBL.AddGuestBL(newGuest); if (guestAdded) { Console.WriteLine("Guest Added"); } else { Console.WriteLine("Guest not Added"); } } catch (GuestPhoneBookException ex) { Console.WriteLine(ex.Message); } }
public int ChangeGuestRSVP(GuestBL guestToRSVP, int response) { Guest original_Guest = new Guest(); Guest guest = new Guest(); guest.name = guestToRSVP.name; guest.email = guestToRSVP.email; guest.eventId = guestToRSVP.eventId; if (response == 1) { guest.rsvp = "Attending"; } else if (response == 2) { guest.rsvp = "Not Attending"; } else { return(0); } int successCheck = UpdateGuestRSVP(guest); return(successCheck); }
/// <summary> /// Created a Partial View to trigger the data from the drop down /// </summary> /// <param name="monthYear"></param> /// <returns></returns> public PartialViewResult GetSession(string monthYear) { string month = ""; int year = DateTime.Now.Year; string[] MonYr = monthYear.Split(','); month = MonYr[0]; year = Convert.ToInt32(MonYr[1]); EventBL _evBl = new EventBL(); EventModel evModel = new EventModel(); List <decimal> eventIds = new List <decimal>(); eventIds = _evBl.GetEventModelByMonYear(month, Convert.ToDecimal(year)); var wslxId = Session["w_user"].ToString(); GuestSessionLookupModel guest = new GuestSessionLookupModel(); GuestBL bl = new GuestBL(); List <GuestSessionLookupModel> lstSession = new List <GuestSessionLookupModel>(); evModel.SessionLookupList = bl.GetAll(eventIds); evModel.SessionLookupListByUser = bl.GetAllby(eventIds, wslxId); foreach (GuestSessionLookupModel item in evModel.SessionLookupList) { foreach (GuestSessionLookupModel itemUser in evModel.SessionLookupListByUser) { if (itemUser.SESSION_ID == item.SESSION_ID) { item.REGISTERED_SESSION = itemUser.SESSION_ID; break; } else { item.REGISTERED_SESSION = 0; } } } Session["Lookuplist"] = evModel.SessionLookupList; //ViewBag.SessionList = bl.GetSessionByWSLX(Session["w_user"].ToString()); return(PartialView("_Sessions", evModel)); }
protected void Page_Load(object sender, EventArgs e) { value = Request.QueryString["eValue"]; guestEmail = Request.QueryString["Guest"]; eventId = Request.QueryString["Event"]; //if the user has arrived here by clicking an rsvp link then the rsvp system has to save the guest information if (value != null && guestEmail != null && eventId != null) { EmailBL emailNew = new EmailBL(); GuestBL guest = emailNew.GetActiveGuest(eventId, guestEmail); emailNew.ChangeGuestRSVP(guest, Convert.ToInt32(value)); } }
public GuestBL GetActiveGuest(string eventId, string email) { List <Guest> guestList = GetGuests(eventId); GuestBL selectedGuest = new GuestBL(); foreach (Guest guest in guestList) { if (guest.active && guest.email == email) { selectedGuest.name = guest.name; selectedGuest.email = guest.email; selectedGuest.eventId = guest.eventId; selectedGuest.rsvp = selectedGuest.rsvp; } } return(selectedGuest); }
public ActionResult GuestRegister(GuestRegistrationModel model) { GuestBL grBL = new GuestBL(); model.PHONE = model.phone1 + model.phone2 + model.phone3; if (grBL.CheckGuestRegistrationBy(model.WSLX_ID)) { model.UPDATE_DATE = DateTime.Now; model.UPDATED_BY = Session["w_user"].ToString(); grBL.UpdateGuestRegistration(model); } else { model.CREATED_DATE = DateTime.Now; model.CREATED_BY = Session["w_user"].ToString(); grBL.SaveGuestRegistration(model); } return(RedirectToAction("GuestConfirm", "Guest")); }
//Needs to get the user id and event id from session data, should otherwise return a list of guests associated with the logged in user and selected event to be worked with by the user layer this will work for the RSVP page - Saxon public List <GuestBL> GetActiveGuests(string eventId) { List <Guest> guestList = GetGuests(eventId); List <GuestBL> activeGuests = new List <GuestBL>(); foreach (Guest guest in guestList) { if (guest.active) { GuestBL newGuest = new GuestBL(); newGuest.email = guest.email; newGuest.name = guest.name; newGuest.eventId = guest.eventId; newGuest.rsvp = guest.rsvp; activeGuests.Add(newGuest); } } return(activeGuests); }
public ActionResult RegisterSession(FormCollection frm, string wslx) { GuestBL grBL = new GuestBL(); GuestSessionModel _gsModel = new GuestSessionModel(); _gsModel.WSLX_ID = frm["wslx"].ToString(); if (Session["Lookuplist"] != null) { var list = Session["Lookuplist"] as List <GuestSessionLookupModel>; List <decimal> lstsession = new List <decimal>(); foreach (var item in list) { lstsession.Add(item.SESSION_ID); } if (!grBL.removeSesssionRegistered(lstsession, _gsModel.WSLX_ID)) { throw new Exception("removeSesssionRegistered"); } } else { return(RedirectToAction("Index", "Guest")); } for (int i = 2; i <= frm.Count - 1; i++) { _gsModel.SESSION_ID = Convert.ToDecimal(frm[i].ToString()); _gsModel.CREATED_BY = Session["w_user"].ToString(); _gsModel.CREATED_DATE = DateTime.Now; grBL.SaveGuestRegistrationSession(_gsModel); } return(RedirectToAction("GuestRegister", "Guest")); }