private ULCode.KeyXmlString getnew(ULCode.KeyXmlString kxs10) { string[] items = System.Configuration.ConfigurationManager.AppSettings[Request["appid"]].ToString().Split('|'); ULCode.KeyXmlString kxsnew = new ULCode.KeyXmlString(); int n = 0; foreach (String s in kxs10.GetItemValues("Node")) { ULCode.KeyXmlString kxs9 = new ULCode.KeyXmlString(); //kxs9.LoadData(s); for (int i = 0; i < items.Length; i++) { string[] item_2 = items[i].Split(';'); string uiname = ""; if (item_2[0].IndexOf("{") > -1) { uiname = item_2[0].Substring(0, item_2[0].IndexOf("{")); } else { uiname = item_2[0]; } kxs9.SetItemValue(uiname, Request["ui_" + uiname + n]); } kxsnew.AddItem("Node", kxs9.GetSavedData()); n++; } return(kxsnew); }
public string getxmlString(string appkey, string xmlstring, string xmlname) { string[] items = System.Configuration.ConfigurationManager.AppSettings[appkey].ToString().Split('|'); string pagestr = "<tr style='font-weight:bold; height:28px;'>"; if (xmlname != "") { pagestr += "<td rowspan='50' width='80'>" + xmlname + "</td>"; } for (int i = 0; i < items.Length; i++) { string[] item_2 = items[i].Split(';'); if (item_2[0].IndexOf("{") > -1) { pagestr += "<td>" + item_2[0].Substring(0, item_2[0].IndexOf("{")) + "</td>"; } else { pagestr += "<td>" + item_2[0] + "</td>"; } } pagestr += "</tr>"; //装载 ULCode.KeyXmlString kxs10 = new ULCode.KeyXmlString(); if (xmlstring.IndexOf("<KeyXmlString>") > -1) { kxs10.LoadData(xmlstring.Replace(" ", "")); } int n = 0; foreach (String s in kxs10.GetItemValues("Node")) { pagestr += "<tr height='24'>"; ULCode.KeyXmlString kxs9 = new ULCode.KeyXmlString(); kxs9.LoadData(s); for (int i = 0; i < items.Length; i++) { string[] item_2 = items[i].Split(';'); if (item_2[0].IndexOf("{") > -1) { pagestr += "<td>" + kxs9.GetItemValue(item_2[0].Substring(0, item_2[0].IndexOf("{"))) + "</td>"; } else { pagestr += "<td>" + kxs9.GetItemValue(item_2[0]) + "</td>"; } } pagestr += "</tr>"; n++; } return("<table class=\"table3\" style='text-align:center;'>" + pagestr + "</table>"); }
protected void Button1_Click(object sender, EventArgs e) { /* * string sSql = "select Name from te_companys where ID=11"; * DbResult dr = ULCode.QDA.XSql.GetData_R(null, sSql); * if (dr.OK) * { * Response.Write(dr.ToDbValue().ToStr()); * }*/ ULCode.KeyXmlString kxs0 = new ULCode.KeyXmlString(); ULCode.KeyXmlString kxs = new ULCode.KeyXmlString(); kxs.SetItemValue("姓名", "孙战平"); kxs.SetItemValue("性别", "男"); kxs.SetItemValue("政治面貌", "无"); kxs0.AddItem("Node", kxs.GetSavedData()); ULCode.KeyXmlString kxs1 = new ULCode.KeyXmlString(); kxs1.SetItemValue("姓名", "孙战平1"); kxs1.SetItemValue("性别", "男1"); kxs1.SetItemValue("政治面貌", "无1"); kxs0.AddItem("Node", kxs1.GetSavedData()); Response.Write(kxs0.GetSavedData()); ULCode.KeyXmlString kxs10 = new ULCode.KeyXmlString(); kxs10.LoadData(kxs0.GetSavedData()); foreach (String s in kxs10.GetItemValues("Node")) { ULCode.KeyXmlString kxs9 = new ULCode.KeyXmlString(); kxs9.LoadData(s); Response.Write(String.Format("<hr/>姓名:{0} 性别:{1} 政治面貌:{2}" , kxs9.GetItemValue("姓名") , kxs9.GetItemValue("性别") , kxs9.GetItemValue("政治面貌"))); } }
private void Delete() { string[] items = System.Configuration.ConfigurationManager.AppSettings[Request["appid"]].ToString().Split('|'); ULCode.KeyXmlString kxs10 = new ULCode.KeyXmlString(); int iR = 0; if (Request["table"] == "TU_Employees") { string userId = Request["keyvalue"]; Employee.MODEL employee = Employee.GetModel("SELECT * FROM TU_Employees WHERE UserID='" + userId + "'"); try { kxs10.LoadData(employee.DFields[Request["column"]].ToString()); } catch { } ULCode.KeyXmlString kxsnew = new ULCode.KeyXmlString(); int n = 0; foreach (String s in kxs10.GetItemValues("Node")) { if (Request["bu_submitdel" + n] == null) { ULCode.KeyXmlString kxs9 = new ULCode.KeyXmlString(); //kxs9.LoadData(s); for (int i = 0; i < items.Length; i++) { string[] item_2 = items[i].Split(';'); string uiname = ""; if (item_2[0].IndexOf("{") > -1) { uiname = item_2[0].Substring(0, item_2[0].IndexOf("{")); } else { uiname = item_2[0]; } kxs9.SetItemValue(uiname, Request["ui_" + uiname + n]); } kxsnew.AddItem("Node", kxs9.GetSavedData()); } n++; } employee.DFields[Request["column"]].value = kxsnew.GetSavedData(); iR = employee.Update(); } //5.(用户及业务对象)统计与状态 //7.返回处理结果或返回其它页面。 string pagename = ""; string nexturl = ""; switch (Request["column"]) { case "Education": pagename = "员工教育经历"; nexturl = "User_UserList.aspx?CompanyID=11"; break; case "Skill": pagename = "员工个人技能"; nexturl = "User_UserList.aspx?CompanyID=11"; break; case "Family": pagename = "员工家庭成员"; nexturl = "User_UserList.aspx?CompanyID=11"; break; case "Work": pagename = "员工工作经历"; nexturl = "User_UserList.aspx?CompanyID=11"; break; case "UrgentLink": pagename = "员工紧急联络人"; nexturl = "User_UserList.aspx?CompanyID=11"; break; default: break; } if (iR > 0) {//6.登记日志 WX.Main.AddLog(WX.LogType.Default, pagename + "删除成功!", ""); ULCode.Debug.Alert(this, pagename + "删除成功!"); } else { ULCode.Debug.Alert(Page, pagename + "删除失败!"); } }
private void PageInit() { string[] items = System.Configuration.ConfigurationManager.AppSettings[Request["appid"]].ToString().Split('|'); pagetitle = "<tr>"; if (!rReadOnly) { pagestr += "<tr>"; } for (int i = 0; i < items.Length; i++) { string[] item_2 = items[i].Split(';'); if (item_2[0].IndexOf("{") > -1) { pagetitle += "<td width='" + item_2[1] + "'>" + item_2[0].Substring(0, item_2[0].IndexOf("{")) + "</td>"; if (!rReadOnly) { string[] item_2_1 = item_2[0].Substring(item_2[0].IndexOf("{") + 1).Replace("}", "").Split(','); pagestr += "<td width='" + item_2[1] + "'><select name='ui_" + item_2[0].Substring(0, item_2[0].IndexOf("{")) + "' style='width:99%;'>"; for (int j = 0; j < item_2_1.Length; j++) { pagestr += "<option value='" + item_2_1[j] + "'>" + item_2_1[j] + "</option>"; } pagestr += "</select></td>"; } } else { pagetitle += "<td width='" + item_2[1] + "'>" + item_2[0] + "</td>"; if (!rReadOnly) { pagestr += "<td width='" + item_2[1] + "'><input type='text' style='width:99%;' name='ui_" + item_2[0] + "'></td>"; } } } if (!rReadOnly) { pagetitle += "<td style='width:90px;'>操作</td></tr>"; pagestr += "<td><input type='submit' value='添加' name='bu_submit' class='button'></td></tr>"; } //装载 ULCode.KeyXmlString kxs10 = new ULCode.KeyXmlString(); if (Request["table"] == "TU_Employees") { string userId = Request["keyvalue"]; Employee.MODEL employee = Employee.GetModel("SELECT * FROM TU_Employees WHERE UserID='" + userId + "'"); if (employee.DFields[Request["column"]].ToString().IndexOf("<KeyXmlString>") > -1) { kxs10.LoadData(employee.DFields[Request["column"]].ToString().Replace(" ", "")); } } int n = 0; foreach (String s in kxs10.GetItemValues("Node")) { pagestr += "<tr>"; ULCode.KeyXmlString kxs9 = new ULCode.KeyXmlString(); kxs9.LoadData(s); for (int i = 0; i < items.Length; i++) { string[] item_2 = items[i].Split(';'); if (item_2[0].IndexOf("{") > -1) { pagestr += "<td width='" + item_2[1] + "'><select name='ui_" + item_2[0].Substring(0, item_2[0].IndexOf("{")) + n + "' " + (rReadOnly ? "disabled='disabled'" : "") + " style='width:99%;' >"; string[] item_2_1 = item_2[0].Substring(item_2[0].IndexOf("{") + 1).Replace("}", "").Split(','); for (int j = 0; j < item_2_1.Length; j++) { pagestr += "<option value='" + item_2_1[j] + "' " + (kxs9.GetItemValue(item_2[0].Substring(0, item_2[0].IndexOf("{"))) == item_2_1[j] ? "selected" : "") + ">" + item_2_1[j] + "</option>"; } pagestr += "</select></td>"; } else { pagestr += "<td width='" + item_2[1] + "'><input type='text' style='width:99%;' name='ui_" + item_2[0] + n + "' " + (rReadOnly?"disabled='disabled'":"") + " value='" + kxs9.GetItemValue(item_2[0]) + "'></td>"; } } if (!rReadOnly) { pagestr += "<td><input type='submit' value='修改' name='bu_submiteidt' class='button'> <input type='submit' value='删除' name='bu_submitdel" + n + "' class='button'></td>"; } pagestr += "</tr>"; n++; } }