示例#1
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("操作失败!");
                }
            }
        }
示例#2
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());
                }
            }
        }