protected void btSave_Click(object sender, EventArgs e) { Orgaization info = new Orgaization(); OrgaizationManageBLL bll = null; try { UIBindHelper.BindModelByControls(this.Page, info); bll = BLLFactory.CreateBLL <OrgaizationManageBLL>(); info.OrganParent = this.HiParentID.Value; if (this.hiID.Value == "") { bll.Insert(info); ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.addNode('" + info.OrganID + "','" + info.OrganDESC + "');parent.closeAppWindow1();", true); } else { info.CreateUser = this.HiCREATEUSER.Value; info.CreateTime = DateTime.Parse(this.HiCREATETIME.Value); info.OrganID = this.hiID.Value; info.OrganParent = this.HiParentID.Value; bll.Update(info); ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.editNode('" + info.OrganID + "','" + info.OrganDESC + "');parent.closeAppWindow1();", true); } } catch (Exception ex) { throw ex; } }
private void BindData() { string id = Request.QueryString["id"]; OrgaizationManageBLL bll = null; Orgaization info = new Orgaization(); try { bll = BLLFactory.CreateBLL <OrgaizationManageBLL>(); if (string.IsNullOrEmpty(id) == false) { info.OrganID = id; info = bll.Get(info); UIBindHelper.BindForm(this.Page, info); this.hiID.Value = info.OrganID; this.HiCREATEUSER.Value = info.CreateUser; this.HiCREATETIME.Value = info.CreateTime.ToString(); this.HiParentID.Value = info.OrganParent; } else { this.HiParentID.Value = Request.QueryString["parentID"]; info = new Orgaization(); } } catch (Exception ex) { throw ex; } }
public void ProcessRequest(HttpContext context) { context.Response.ContentEncoding = Encoding.UTF8; context.Response.ContentType = "application/json"; string id = context.Request.QueryString["id"]; OrgaizationManageBLL bll = BLLFactory.CreateBLL <OrgaizationManageBLL>(); bll.Delete(new Orgaization { OrganID = id }); context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes("ok")); }
/// <summary> /// 获取位置信息树 /// </summary> /// <returns></returns> public string GetTreeNodes() { OrgaizationManageBLL bll = new OrgaizationManageBLL(); List <Orgaization> list = null; try { list = bll.GetAllList(); } catch (Exception ex) { throw ex; } List <TreeNodeResult> nodes = new List <TreeNodeResult>(); List <Orgaization> childList = null; try { TreeNodeResult rootNode = new TreeNodeResult(); rootNode.Tid = "root"; rootNode.Ttext = ConfigurationManager.AppSettings["rootOrgan"]; childList = list.Where(p => p.OrganParent == "root").ToList <Orgaization>(); foreach (Orgaization info in childList) { TreeNodeResult node = new TreeNodeResult(); node.Tid = info.OrganID; node.Ttext = info.OrganDESC; //添加子机构 this.BuildChildItems(node, list); rootNode.AddchildNode(node); } nodes.Add(rootNode); return(TreeNodeResult.GetResultJosnS(nodes.ToArray())); } catch (Exception ex) { throw ex; } }
private void BindData() { OrgaizationManageBLL bll = null; Orgaization condition = new Orgaization(); List <Orgaization> list = null; try { bll = BLLFactory.CreateBLL <OrgaizationManageBLL>(); list = bll.GetAllList(); this.hiOrganList.Value = this.GetTreeNodes(list); } catch (Exception ex) { throw ex; } }