protected void LoadData(string Id)
        {
            Model.tTask m = bll.GetModel(Convert.ToInt32(Id));
            if (m == null)
            {
                Alert.ShowInTop("出错了!"); return;
            }
            List <Model.tTaskSave> userList = bllsave.GetModelList(string.Format(" TaskId={0} and SavaDpt={1} ", m.Id, GetIdentityUser().dptId));

            Model.tTaskSave msave = userList.Count == 0 ? null : userList[0];
            if (msave == null)
            {
                hfEditorInitValue2.Text = "";
            }
            else
            {
                hfEditorInitValue2.Text = msave.SaveContent;
            }


            txtTitle.Text             = m.Title;
            DateTimeTop.SelectedDate  = m.SaveTime;
            DateTimeLock.SelectedDate = m.LockTime;
            drpSearch.SelectedValue   = m.TaskLevel;
            taskCon = m.TaskContent;

            if (DateTime.Now > m.LockTime)
            {
                btnSaveClose.Text    = "已截止上报";
                btnSaveClose.Enabled = false;
            }
        }
Пример #2
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 LoadData(string Id)
        {
            Model.tTask m = bll.GetModel(Convert.ToInt32(Id));
            if (m == null)
            {
                Alert.ShowInTop("出错了!"); return;
            }

            BindTree((int)m.SaveDpt);
            LoadDataSave();
        }
Пример #4
0
        protected void btnLook_Click(object sender, EventArgs e)
        {
            int roleID = GetSelectedDataKeyID(GridDpt);

            if (roleID <= 0)
            {
                Alert.ShowInTop("请选择要查看的任务"); return;
            }

            BLL.tTask   bll = new BLL.tTask();
            Model.tTask m   = bll.GetModel(roleID);

            string openUrl = String.Format("./TaskEditLook.aspx?Id={0}", HttpUtility.UrlEncode(roleID.ToString()));

            PageContext.RegisterStartupScript(Window2.GetSaveStateReference(roleID.ToString()) + Window2.GetShowReference(openUrl, m.Title));
        }
        protected void btnSaveClose_Click(object sender, EventArgs e)
        {
            string Id = Request.QueryString["Id"];

            Model.tTask m = bll.GetModel(Convert.ToInt32(Id));
            if (m == null)
            {
                Alert.ShowInTop("出错了!"); return;
            }
            Model.tUsers           user     = GetIdentityUser();
            int                    dptId    = user.dptId;
            List <Model.tTaskSave> userList = bllsave.GetModelList(string.Format(" TaskId={0} and SavaDpt={1} ", m.Id, dptId));

            Model.tTaskSave msave    = userList.Count == 0 ? null : userList[0];
            string          content2 = Request.Form["editorNew2"] == null ? "" : Request.Form["editorNew2"];

            if (content2 == "")
            {
                Alert.ShowInTop("上报内容不可为空!"); return;
            }
            if (msave == null)
            {
                Model.tTaskSave model = new Model.tTaskSave();
                model.SavaDpt     = dptId;
                model.SaveContent = content2;
                model.SavePeo     = user.usersName;
                model.SaveTime    = DateTime.Now;
                model.TaskId      = m.Id;
                if (bllsave.Add(model) > 0)
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
            }
            else
            {
                msave.SavaDpt     = dptId;
                msave.SaveContent = content2;
                msave.SavePeo     = user.usersName;
                msave.SaveTime    = DateTime.Now;
                msave.TaskId      = m.Id;
                if (bllsave.Update(msave))
                {
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
                }
            }
        }
Пример #6
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());
                }
            }
        }
Пример #7
0
        protected void GridDpt_RowCommand(object sender, GridCommandEventArgs e)
        {
            int roleID = GetSelectedDataKeyID(GridDpt);


            if (e.CommandName == "Delete")
            {
                BLL.tTask BLL = new Maticsoft.BLL.tTask();

                if (BLL.GetModel(roleID).IsCheck == "已审核")
                {
                    Alert.ShowInTop("已经审核,无法删除!");
                    return;
                }
                bool isTrue = BLL.Delete(roleID);
                if (!isTrue)
                {
                    Alert.ShowInTop("删除失败!");
                    return;
                }
                else
                {
                    LoadData();
                }
            }
            else if (e.CommandName == "Check")
            {
                Model.tUsers user = GetIdentityUser();
                BLL.tTask    BLL  = new Maticsoft.BLL.tTask();

                if (!haveRight(user.userId, "及时任务审批"))
                {
                    Alert.ShowInTop("当前用户没有权限审批!");
                    return;
                }
                Model.tTask top = BLL.GetModel(roleID);

                if (top.IsCheck == "已审核")
                {
                    //if (top.IsCheckPeo != user.usersName)
                    //{
                    //    Alert.ShowInTop("当前用户没有权限审批!");
                    //    return;
                    //}
                    top.IsCheck     = "待审核";
                    top.IsCheckPeo  = null;
                    top.IsCheckTime = null;
                }
                else
                {
                    top.IsCheck     = "已审核";
                    top.IsCheckPeo  = user.usersName;
                    top.IsCheckTime = DateTime.Now;
                }


                bool isTrue = BLL.Update(top);
                if (!isTrue)
                {
                    Alert.ShowInTop("操作失败!");
                    return;
                }
                else
                {
                    LoadData();
                }
            }
            else if (e.CommandName == "Edit")
            {
                string openUrl = String.Format("./TaskEdit.aspx?Id={0}", HttpUtility.UrlEncode(roleID.ToString()));
                PageContext.RegisterStartupScript(Window1.GetSaveStateReference(roleID.ToString()) + Window1.GetShowReference(openUrl, "编辑任务"));
            }
            else
            {
            }
        }