public ActionResult Travel(string starsid = "")
        {
            ViewBag.homeid = "home";
            FlightInfoModel model     = new FlightInfoModel();
            FlightInfoBL    _flightBl = new FlightInfoBL();
            RegistrationBL  _regBl    = new RegistrationBL();

            if (Session["StarsIdProfile"] != null)
            {
                var _id = Session["StarsIdProfile"].ToString();

                if (_regBl.CheckRegistrationBy(_id) == true)
                {
                    decimal?eventid = _flightBl.GetEventIdByStarsId(_id);
                    model = _flightBl.GetFlightInfoByStarsId(_id, eventid);
                    // model.EVENT_ID =  _flightBl.GetEventIdByStarsId(_id);
                    // eventid; // Run a Query against Registration table to get only event id by Stars ID
                    if (model == null)
                    {
                        return(View(model));
                    }

                    return(View(model));
                }
                else
                {
                    return(RedirectToAction("Index", "Registration"));
                }
            }
            else
            {
                return(RedirectToAction("Welcome", "LBC"));
            }
        }
        public ActionResult Register(RegistrationModel Model)
        {
            ProfileModel _prModel = new ProfileModel();

            _prModel.STARS_ID            = Model.STARS_ID;
            _prModel.PA_CODE             = Model.PA_CODE;
            _prModel.DLR_NAME            = Model.DLR_NAME;
            _prModel.FIRST_NAME          = Model.FIRST_NAME;
            _prModel.LAST_NAME           = Model.LAST_NAME;
            _prModel.BADGE_NAME          = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.BADGE_NAME.ToLower());
            _prModel.TITLE               = Model.TITLE;
            _prModel.EMAIL_ID            = Model.EMAIL_ID;
            _prModel.DLR_ADDRESS         = Model.DLR_ADDRESS;
            _prModel.DLR_CITY            = Model.DLR_CITY;
            _prModel.DLR_STATE           = Model.DLR_STATE;
            _prModel.DLR_ZIP             = Model.DLR_ZIP;
            _prModel.PROFILE_NOTE        = Model.PROFILE_NOTE;
            _prModel.PROFILE_TYPE        = Model.PROFILE_TYPE;
            _prModel.DIETARY_RESTRICTION = Model.DIETARY_RESTRICTION;
            _prModel.DLR_PHONE           = Model.phone1 + Model.phone2 + Model.phone3;
            _prModel.PHONE               = Model.mobile1 + Model.mobile2 + Model.mobile3;
            _prModel.BIOGRAPHY           = Model.BIOGRAPHY;
            _prModel.DEPARTMENT          = Model.DEPARTMENT;
            _prModel.SHIRT_SIZE          = Model.SHIRT_SIZE;
            _prModel.WSLX_ID             = Model.WSLX_ID;
            _prModel.UPDATED_BY          = System.Web.HttpContext.Current.Session["w_user"].ToString();
            ProfileBL  profile = new ProfileBL();
            EventBL    evBL    = new EventBL();
            EventModel evmodel = new EventModel();

            profile.UpdateProfileByStarsId(_prModel);
            evmodel            = evBL.GetEventModelByID(Model.EVENT_ID);
            Model.WSLX_ID      = String.IsNullOrWhiteSpace(Model.WSLX_ID) ? System.Web.HttpContext.Current.Session["w_user"].ToString() : Model.WSLX_ID;//removed the Session. it has to be the user that is Log
            Model.CREATED_DATE = DateTime.Now;
            Model.CREATED_BY   = System.Web.HttpContext.Current.Session["w_user"].ToString();


            RegistrationBL _regBl = new RegistrationBL();

            if (_regBl.CheckRegistrationBy(Model.STARS_ID))
            {
                Model.REGD_STATUS  = "A";
                Model.UPDATE_DATE  = DateTime.Now;
                Model.UPDATED_BY   = System.Web.HttpContext.Current.Session["w_user"].ToString();
                ViewBag.registered = 1;
                _regBl.UpdateRegistraion(Model);
            }
            else
            {
                ViewBag.registered = 1;
                _regBl.SaveRegistration(Model);
                evBL.UpdateEventCount(evmodel);

                EmailHelper.SendConfEMail(Model.EMAIL_ID);
            }



            return(RedirectToAction("Confirmation"));
        }
Example #3
0
        public ActionResult Survey()
        {
            ViewBag.homeid = "survey";
            if (Convert.ToInt32(Session["ROLE_ID"]) == 1)
            {
                if (Session["StarsIdProfile"] != null)
                {
                    var            starsId  = Session["StarsIdProfile"].ToString();
                    string         pacode   = Session["w_pacode"].ToString();
                    decimal        surveyId = 1;
                    SurveyBL       _surBL   = new SurveyBL();
                    RegistrationBL _regBL   = new RegistrationBL();

                    if (_surBL.CheckSurveyTakenBy(pacode, surveyId))
                    {
                        return(RedirectToAction("Completed", "Resources"));
                    }
                    else if (_regBL.CheckRegistrationBy(starsId))
                    {
                        SurveyModel model = new SurveyModel();
                        model.STARS_ID                 = pacode;
                        model.surveyMasterList         = _surBL.getSurveyMaster(surveyId);
                        model.surveyQuestionList       = _surBL.getQuestions(surveyId);
                        model.surveyQuestionAnswerList = _surBL.getAnswers(surveyId);
                        return(View(model));
                    }
                    else
                    {
                        return(RedirectToAction("Register", "Resources"));
                    }
                }
                else
                {
                    return(RedirectToAction("Welcome", "LBC"));
                }
            }
            else
            {
                return(RedirectToAction("Welcome", "LBC"));
            }
        }