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"));
        }
        public ActionResult ResumeRegistration(FormCollection frm)
        {
            RegistrationBL    _regBl = new RegistrationBL();
            RegistrationModel Model  = new RegistrationModel();

            Model.REGD_STATUS         = "A";
            Model.STARS_ID            = frm["STARS_ID"];
            Model.EVENT_ID            = Convert.ToDecimal(frm["EVENT_ID"]);
            Model.TRANSPORTATION_MODE = frm["TRANSPORTATION_MODE"];
            Model.FIRST_NAME          = frm["FIRST_NAME"];
            Model.LAST_NAME           = frm["LAST_NAME"];
            Model.DLR_NAME            = frm["DLR_NAME"];
            Model.EMAIL_ID            = frm["EMAIL_ID"];
            Model.PHONE               = frm["PHONE"];
            Model.PA_CODE             = frm["PA_CODE"];
            Model.UPDATE_DATE         = DateTime.Now;
            Model.TRANSPORTATION_NEED = frm["TRANSPORTATION_NEED"];
            Model.NOTES               = frm["NOTES"];
            Model.ADMIN_NOTES         = frm["ADMIN_NOTES"];
            string eventname = "";

            Model.UPDATED_BY = System.Web.HttpContext.Current.Session["w_user"].ToString();
            bool flag = _regBl.UpdateRegistraion(Model);

            if (flag)
            {
                EventBL    evBL    = new EventBL();
                EventModel evmodel = new EventModel();

                evmodel = evBL.GetEventModelByID(Model.EVENT_ID);
                evBL.UpdateEventCount(evmodel);
                eventname = evmodel.EVENT_SESSION;
            }
            EmailHelper.SendConfEMail(Model.EMAIL_ID);

            return(Json(new
            {
                redirectUrl = Url.Action("Index", "Registration"),
                isRedirect = true
            }));

            //return Json(new { error = 1 }, JsonRequestBehavior.AllowGet);// RedirectToAction("Index", "Registration");
        }