Beispiel #1
0
        public void logon()
        {
            string message = "";

            try
            {
                string    record = this.Request["record"];
                Hashtable ht     = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                string msg = new logonBll().UserValidation(ht["urid"].ToString(), ht["pswd"].ToString(), ConfigReader.getAppName());

                if (msg.Substring(0, 7) == "success")
                {
                    tscuser user = JavaScriptConvert.DeserializeObject <tscuser>(msg.Substring(8, msg.Length - 8));
                    this.HttpContext.Session[Constant.SESSION_CURRENT_USER]  = user.urid;
                    this.HttpContext.Session[Constant.SESSION_CURRENT_STAFF] = user.sfid;//存放登录用户对应的Staff ID

                    message = "{status:'success',msg:'Verify success.'}";
                }
                else
                {
                    message = "{status:'failure',msg:'" + msg + "'}";
                }
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}";
            }

            Response.Write(message);
        }