Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("11111");
            OraDB DB = new OraDB();

            MessageBox.Show("22222");
            DB.Connect();
            MessageBox.Show("3333");
            List <String> data = null;
            string        sql  = "select * from tab";

            MessageBox.Show(sql);
            data = DB.GetQueryResults <string>(sql, delegate(OracleDataReader reader)
            {
                MessageBox.Show("---------");
                string val = reader[0].ToString();
                MessageBox.Show(val);
                System.Diagnostics.Debug.WriteLine(val);
                return(val);
            });

            MessageBox.Show("--2222-------");

            System.Diagnostics.Debug.WriteLine(data);

            MessageBox.Show("--3333-------");

            clsClassfication cls = new clsClassfication();

            MessageBox.Show("--4442-------");

            cls.load("1");
            cls.CATE_NAME = "AAAAAAAAAAAA";
            MessageBox.Show("--5552-------");
            cls.update("2222");
            List <clsClassfication> lst = clsClassfication.getList("11", "", false);

            //cls.insert("22", "2");
            MessageBox.Show("--2666-------");
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string url           = @"http://autoever.hyundai.net/Webservices/SSO/SitemapWS.asmx";
            string enccode       = Request.Params["Encode"];
            string companycode   = Request.Params["CompanyCode"];
            string strHKMCENC_ID = "RIDS";
            string param         = "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Body><GetPlainText xmlns=\"http://tempuri.org/\">"
                                   + "<strEncID>" + strHKMCENC_ID + "</strEncID>"
                                   + "<strCompanyCode>" + companycode + "</strCompanyCode>"
                                   + "<strEncText>" + enccode + "</strEncText>"
                                   + "</GetPlainText></soap:Body></soap:Envelope>";

            System.Diagnostics.Debug.WriteLine("----------22");

            ServerXMLHTTP srv = new ServerXMLHTTP();

            srv.open("POST", url, false, null, null);
            srv.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
            srv.setRequestHeader("SOAPAction", "http://tempuri.org/GetPlainText");

            srv.send(param);
            Response.Clear();
            string __res__ = srv.responseText;


            bool isLogin = false;

            try{
                int val1 = __res__.IndexOf("<GetPlainTextResult>");
                int val2 = __res__.IndexOf("</GetPlainTextResult>");

                if (val1 <= 0 || val2 <= 0)
                {
                    return;
                }
                string result = __res__.Substring(val1, (val2 - val1));

                string[] token = System.Text.RegularExpressions.Regex.Split(result, "___");

                for (int i = 0; i < token.Length; i++)
                {
                    string[] value = System.Text.RegularExpressions.Regex.Split(token[i], "\\|\\|");

                    Session[value[0]] = value[1];

                    if ("User_ID".EndsWith(value[0]))
                    {
                        //Session["USERID"] = value[1];

                        string user = value[1];
                        // 그리고 사번..
                        OraDB DB = new OraDB();
                        DB.Connect();
                        try
                        {
                            string user_name = "";
                            string dept_code = "";
                            string login_sql = "select * from tb_person where user_id = '" + user + "'";
                            string object_id = DB.GetQueryResult <string>(login_sql, delegate(OracleDataReader reader)
                            {
                                string val = reader[0].ToString();
                                user_name  = reader[1].ToString();
                                dept_code  = reader[3].ToString();
                                return(val);
                            });

                            if (object_id == null || "".Equals(object_id))
                            {
                                isLogin = false;
                            }
                            else
                            {
                                Session["USERID"]   = object_id;
                                Session["USERNAME"] = user_name;
                                Session["DEPTCODE"] = dept_code;
                                isLogin             = true;
                            }

                            DB.Close();
                        }
                        catch (Exception eee)
                        {
                            System.Diagnostics.Debug.WriteLine(eee.Message);
                            isLogin = false;
                        }
                        finally
                        {
                            DB.Close();
                        }
                    }

                    /*
                     * if ("Dept_Code".EndsWith(value[0]))
                     * {
                     *  Session["DEPTCODE"] = value[1];
                     * }
                     *
                     * if ("User_Name".EndsWith(value[0]))
                     * {
                     *  Session["USERNAME"] = value[1];
                     * } */
                }
            }catch (Exception ex) {
                Response.Write(ex.Message);
            }

            if (isLogin == false)
            {
                Response.Clear();
                string res = "<script>alert('Access Dinied....');</script>";
                Response.Write(res);

                return;
            }

            Response.Clear();
            string res1 = "<script>this.location.href='/extjs/top.html';</script>";

            Response.Write(res1);
            return;
        }