public void SaveGuestRegistrationSession(GuestSessionModel model) { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { LBC_GUEST_REGD_SESSION _registration = new LBC_GUEST_REGD_SESSION() { WSLX_ID = model.WSLX_ID, SESSION_ID = model.SESSION_ID, CREATED_BY = model.CREATED_BY, CREATED_DATE = model.CREATED_DATE }; context.LBC_GUEST_REGD_SESSION.Add(_registration); context.SaveChanges(); } }
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")); }
public void SaveGuestRegistrationSession(GuestSessionModel model) { GuestRepository _registration = new GuestRepository(); _registration.SaveGuestRegistrationSession(model); }