/// <summary> /// Method to retrieve GuestRegistration /// </summary> /// <param name="wslxId"></param> /// <returns>GuestRegistrationModel</returns> public GuestRegistrationModel GetGuestRegistrationBy(string wslxId) { GuestRegistrationModel model = new GuestRegistrationModel(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var _registration = from r in context.LBC_GUEST_REGISTRATION where r.WSLX_ID == wslxId select new GuestRegistrationModel { WSLX_ID = r.WSLX_ID, FIRST_NAME = r.FIRST_NAME, LAST_NAME = r.LAST_NAME, COMPANY_NAME = r.COMPANY_NAME, DEPARTMENT = r.DEPARTMENT, TITLE = r.TITLE, EMAIL_ID = r.EMAIL_ID, PHONE = r.PHONE, DIETARY_RESTRICTION = r.DIETARY_RESTRICTION, PROFILE_NOTE = r.PROFILE_NOTE, HOTEL_REQUIRED = r.HOTEL_REQUIRED }; model = _registration.SingleOrDefault(); } return(model); }
/// <summary> /// Method to update existing guest registration. /// </summary> /// <param name="model"></param> /// <returns>save</returns> public bool UpdateGuestRegistration(GuestRegistrationModel model) { bool save = true; try { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var _registration = (from p in context.LBC_GUEST_REGISTRATION where p.WSLX_ID == model.WSLX_ID select p).FirstOrDefault(); _registration.FIRST_NAME = model.FIRST_NAME; _registration.LAST_NAME = model.LAST_NAME; _registration.COMPANY_NAME = model.COMPANY_NAME; _registration.DEPARTMENT = model.DEPARTMENT; _registration.TITLE = model.TITLE; _registration.EMAIL_ID = model.EMAIL_ID; _registration.PHONE = model.PHONE; _registration.DIETARY_RESTRICTION = model.DIETARY_RESTRICTION; _registration.PROFILE_NOTE = model.PROFILE_NOTE; _registration.HOTEL_REQUIRED = model.HOTEL_REQUIRED; _registration.UPDATED_BY = model.UPDATED_BY; _registration.UPDATE_DATE = model.UPDATE_DATE; context.SaveChanges(); } } catch (Exception ex) { throw ex; // save = false; } return(save); }
/// <summary> /// Mapping the Model to the Data layer /// </summary> /// <param name="entity"></param> /// <returns>GuestRegistrationModel</returns> private GuestRegistrationModel MapModelFromLBC_GUEST_REGISTRATION(GuestRegistrationModel entity) { GuestRegistrationModel model = new GuestRegistrationModel(); if (entity != null) { model.WSLX_ID = entity.WSLX_ID; model.FIRST_NAME = entity.FIRST_NAME; model.LAST_NAME = entity.LAST_NAME; model.COMPANY_NAME = entity.COMPANY_NAME; model.TITLE = entity.TITLE; model.EMAIL_ID = entity.EMAIL_ID; model.PHONE = entity.PHONE; model.DIETARY_RESTRICTION = entity.DIETARY_RESTRICTION; model.PROFILE_NOTE = entity.PROFILE_NOTE; model.HOTEL_REQUIRED = entity.HOTEL_REQUIRED; model.CREATED_BY = entity.CREATED_BY; model.CREATED_DATE = entity.CREATED_DATE; model.UPDATED_BY = entity.UPDATED_BY; model.UPDATE_DATE = entity.UPDATE_DATE; model.DEPARTMENT = entity.DEPARTMENT; } return(model); }
/// <summary> /// Insert the guest registration record /// </summary> /// <param name="model"></param> public void SaveGuestRegistration(GuestRegistrationModel model) { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { LBC_GUEST_REGISTRATION _registration = new LBC_GUEST_REGISTRATION() { WSLX_ID = model.WSLX_ID, FIRST_NAME = model.FIRST_NAME, LAST_NAME = model.LAST_NAME, COMPANY_NAME = model.COMPANY_NAME, DEPARTMENT = model.DEPARTMENT, TITLE = model.TITLE, EMAIL_ID = model.EMAIL_ID, PHONE = model.PHONE, DIETARY_RESTRICTION = model.DIETARY_RESTRICTION, PROFILE_NOTE = model.PROFILE_NOTE, HOTEL_REQUIRED = model.HOTEL_REQUIRED, CREATED_BY = model.CREATED_BY, CREATED_DATE = model.CREATED_DATE }; context.LBC_GUEST_REGISTRATION.Add(_registration); context.SaveChanges(); } }
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)); }
public async void Success(string result) { GuestRegistrationModel = new GuestRegistrationModel(); IsCheck1 = true; Cnfpassword = string.Empty; await App.Current.MainPage.DisplayAlert("HMS", result, "OK"); OnPropertyChanged("GuestRegistrationModel"); OnPropertyChanged("Cnfpassword"); }
public JsonResult StatusUpdate(GuestRegistrationModel model) { try { return(Json(new { model = new GuestRegistrationModel().StatusUpdate(model) }, JsonRequestBehavior.AllowGet)); } catch (Exception Ex) { return(Json(new { model = Ex.Message }, JsonRequestBehavior.AllowGet)); } }
public JsonResult UploadGuestVehicleRegistration(GuestRegistrationModel model) { try { HttpPostedFileBase fileBaseGuestVehicleRegistration = null; for (int i = 0; i < Request.Files.Count; i++) { fileBaseGuestVehicleRegistration = Request.Files[i]; } return(Json(new { model = new GuestRegistrationModel().UploadGuestVehicleRegistration(fileBaseGuestVehicleRegistration, model) }, JsonRequestBehavior.AllowGet)); } catch (Exception Ex) { return(Json(new { model = Ex.Message }, JsonRequestBehavior.AllowGet)); } }
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")); }
public async void SaveGuestData(GuestRegistrationModel guestRegistrationModel) { GuestRegResponse guestRegResponse; GuestRegErrorResponse guestRegErrorResponse; string resultHostel; try { UserDialogs.Instance.ShowLoading(); var client = new HttpClient(); client.BaseAddress = new Uri(ApplicationURL.BaseURL); string json = JsonConvert.SerializeObject(guestRegistrationModel); var content = new StringContent(json, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync(ApplicationURL.GuestRegistration, content); resultHostel = await response.Content.ReadAsStringAsync(); if ((int)response.StatusCode == 200) { UserDialogs.Instance.HideLoading(); resultHostel = await response.Content.ReadAsStringAsync(); guestRegResponse = JsonConvert.DeserializeObject <GuestRegResponse>(resultHostel); guestRegistration.Success(guestRegResponse.message); } else { UserDialogs.Instance.HideLoading(); resultHostel = await response.Content.ReadAsStringAsync(); guestRegErrorResponse = JsonConvert.DeserializeObject <GuestRegErrorResponse>(resultHostel); await App.Current.MainPage.DisplayAlert("HMS", guestRegErrorResponse.errors[0].message, "OK"); } } catch (Exception ex) { UserDialogs.Instance.HideLoading(); await App.Current.MainPage.DisplayAlert("HMS", ex.ToString(), "OK"); } }
public bool UpdateGuestRegistration(GuestRegistrationModel model) { GuestRepository _registration = new GuestRepository(); return(_registration.UpdateGuestRegistration(model)); }
public void SaveGuestRegistration(GuestRegistrationModel model) { GuestRepository _registration = new GuestRepository(); _registration.SaveGuestRegistration(model); }