Esempio n. 1
0
        private string execute(usrmas p)
        {
            SqlDbAccess dbAccess = new SqlDbAccess(PKDBHelper.ConnectString);
            string jsonset = string.Empty;

            if (("{CHKUSR}{CHKAUTH}{SLT}").IndexOf("{" + p.rmode + "}") >= 0)
            {
                string query = @"MBL_USRMAS_M1";
                SqlParamCollection parameters = new SqlParamCollection();

                PKDBHelper.SqlAddParam(parameters, "@INFDS", SqlDbType.VarChar, 100, p.infds);
                PKDBHelper.SqlAddParam(parameters, "@RTNCD", SqlDbType.VarChar, 100, p.rtncd);
                PKDBHelper.SqlAddParam(parameters, "@RMODE", SqlDbType.VarChar, 20, p.rmode);
                PKDBHelper.SqlAddParam(parameters, "@USRID", SqlDbType.VarChar, 10, p.usrid);
                PKDBHelper.SqlAddParam(parameters, "@PASWD", SqlDbType.VarChar, 10, p.paswd);
                PKDBHelper.SqlAddParam(parameters, "@IPADR", SqlDbType.VarChar, 20, p.ipadr);
                PKDBHelper.SqlAddParam(parameters, "@FDATE", SqlDbType.Char, 8, p.fdate);
                PKDBHelper.SqlAddParam(parameters, "@TDATE", SqlDbType.Char, 8, p.tdate);
                PKDBHelper.SqlAddParam(parameters, "@SSNID", SqlDbType.VarChar, 50, p.ssnid);
                PKDBHelper.SqlAddParam(parameters, "@FRMNM", SqlDbType.VarChar, 100, p.frmnm);

                //PKDBHelper.SqlAddParam(parameters, "@DPTCD", SqlDbType.Char, 20, p.dptcd);
                //PKDBHelper.SqlAddParam(parameters, "@USEYN", SqlDbType.Char, 1, p.useyn);

                DataTable  dt = dbAccess.ExecuteSpDataSet(query, parameters).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    return JsonConvert.SerializeObject(dt, Formatting.Indented);

                    //if (dt.Rows[0]["RESULT"].ToString() == "OK")
                    //{
                    //    return "OK";
                    //}
                    //else
                    //{
                    //    if (dt.Rows[0]["MSGID"].ToString() == "ERR0008")
                    //    {
                    //        return "ERR_USER";
                    //        //PKMessageBox.ShowError("사용자가 등록되어 있지 않습니다!", DialogButtons.Ok, "로그인 에러");
                    //    }
                    //    else
                    //    {
                    //        return "ERR_PWD";
                    //        //PKMessageBox.ShowError("비밀번호를 다시 입력하세요!", DialogButtons.Ok, "로그인 에러");

                    //    }
                    //}
                }
                else
                {
                    return string.Empty;
                }
            }
            else
            {
                return string.Empty;
            }
        }
Esempio n. 2
0
        public string GetLoghistory(string fdate, string tdate)
        {
            usrmas user = new usrmas();
            user.fdate = fdate;
            user.tdate = tdate;
            user.rmode = "SLT";

            return execute(user);
        }
Esempio n. 3
0
        public string Login(string userid, string password)
        {
            usrmas user = new usrmas();
            user.usrid = userid;
            user.paswd = password;
            user.rmode = "CHKUSR";
            user.ipadr = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];//HttpContext.Current.Request.UserHostAddress;

            return execute(user);
        }
Esempio n. 4
0
        public string CheckAuth(string userid, string ssnid, string frmnm)
        {
            usrmas user = new usrmas();
            user.usrid = userid;
            user.ssnid = ssnid;
            user.frmnm = frmnm;
            user.rmode = "CHKAUTH";

            return execute(user);
        }