Пример #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;
            }
        }
Пример #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["rCode"]))
            {
                string rCode = Request.QueryString["rCode"];
                Maticsoft.BLL.tRoleMenu BLLtt = new Maticsoft.BLL.tRoleMenu();
                BLLtt.Delete(int.Parse(rCode));
                FineUIPro.TreeNode[] nodes = TreeDpt.GetCheckedNodes();


                if (nodes.Length > 0)
                {
                    Maticsoft.Model.tRoleMenu m   = new Maticsoft.Model.tRoleMenu();
                    Maticsoft.BLL.tRoleMenu   BLL = new Maticsoft.BLL.tRoleMenu();

                    foreach (FineUIPro.TreeNode node in nodes)
                    {
                        m.rCode = int.Parse(rCode);
                        m.mCode = int.Parse(node.NodeID);
                        BLL.Add(m);
                    }
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }

                else
                {
                    Alert.ShowInTop("操作失败!");
                }
            }
        }
        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));
            }
        }
Пример #4
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));
            }
        }
Пример #6
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);
            }
        }
Пример #7
0
        protected void btnSaveClose_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.tTaskLook BLLtt = new Maticsoft.BLL.tTaskLook();

            FineUIPro.TreeNode[] nodes = TreeDpt.GetCheckedNodes();


            if (nodes.Length <= 0)
            {
                Alert.ShowInTop("请选择接收单位!");
                return;
            }
            string dptlist = "";

            foreach (FineUIPro.TreeNode node in nodes)
            {
                dptlist += node.NodeID.ToString() + ",";
            }
            dptlist = dptlist.Substring(0, dptlist.Length - 1);
            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
            {
                string      Id = Request.QueryString["Id"];
                Model.tTask m  = bll.GetModel(Convert.ToInt32(Id));
                if (m == null)
                {
                    return;
                }
                string content2 = Request.Form["editorNew2"] == null ? "" : Request.Form["editorNew2"];
                m.TaskContent = content2;
                m.Title       = txtTitle.Text;
                m.SaveTime    = DateTimeTop.SelectedDate;
                m.LockTime    = DateTimeLock.SelectedDate;
                m.TaskLevel   = drpSearch.SelectedValue;
                if (m.LookDptString == dptlist)
                {
                }
                else
                {
                    BLLtt.Delete(m.Id);
                    Maticsoft.Model.tTaskLook mlook = new Maticsoft.Model.tTaskLook();

                    foreach (FineUIPro.TreeNode node in nodes)
                    {
                        mlook.TaskId = m.Id;
                        mlook.DptId  = int.Parse(node.NodeID);
                        BLLtt.Add(mlook);
                    }

                    m.LookDptString = dptlist;
                }
                if (bll.Update(m) == true)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
                else
                {
                    Alert.ShowInTop("出错了!");
                }
            }
            else
            {
                Model.tTask m        = new Model.tTask();
                string      content2 = Request.Form["editorNew2"] == null ? "" : Request.Form["editorNew2"];
                m.TaskContent   = content2;
                m.Title         = txtTitle.Text;
                m.SaveTime      = DateTimeTop.SelectedDate;
                m.LockTime      = DateTimeLock.SelectedDate;
                m.TaskLevel     = drpSearch.SelectedValue;
                m.LookDptString = dptlist;
                m.IsCheck       = "待审核";
                m.SavaPeo       = GetIdentityUser().usersName;
                m.SaveDpt       = GetIdentityUser().dptId;
                int k = bll.Add(m);

                Maticsoft.Model.tTaskLook mlook = new Maticsoft.Model.tTaskLook();

                foreach (FineUIPro.TreeNode node in nodes)
                {
                    mlook.TaskId = k;
                    mlook.DptId  = int.Parse(node.NodeID);
                    BLLtt.Add(mlook);
                }

                if (k > 0)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
            }
        }