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


            string OUTPUTRESPONSE;

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


            OUTPUTRESPONSE = webCtrl.webLogon(jUser.Username, jUser.Password, 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.Authencated = true;
            }

            jUserAuthenticated jUserAuthed = new jUserAuthenticated();

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

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