//코드콤보 public string combocode(string param) { if (HttpContext.Current.Request.GetUserCookie("userid") == "") { return(""); } //gbncd string gbncd = JObject.Parse(param)["gbncd"].ToString(); FormManager fm = new FormManager(); XmlDocument dom = new XmlDocument(); dom.LoadXml("<xml><proc/><act/><xmldata></xmldata><xmlclipdata/></xml>"); dom.SelectSingleNode("//act").InnerText = "proc"; XmlNode node; node = dom.CreateNode(XmlNodeType.Element, "zrow", ""); fm.icnitMakeNode(dom, node, "varchar", "gbncd", gbncd, "100"); dom.SelectSingleNode("//xmldata").AppendChild(node); string query = @"COMBO_CODE_SEARCH"; dom.SelectSingleNode("//proc").InnerText = query; DataTable dt = CallDB.getExecuteDataTable(dom); return(dt.ToJson()); }
public string search_item_sale(string param) { if (HttpContext.Current.Request.GetUserCookie("userid") == "") { return(""); } string itemnm = JObject.Parse(param)["searchword"].ToString(); string csaleno = JObject.Parse(param)["csaleno"].ToString(); FormManager fm = new FormManager(); XmlDocument dom = new XmlDocument(); dom.LoadXml("<xml><proc/><act/><xmldata></xmldata><xmlclipdata/></xml>"); dom.SelectSingleNode("//act").InnerText = "proc"; XmlNode node; node = dom.CreateNode(XmlNodeType.Element, "zrow", ""); fm.icnitMakeNode(dom, node, "varchar", "itemnm", itemnm, "500"); fm.icnitMakeNode(dom, node, "varchar", "csaleno", csaleno, "500"); dom.SelectSingleNode("//xmldata").AppendChild(node); string query = @"POP_ITEM_SALE_SEARCH"; dom.SelectSingleNode("//proc").InnerText = query; DataTable dt = CallDB.getExecuteDataTable(dom); return(dt.ToJson()); }
protected void Page_Load(object sender, EventArgs e) { string json; using (var reader = new StreamReader(Request.InputStream)){ json = reader.ReadToEnd(); } var param = JsonConvert.SerializeObject(json); string userid = JObject.Parse(param)["userid"].ToString(); string pwd = JObject.Parse(param)["pwd"].ToString(); FormManager fm = new FormManager(); XmlDocument dom = new XmlDocument(); dom.LoadXml("<xml><proc/><act/><xmldata></xmldata><xmlclipdata/></xml>"); dom.SelectSingleNode("//act").InnerText = "proc"; XmlNode node; node = dom.CreateNode(XmlNodeType.Element, "zrow", ""); fm.icnitMakeNode(dom, node, "varchar", "userid", userid, "20"); fm.icnitMakeNode(dom, node, "varchar", "pwd", pwd, "50"); dom.SelectSingleNode("//xmldata").AppendChild(node); string query = @"SYS_LOGIN"; dom.SelectSingleNode("//proc").InnerText = query; DataTable dt = CallDB.getExecuteDataTable(dom); result result = new result(); if (dt != null && dt.Rows.Count == 1) { //======================================Cookie User HttpCookie myCookie = new HttpCookie("user"); myCookie["userid"] = dt.Rows[0]["userid"].ToString(); myCookie["usernm"] = dt.Rows[0]["usernm"].ToString(); myCookie.Expires = DateTime.Now.AddHours(2d); Response.Cookies.Add(myCookie); result.code = "OK"; result.msg = ""; result.val = ""; } else { result.code = "NO"; result.msg = ""; result.val = ""; } Response.Write(JsonConvert.SerializeObject(result)); }
//코드콤보 public string login(string param) { //gbncd string userid = JObject.Parse(param)["userid"].ToString(); string pwd = JObject.Parse(param)["pwd"].ToString(); FormManager fm = new FormManager(); XmlDocument dom = new XmlDocument(); dom.LoadXml("<xml><proc/><act/><xmldata></xmldata><xmlclipdata/></xml>"); dom.SelectSingleNode("//act").InnerText = "proc"; XmlNode node; node = dom.CreateNode(XmlNodeType.Element, "zrow", ""); fm.icnitMakeNode(dom, node, "varchar", "userid", userid, "20"); fm.icnitMakeNode(dom, node, "varchar", "pwd", pwd, "50"); dom.SelectSingleNode("//xmldata").AppendChild(node); string query = @"SYS_LOGIN"; dom.SelectSingleNode("//proc").InnerText = query; DataTable dt = CallDB.getExecuteDataTable(dom); result result = new result(); if (dt != null && dt.Rows.Count == 1) { //======================================Cookie User HttpCookie myCookie = new HttpCookie("user"); myCookie["userid"] = dt.Rows[0]["userid"].ToString(); myCookie["usernm"] = HttpUtility.UrlEncode(dt.Rows[0]["usernm"].ToString()); myCookie.Expires = DateTime.Now.AddYears(1); System.Web.HttpContext.Current.Response.Cookies.Add(myCookie); result.code = "OK"; result.msg = ""; result.val = ""; } else { result.code = "NO"; result.msg = ""; result.val = ""; } return(JsonConvert.SerializeObject(result)); }
public string combogbncd() { if (HttpContext.Current.Request.GetUserCookie("userid") == "") { return(""); } FormManager fm = new FormManager(); XmlDocument dom = new XmlDocument(); dom.LoadXml("<xml><proc/><act/><xmldata></xmldata><xmlclipdata/></xml>"); dom.SelectSingleNode("//act").InnerText = "proc"; XmlNode node; node = dom.CreateNode(XmlNodeType.Element, "zrow", ""); dom.SelectSingleNode("//xmldata").AppendChild(node); string query = @"COMBO_GBNCD_SEARCH"; dom.SelectSingleNode("//proc").InnerText = query; DataTable dt = CallDB.getExecuteDataTable(dom); return(dt.ToJson()); }