Beispiel #1
0
        protected void LoadData(string Id)
        {
            Model.tTask m = bll.GetModel(Convert.ToInt32(Id));
            if (m == null)
            {
                Alert.ShowInTop("出错了!"); return;
            }
            BindTree((int)m.SaveDpt);
            hfEditorInitValue2.Text   = m.TaskContent;
            txtTitle.Text             = m.Title;
            DateTimeTop.SelectedDate  = m.SaveTime;
            DateTimeLock.SelectedDate = m.LockTime;
            drpSearch.SelectedValue   = m.TaskLevel;

            if (m.IsCheck == "已审核")
            {
                btnSaveClose.Text    = "已审核";
                btnSaveClose.Enabled = false;
            }

            string[] dptlist = m.LookDptString.Split(',');
            foreach (string str in dptlist)
            {
                TreeDpt.FindNode(str).Checked = true;
            }
        }
        protected void GridDpt_RowCommand(object sender, GridCommandEventArgs e)
        {
            int deptID = GetSelectedDataKeyID(GridDpt);


            if (e.CommandName == "Delete")
            {
                if (TreeDpt.FindNode(deptID.ToString()).Nodes.Count > 0)
                {
                    Alert.ShowInTop("请先删除该指标下子部门!");
                    return;
                }

                BLL.t_Index BLL = new Maticsoft.BLL.t_Index();


                if (BLL.GetModel(deptID).FatherId == null)
                {
                    Alert.ShowInTop("根目录无法删除!");
                    return;
                }


                bool isTrue = BLL.Delete(deptID);


                if (!isTrue)
                {
                    Alert.ShowInTop("删除失败!");
                    return;
                }
                else
                {
                    BindTree();
                    LoadData();
                }
            }
            if (e.CommandName == "Edit")
            {
                Window1.Title = "指标管理";
                string openUrl = String.Format("./IndexEdit.aspx?dptId={0}", HttpUtility.UrlEncode(deptID.ToString()));
                PageContext.RegisterStartupScript(Window1.GetSaveStateReference(deptID.ToString()) + Window1.GetShowReference(openUrl));
            }
        }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         btnClose.OnClientClick = ActiveWindow.GetHideReference();
         BindTree();
         if (!string.IsNullOrEmpty(Request.QueryString["rCode"]))
         {
             string rCode = Request.QueryString["rCode"];
             Maticsoft.BLL.tRoleMenu          BLLtt = new Maticsoft.BLL.tRoleMenu();
             List <Maticsoft.Model.tRoleMenu> list  = BLLtt.GetModelList(string.Format(" rCode={0}", rCode));
             string[] strR = new string[list.Count];
             for (int i = 0; i < list.Count; i++)
             {
                 TreeDpt.FindNode(list[i].mCode.ToString()).Checked = true;
             }
         }
     }
 }
        protected void GridDpt_RowCommand(object sender, GridCommandEventArgs e)
        {
            int deptID = GetSelectedDataKeyID(GridDpt);


            if (e.CommandName == "Delete")
            {
                if (TreeDpt.FindNode(deptID.ToString()).Nodes.Count > 0)
                {
                    Alert.ShowInTop("请先删除该部门下子部门!");
                    return;
                }
                BLL.tUsers uBLL = new BLL.tUsers();
                if (uBLL.GetModelList(string.Format(" roleCode=10 and dptId={0}", deptID.ToString())).Count > 0)
                {
                    Alert.ShowInTop("超级用户所在部门无法删除!");
                    return;
                }

                BLL.tDepartMent BLL = new Maticsoft.BLL.tDepartMent();

                bool isTrue = BLL.Delete(deptID);


                if (!isTrue)
                {
                    Alert.ShowInTop("删除失败!");
                    return;
                }
                else
                {
                    BindTree();
                    LoadData();
                }
            }
            if (e.CommandName == "Edit")
            {
                Window1.Title = "部门管理";
                string openUrl = String.Format("./DptMentEdit.aspx?dptId={0}", HttpUtility.UrlEncode(deptID.ToString()));
                PageContext.RegisterStartupScript(Window1.GetSaveStateReference(deptID.ToString()) + Window1.GetShowReference(openUrl));
            }
        }
Beispiel #5
0
        protected void TreeDpt_NodeCheck(object sender, TreeCheckEventArgs e)
        {
            if (e.Checked)
            {
                TreeDpt.CheckAllNodes(e.Node.Nodes);
                if (TreeDpt.FindNode(e.NodeID).ParentNode == null)
                {
                    return;
                }

                if (TreeDpt.FindNode(e.NodeID).ParentNode.Checked == false)
                {
                    TreeDpt.FindNode(e.NodeID).ParentNode.Checked = true;
                }
            }
            else
            {
                TreeDpt.UncheckAllNodes(e.Node.Nodes);
            }
        }