Ejemplo n.º 1
0
        public void register()
        {
            this.Registered = false;
            WebRecruiterController webCtrl = new WebRecruiterController();


            string OUTPUTRESPONSE;

            Int32  x_user_id;
            Int32  x_cust_id;
            Int32  x_user_type;
            String x_outputMsg;

            // Int32 UserType;


            //bool userTypeWasParsed;
            //try
            //{
            //    userTypeWasParsed = Int32.TryParse(jUser.Type, out UserType);

            //}
            //catch (Exception ex)
            //{
            //    x_outputMsg = "Problem parsing userTYPE(INT); " + ex.Message.ToString();
            //}


            OUTPUTRESPONSE = webCtrl.webRegister(jUser.Username, jUser.Email, jUser.Password, jUser.Type, out x_user_id, out x_cust_id, out x_user_type, out x_outputMsg);



            if (OUTPUTRESPONSE.Contains("ok"))
            {
                HttpContext.Current.Session["x_user_id"] = x_user_id;
                //HttpContext.Current.Session["x_cust_id"] = x_cust_id;
                HttpContext.Current.Session["x_user_type"]  = x_user_type;
                HttpContext.Current.Session["x_output_msg"] = x_outputMsg;

                this.Registered = true;
            }

            jUserRegistered jUserReged = new jUserRegistered();

            //jUserAuthed.CustID = x_cust_id.ToString();
            jUserReged.ID        = x_user_id.ToString();
            jUserReged.UserType  = x_user_type.ToString();
            jUserReged.OutputMsg = x_outputMsg;

            jUser.Data = JsonConvert.SerializeObject(jUserReged);
        }