//public List<EventModel> GetEventListMonth() //{ // List<EventModel> lst = new List<EventModel>(); // using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) // { // var list = (from entity in context.LBC_EVENT // //where entity.DLR_REGION == dlrRegion || string.IsNullOrEmpty(entity.DLR_REGION) // select new EventModel // { // EVENT_MONTH = entity.EVENT_MONTH, // EVENT_YEAR = entity.EVENT_YEAR, // // EVENT_ID = entity.EVENT_ID // }).ToList().Distinct(); // lst = list.ToList(); // } // return lst; //} public List <string> GetEventListMonth() { List <string> lst = new List <string>(); List <EventModel> lstmodel = new List <EventModel>(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var list = (from entity in context.LBC_EVENT //where entity.DLR_REGION == dlrRegion || string.IsNullOrEmpty(entity.DLR_REGION) select new EventModel { EVENT_MONTH = entity.EVENT_MONTH, EVENT_YEAR = entity.EVENT_YEAR, // EVENT_ID = entity.EVENT_ID }).ToList().Distinct(); lstmodel = list.ToList(); } foreach (var item in lstmodel) { lst.Add(item.EVENT_MONTH + "," + item.EVENT_YEAR.ToString()); } return(lst.Distinct().ToList <string>()); }
public List <ProfileModel> GetListProfileByStarsId(List <string> StarsIdList = null) { List <ProfileModel> lst = new List <ProfileModel>(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var list = (from entity in context.LBC_PROFILE where entity.EMP_STATUS_CODE == "A" select entity).ToList(); if (StarsIdList != null) { for (int i = 0; i < StarsIdList.Count(); i++) { var entry = list.Where(q => q.STARS_ID == StarsIdList[i]).FirstOrDefault(); if (entry != null) { lst.Add(MapModelFromLBC_Profile(entry)); } } } else { foreach (LBC_PROFILE item in list) { lst.Add(MapModelFromLBC_Profile(item)); } } } return(lst); }
public bool UpdateHotelInfo(HotelCarModel model) { bool save = true; try { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var _hotel = (from p in context.LBC_HOTEL_CAR_INFO where p.STARS_ID == model.STARS_ID && p.EVENT_ID == model.EVENT_ID select p).FirstOrDefault(); _hotel.HOTEL_NAME = model.HOTEL_NAME; _hotel.HOTEL_CONF = model.HOTEL_CONF; _hotel.HOTEL_CHECK_IN = model.HOTEL_CHECK_IN; _hotel.HOTEL_CHECK_OUT = model.HOTEL_CHECK_OUT; _hotel.CAR_CONFIRM = model.CAR_CONFIRM; _hotel.CAR_NOTES = model.CAR_NOTES; _hotel.ADMIN_NOTES = model.ADMIN_NOTES; _hotel.UPDATE_DATE = model.UPDATE_DATE; _hotel.UPDATED_BY = model.UPDATED_BY; context.SaveChanges(); } } catch (Exception ex) { throw ex; // save = false; } return(save); }
public StoryModel getStoriesBySEQID(int seqid) { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var lst = from sq in context.LBC_STORY where sq.SEQ_ID == seqid select new StoryModel { SEQ_ID = sq.SEQ_ID, STARS_ID = sq.STARS_ID, PA_CODE = sq.PA_CODE, STORY_TITLE = sq.STORY_TITLE, STORY_CONTENT = sq.STORY_CONTENT, STORY_RATING = sq.STORY_RATING, STORY_STATUS = sq.STORY_STATUS, STORY_CATEGORY = sq.STORY_CATEGORY, STORY_SUBCATEGORY = sq.STORY_SUBCATEGORY, IMG_1 = sq.IMG_1, IMG_2 = sq.IMG_2, IMG_3 = sq.IMG_3, CREATED_DATE = sq.CREATED_DATE, CREATED_BY = sq.CREATED_BY, UPDATED_BY = sq.UPDATED_BY, UPDATED_DATE = sq.UPDATED_DATE, SUBMISION_DATE = sq.SUBMISION_DATE } ; return(lst.SingleOrDefault()); } }
public IPagedList <ProfileModel> GetAll(string search, string filter, int page, int pageSize, string order = "", string asc = "") { search = string.IsNullOrEmpty(search) ? string.Empty : search; search = search.ToUpper().Equals("ALL") ? string.Empty : search; filter = string.IsNullOrEmpty(filter) ? string.Empty : filter; List <ProfileModel> _lst = new List <ProfileModel>(); IEnumerable <ProfileModel> _lstTemp; using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var list = (from entity in context.LBC_PROFILE where entity.FIRST_NAME.StartsWith(search) && entity.EMP_STATUS_CODE == "A" select entity).ToList(); if (!string.IsNullOrEmpty(filter)) { list.Clear(); list = (from entity in context.LBC_PROFILE where entity.EMP_STATUS_CODE == "A" && (entity.FIRST_NAME.ToLower().Contains(filter.ToLower()) || entity.LAST_NAME.ToLower().Contains(filter.ToLower())) select entity).ToList(); } foreach (LBC_PROFILE item in list) { _lst.Add(MapModelFromLBC_Profile(item)); } } _lstTemp = _lst.AsQueryable(); return(_lstTemp.ToPagedList <ProfileModel>(page, pageSize)); }
/// <summary> /// Updates the shipping status in the checkpointCompleted entity /// </summary> /// <param name="model"></param> /// <returns></returns> public bool UpdateCheckpointStatus(CheckpointReportModel model) { bool save = true; try { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var _chk = (from lcc in context.LBC_CHECKPOINT_COMPLETED where lcc.STARS_ID == model.STARS_ID && lcc.CHECKPOINT_ID == model.CHECKPOINT_ID select lcc).FirstOrDefault(); _chk.SHIPPING_STATUS = model.SHIPPING_STATUS; _chk.UPDATED_DATE = DateTime.Now; _chk.UPDATED_BY = System.Web.HttpContext.Current.Session["w_user"].ToString(); context.SaveChanges(); } } catch (Exception ex) { throw ex; // save = false; } return(save); }
/// <summary> /// MEthod to set the attendance for a registration /// </summary> /// <param name="model"></param> /// <returns></returns> public bool UpdateAttendanceInfo(AttendanceReportModel model) { bool save = true; try { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var _attend = (from rg in context.LBC_REGISTRATION where rg.STARS_ID == model.STARS_ID && rg.EVENT_ID == model.EVENT_ID select rg).FirstOrDefault(); _attend.ATTENDED = model.ATTENDED; _attend.UPDATE_DATE = DateTime.Now; _attend.UPDATED_BY = System.Web.HttpContext.Current.Session["w_user"].ToString(); context.SaveChanges(); } } catch (Exception ex) { throw ex; // save = false; } return(save); }
/// <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 return a list of guest registrations /// </summary> /// <param name="wslxId"></param> /// <returns>list guestRegistration</returns> public List <GuestRegistrationModel> GetGuestRegListBy(string wslxId) { List <GuestRegistrationModel> list = new List <GuestRegistrationModel>(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var lst = from r in context.LBC_GUEST_REGISTRATION //from s in context.LBC_GUEST_REGD_SESSION.Where(s => s.WSLX_ID == r.WSLX_ID).DefaultIfEmpty() 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 }; return(lst.ToList <GuestRegistrationModel>()); } }
public bool removeSesssionRegistered(List <decimal> SessionId, string wslxid) { bool flag = false; using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { List <LBC_GUEST_REGD_SESSION> _sesssion = (from p in context.LBC_GUEST_REGD_SESSION where p.WSLX_ID == wslxid && SessionId.Contains(p.SESSION_ID) select p).ToList <LBC_GUEST_REGD_SESSION>(); if (_sesssion.Count() > 0) { try { foreach (LBC_GUEST_REGD_SESSION item in _sesssion) { context.LBC_GUEST_REGD_SESSION.Remove(item); context.SaveChanges(); flag = true; } } catch (Exception ex) { flag = false; } } else { flag = true; } } return(flag); }
public List <GuestSessionLookupModel> GetAllby(List <decimal> eventids, string wslxId) { List <GuestSessionLookupModel> list = new List <GuestSessionLookupModel>(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var lst = from ev in context.LBC_EVENT join esl in context.LBC_EVENT_SESSION_LOOKUP on ev.EVENT_ID equals esl.EVENT_ID join grs in context.LBC_GUEST_REGD_SESSION on esl.SESSION_ID equals grs.SESSION_ID where eventids.Contains(ev.EVENT_ID) && wslxId.Contains(grs.WSLX_ID) select new GuestSessionLookupModel { EVENT_ID = esl.EVENT_ID, SESSION_DATE = esl.SESSION_DATE, SESSION_DESC = esl.SESSION_DESC, SESSION_ID = esl.SESSION_ID, EVENT_MONTH = ev.EVENT_MONTH, EVENT_LOCATION = ev.EVENT_LOCATION, EVENT_SESSION = ev.EVENT_SESSION, EVENT_YEAR = ev.EVENT_YEAR, REGISTERED_SESSION = grs.SESSION_ID }; return(lst.ToList <GuestSessionLookupModel>()); } }
public List <GuestSessionLookupModel> GetAll(List <decimal> eventids) { List <GuestSessionLookupModel> list = new List <GuestSessionLookupModel>(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var lst = from ev in context.LBC_EVENT join esl in context.LBC_EVENT_SESSION_LOOKUP on ev.EVENT_ID equals esl.EVENT_ID where eventids.Contains(ev.EVENT_ID) //ev.EVENT_ID.ToString().Contains(eventids) select new GuestSessionLookupModel { EVENT_ID = esl.EVENT_ID, //LBC_EVENT = MapModelFromLBC_EVENT(LBC_EVENT), SESSION_DATE = esl.SESSION_DATE, SESSION_DESC = esl.SESSION_DESC, SESSION_ID = esl.SESSION_ID, EVENT_MONTH = ev.EVENT_MONTH, EVENT_LOCATION = ev.EVENT_LOCATION, EVENT_SESSION = ev.EVENT_SESSION, EVENT_YEAR = ev.EVENT_YEAR }; return(lst.ToList <GuestSessionLookupModel>()); } }
/// <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> /// 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 bool Save(ProfileRecognitionMasterModel model) { bool save = true; try { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { LBC_PROFILE_RECOGNITION_MASTER _profileM = new LBC_PROFILE_RECOGNITION_MASTER() { CATEGORY = model.CATEGORY, CREATED_DATE = model.CREATED_DATE, CREATED_BY = model.CREATED_BY, RECOGNITION_DESC = model.RECOGNITION_DESC, RECOGNITION_ID = model.RECOGNITION_ID, RECOGNITION_TITLE = model.RECOGNITION_TITLE, UPDATE_DATE = model.UPDATE_DATE, UPDATED_BY = model.UPDATED_BY }; context.LBC_PROFILE_RECOGNITION_MASTER.Add(_profileM); context.SaveChanges(); } } catch (Exception ex) { save = false; } return(save); }
/// <summary> /// Method to Update the Registration Table /// </summary> /// <param name="model"></param> /// <returns></returns> public bool UpdateRegistration(RegistrationModel model) { bool save = true; try { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var _registration = (from p in context.LBC_REGISTRATION where p.STARS_ID == model.STARS_ID && p.EVENT_ID == model.EVENT_ID select p).FirstOrDefault(); _registration.ATTENDED = model.ATTENDED; _registration.TRANSPORTATION_MODE = model.TRANSPORTATION_MODE; _registration.TRANSPORTATION_NEED = model.TRANSPORTATION_NEED; _registration.REGD_STATUS = model.REGD_STATUS; _registration.UPDATE_DATE = model.UPDATE_DATE; _registration.UPDATED_BY = model.UPDATED_BY; _registration.NOTES = model.NOTES; _registration.ADMIN_NOTES = model.ADMIN_NOTES; _registration.CANCEL_REASON = model.CANCEL_REASON; context.SaveChanges(); } } catch (Exception ex) { throw ex; // save = false; } return(save); }
public bool Update(ProfileRecognitionMasterModel model) { bool save = true; try { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var _profile = (from p in context.LBC_PROFILE_RECOGNITION_MASTER where p.RECOGNITION_ID == model.RECOGNITION_ID select p).FirstOrDefault(); _profile.CATEGORY = model.CATEGORY; _profile.CREATED_DATE = model.CREATED_DATE; _profile.CREATED_BY = model.CREATED_BY; _profile.RECOGNITION_DESC = model.RECOGNITION_DESC; _profile.RECOGNITION_ID = model.RECOGNITION_ID; _profile.RECOGNITION_TITLE = model.RECOGNITION_TITLE; _profile.UPDATE_DATE = model.UPDATE_DATE; _profile.UPDATED_BY = model.UPDATED_BY; context.SaveChanges(); } } catch (Exception ex) { save = false; } return(save); }
/// <summary> /// Get the list of registration items by starz id /// </summary> /// <param name="StarsId"></param> /// <returns></returns> public List <RegistrationModel> GetRegByStarsId(string StarsId) { List <RegistrationModel> list = new List <RegistrationModel>(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var lst = from pr in context.LBC_PROFILE from reg in context.LBC_REGISTRATION.Where(reg => reg.STARS_ID == pr.STARS_ID).DefaultIfEmpty() where pr.STARS_ID == StarsId select new RegistrationModel { STARS_ID = pr.STARS_ID, PA_CODE = pr.PA_CODE, WSLX_ID = pr.WSLX_ID, FIRST_NAME = pr.FIRST_NAME, LAST_NAME = pr.LAST_NAME, TITLE = pr.TITLE, EMAIL_ID = pr.EMAIL_ID, DLR_PHONE = pr.DLR_PHONE, PHONE = pr.PHONE, DLR_NAME = pr.DLR_NAME, DLR_ADDRESS = pr.DLR_ADDRESS, DLR_CITY = pr.DLR_CITY, DLR_STATE = pr.DLR_STATE, DLR_ZIP = pr.DLR_ZIP, DIETARY_RESTRICTION = pr.DIETARY_RESTRICTION, ATTENDED = reg.ATTENDED, TRANSPORTATION_MODE = reg.TRANSPORTATION_MODE, REGD_STATUS = reg.REGD_STATUS }; return(lst.ToList <RegistrationModel>()); } }
/// <summary> /// Get individual rows for editing in the checkpoint report. /// </summary> /// <param name="StarsId"></param> /// <returns>Checkpoint Report Model</returns> public CheckpointReportModel GetCheckpointInfoByStarsId(string StarsId) { CheckpointReportModel model = new CheckpointReportModel(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var lst = from pr in context.LBC_PROFILE join chc in context.LBC_CHECKPOINT_COMPLETED on pr.STARS_ID equals chc.STARS_ID join ch in context.LBC_CHECKPOINT on chc.CHECKPOINT_ID equals ch.CHECKPOINT_ID where pr.STARS_ID == StarsId select new CheckpointReportModel { STARS_ID = pr.STARS_ID, PA_CODE = pr.PA_CODE, FIRST_NAME = pr.FIRST_NAME, LAST_NAME = pr.LAST_NAME, DLR_NAME = pr.DLR_NAME, DLR_ADDRESS = pr.DLR_ADDRESS, DLR_CITY = pr.DLR_CITY, DLR_STATE = pr.DLR_STATE, DLR_ZIP = pr.DLR_ZIP, DLR_PHONE = pr.DLR_PHONE, CHECKPOINT_ID = chc.CHECKPOINT_ID, TOOL_ORDERED = chc.TOOL_ORDERED, EMAIL_ID = chc.EMAIL_ID, SHIPPING_STATUS = chc.SHIPPING_STATUS, CREATED_DATE = chc.CREATED_DATE }; model = lst.SingleOrDefault(); } return(model); }
public List <SurveyReportModel> GetSurveyReport(decimal surveyId) { List <SurveyReportModel> lst = new List <SurveyReportModel>(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { if (surveyId != 0) { var list = (from entity in context.LBC_SURVEY_COMPLETED_VIEW where entity.SURVEY_ID == surveyId select entity).ToList(); foreach (LBC_SURVEY_COMPLETED_VIEW item in list) { lst.Add(MapModelFromLBC_SURVEY_COMPLETED_VIEW(item)); } } else { var list = (from entity in context.LBC_SURVEY_COMPLETED_VIEW select entity).ToList(); foreach (LBC_SURVEY_COMPLETED_VIEW item in list) { lst.Add(MapModelFromLBC_SURVEY_COMPLETED_VIEW(item)); } } } foreach (SurveyReportModel item in lst) { SurveyRepository _recognition = new SurveyRepository(); item.QUESTIONS = _recognition.GetReportQuestions(); } return(lst); }
/// <summary> /// Method to add the Story /// </summary> /// <param name="model"></param> public void SaveStory(StoryModel model) { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { LBC_STORY _story = new LBC_STORY() { STARS_ID = model.STARS_ID, PA_CODE = model.PA_CODE, STORY_TITLE = model.STORY_TITLE, STORY_CONTENT = model.STORY_CONTENT, STORY_RATING = model.STORY_RATING, STORY_STATUS = model.STORY_STATUS, STORY_CATEGORY = model.STORY_CATEGORY, STORY_SUBCATEGORY = model.STORY_SUBCATEGORY, SUBMISION_DATE = model.SUBMISION_DATE, IMG_1 = model.IMG_1, IMG_2 = model.IMG_2, IMG_3 = model.IMG_3, CREATED_DATE = model.CREATED_DATE, CREATED_BY = model.CREATED_BY }; context.LBC_STORY.Add(_story); context.SaveChanges(); } }
/// <summary> /// Method to Insert the data on the FlightInfo table /// </summary> /// <param name="model"></param> public void SaveFlightInfo(FlightInfoModel model) { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { LBC_FLIGHT_INFO _flightInfo = new LBC_FLIGHT_INFO() { //REGD_SEQ_NUM = model.REGD_SEQ_NUM, STARS_ID = model.STARS_ID, EVENT_ID = model.EVENT_ID, ARR_DATE = model.ARR_DATE, ARR_TIME = model.ARR_TIME, ARR_AIRLINE = model.ARR_AIRLINE, ARR_FLIGHT_NUM = model.ARR_FLIGHT_NUM, ARR_CITY = model.ARR_CITY, DEP_DATE = model.DEP_DATE, DEP_TIME = model.DEP_TIME, DEP_AIRLINE = model.DEP_AIRLINE, DEP_FLIGHT_NUM = model.DEP_FLIGHT_NUM, DEP_CITY = model.DEP_CITY, DEP_DEST_CITY = model.DEP_DEST_CITY, MULTI_FLAG = model.MULTI_FLAG, CREATED_DATE = model.CREATED_DATE, CREATED_BY = model.CREATED_BY, ARR_DEP_CITY = model.ARR_DEP_CITY, ARR_TERMINAL = model.ARR_TERMINAL, CONNECTING_FLIGHT_NOTES = model.CONNECTING_FLIGHT_NOTES, }; context.LBC_FLIGHT_INFO.Add(_flightInfo); context.SaveChanges(); } }
/// <summary> /// Method to get all the stories for the admin where the status is Final! /// </summary> /// <returns></returns> public List <StoryModel> getAllStories() { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var lst = from sq in context.LBC_STORY where sq.STORY_STATUS == "FINAL" select new StoryModel { SEQ_ID = sq.SEQ_ID, STARS_ID = sq.STARS_ID, PA_CODE = sq.PA_CODE, STORY_TITLE = sq.STORY_TITLE, STORY_CONTENT = sq.STORY_CONTENT, STORY_RATING = sq.STORY_RATING, STORY_STATUS = sq.STORY_STATUS, STORY_CATEGORY = sq.STORY_CATEGORY, STORY_SUBCATEGORY = sq.STORY_SUBCATEGORY, IMG_1 = sq.IMG_1, IMG_2 = sq.IMG_2, IMG_3 = sq.IMG_3, CREATED_DATE = sq.CREATED_DATE, CREATED_BY = sq.CREATED_BY, UPDATED_BY = sq.UPDATED_BY, UPDATED_DATE = sq.UPDATED_DATE, SUBMISION_DATE = sq.SUBMISION_DATE }; return(lst.ToList <StoryModel>()); } }
/// <summary> /// Method to insert to the Profile recognition /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Save(ProfileRecognition model) { bool save = true; try { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { LBC_PROFILE_RECOGNITION _profileM = new LBC_PROFILE_RECOGNITION() { CREATED_DATE = model.CREATED_DATE, CREATED_BY = model.CREATED_BY, RECOGNITION_ID = model.RECOGNITION_ID, STARS_ID = model.STARS_ID, STATUS = model.STATUS }; context.LBC_PROFILE_RECOGNITION.Add(_profileM); context.SaveChanges(); } } catch (Exception ex) { throw ex; // save = false; } return(save); }
public List <ProfileModel> GetListProfileBy(string dlrRegion) { List <ProfileModel> lst = new List <ProfileModel>(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { if (string.IsNullOrEmpty(dlrRegion)) { var list = (from entity in context.LBC_PROFILE where entity.EMP_STATUS_CODE == "A" //where entity.DLR_REGION == dlrRegion || string.IsNullOrEmpty(entity.DLR_REGION) select entity).ToList(); foreach (LBC_PROFILE item in list) { lst.Add(MapModelFromLBC_Profile(item)); } } else { var list = (from entity in context.LBC_PROFILE where entity.DLR_REGION == dlrRegion && entity.EMP_STATUS_CODE == "A" select entity).ToList(); foreach (LBC_PROFILE item in list) { lst.Add(MapModelFromLBC_Profile(item)); } } } return(lst); }
public bool Update(ProfileRecognition model) { bool save = true; try { using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var _profile = (from p in context.LBC_PROFILE_RECOGNITION where p.STARS_ID == model.STARS_ID && p.RECOGNITION_ID == model.RECOGNITION_ID select p).FirstOrDefault(); _profile.STATUS = model.STATUS; // _profile.RECOGNITION_ID = model.RECOGNITION_ID; _profile.UPDATE_DATE = model.UPDATE_DATE; _profile.UPDATED_BY = model.UPDATED_BY; context.SaveChanges(); } } catch (Exception ex) { throw ex; // save = false; } return(save); }
public List <ProfileModel> GetListProfileByPaCode(string paCode) { List <ProfileModel> lst = new List <ProfileModel>(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { if (string.IsNullOrEmpty(paCode)) { var list = (from entity in context.LBC_PROFILE where entity.EMP_STATUS_CODE == "A" select entity).ToList(); foreach (LBC_PROFILE item in list) { lst.Add(MapModelFromLBC_Profile(item)); } } else { var list = (from entity in context.LBC_PROFILE where entity.PA_CODE == paCode && entity.EMP_STATUS_CODE == "A" select entity).ToList(); foreach (LBC_PROFILE item in list) { lst.Add(MapModelFromLBC_Profile(item)); } } } return(lst); }
public List <ProfileRecognitionMasterModel> GetAll() { List <ProfileRecognitionMasterModel> list = new List <ProfileRecognitionMasterModel>(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var lst = (from entity in context.LBC_PROFILE_RECOGNITION_MASTER select entity).ToList(); foreach (LBC_PROFILE_RECOGNITION_MASTER item in lst) { list.Add(new ProfileRecognitionMasterModel() { CATEGORY = item.CATEGORY, CREATED_DATE = item.CREATED_DATE, CREATED_BY = item.CREATED_BY, RECOGNITION_DESC = item.RECOGNITION_DESC, RECOGNITION_ID = item.RECOGNITION_ID, RECOGNITION_TITLE = item.RECOGNITION_TITLE, UPDATE_DATE = item.UPDATE_DATE, UPDATED_BY = item.UPDATED_BY }); } } return(list); }
/// <summary> /// Method to get the Hotel Info based on Stars/Event /// </summary> /// <param name="StarsId"></param> /// <returns></returns> public HotelCarModel GetHotelInfoByStarsEvent(string StarsId, decimal EventId) { HotelCarModel model = new HotelCarModel(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var _registration = from pr in context.LBC_PROFILE join reg in context.LBC_REGISTRATION on pr.STARS_ID equals reg.STARS_ID from ht in context.LBC_HOTEL_CAR_INFO.Where(ht => ht.STARS_ID == pr.STARS_ID && ht.EVENT_ID == reg.EVENT_ID).DefaultIfEmpty() where pr.STARS_ID == StarsId && reg.EVENT_ID == EventId && reg.REGD_STATUS == "A" select new HotelCarModel { STARS_ID = pr.STARS_ID, PA_CODE = pr.PA_CODE, FIRST_NAME = pr.FIRST_NAME, LAST_NAME = pr.LAST_NAME, DEALERSHIP_NAME = pr.DLR_NAME, HOTEL_NAME = ht.HOTEL_NAME, HOTEL_CONF = ht.HOTEL_CONF, HOTEL_CHECK_IN = ht.HOTEL_CHECK_IN, HOTEL_CHECK_OUT = ht.HOTEL_CHECK_OUT, CAR_CONFIRM = ht.CAR_CONFIRM, CAR_NOTES = ht.CAR_NOTES, EVENT_ID = reg.EVENT_ID, ADMIN_NOTES = ht.ADMIN_NOTES }; model = _registration.SingleOrDefault(); } return(model); }
public EventModel GetEventModelByID(decimal EventId) { EventModel model = new EventModel(); using (LBCData context = new LBCData(ConnectionHelper.getConnectionString())) { var lst = from ev in context.LBC_EVENT where ev.EVENT_ID == EventId select new EventModel { EVENT_YEAR = ev.EVENT_YEAR, EVENT_MONTH = ev.EVENT_MONTH, EVENT_START_DATE = ev.EVENT_START_DATE, EVENT_END_DATE = ev.EVENT_END_DATE, EVENT_ID = ev.EVENT_ID, EVENT_TIME = ev.EVENT_TIME, EVENT_SESSION = ev.EVENT_SESSION, EVENT_LOCATION = ev.EVENT_LOCATION, OPEN_LIMIT = ev.OPEN_LIMIT, CURRENT_COUNT = ev.CURRENT_COUNT }; model = lst.SingleOrDefault(); } return(model); }