Exemplo n.º 1
0
        //保存议题修改
        #region
        protected void SaveBigTitle_Click(object sender, EventArgs e)
        {
            SuperviseBLL       superviseBLL       = new SuperviseBLL();
            SuperviseAssignBLL superviseAssignBLL = new SuperviseAssignBLL();
            R_Supervise        supervise          = superviseBLL.FindSupervise(int.Parse(ModiyRID.Text));

            supervise.SuperviseType = int.Parse(ModifyTypeList.SelectedValue);
            supervise.Title         = Request.Params["ModifyBigTitle2"];
            supervise.Urgency       = int.Parse(ModifyUrgencyList.SelectedValue);
            S_UserInFo user = null;
            int        num  = 0;

            try
            {
                user = (S_UserInFo)Session["User"];
                user.ToString();
                supervise.Mender = user.UserID;
            }
            catch (Exception s)
            {
                Response.Redirect("Login.aspx");
            }
            supervise.MendDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
            if (supervise.Title == null || supervise.Title == "")
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "SetStyle()", true);
                return;
            }
            else
            {
                if (Session["OldAssignNo"].ToString().Equals(Request.Params["SetDeptCharge2"]))
                {
                    num = superviseBLL.UpdateSupervise(supervise);
                }
                else
                {
                    num = superviseBLL.UpdateSupervise(supervise);
                    string   OldAssignSrt2 = Session["OldAssignNo"].ToString().Trim(','); //分割旧的部门主管
                    string[] OldsArray     = OldAssignSrt2.Split(',');
                    string   NewAssignSrt2 = Request.Params["SetDeptCharge2"].Trim(',');  //分割新的部门主管
                    string[] NewsArray     = NewAssignSrt2.Split(',');
                    foreach (string item in NewsArray)                                    //遍历intA中的元素
                    {
                        if (!OldsArray.Contains(item))                                    //假如intA中的元素tem不包含在intB中
                        {
                            R_SuperviseAssign superviseAssign = new R_SuperviseAssign();
                            superviseAssign.RID       = int.Parse(ModiyRID.Text);
                            superviseAssign.MxID      = int.Parse(ModifyMxID2.Text);
                            superviseAssign.ReplyMemo = "";
                            superviseAssign.bSate     = 0;
                            superviseAssign.Memo      = "";
                            superviseAssign.Mender    = user.UserID;
                            superviseAssign.MendDate  = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
                            superviseAssign.AssignNo  = item;
                            superviseAssignBLL.DeleteSuperviseAssignByRIDandAssignNozero(int.Parse(ModiyRID.Text));
                            num = superviseAssignBLL.AddsuperviseAssign(superviseAssign);
                        }
                    }
                }
            }
            if (num != 0)
            {
                Response.Write("<script language='javascript'>alert('更新成功!')</script>");
                Page_Load(sender, e);
            }
            else
            {
                Response.Write("<script language='javascript'>alert('更新失败!')</script>");
            }
        }
Exemplo n.º 2
0
        //监听gridview按钮事件 打开添加弹窗
        #region
        protected void GridView_RowCommand(object sender, GridViewCommandEventArgs e)
        {   //点击修改议题
            if (e.CommandName == "openModifyBigTitleModal")
            {
                SuperviseMxBLL     superviseMxBLL     = new SuperviseMxBLL();
                SuperviseAssignBLL superviseAssignBLL = new SuperviseAssignBLL();
                string[]           commandArgument    = e.CommandArgument.ToString().Split(',');
                int RID  = int.Parse(commandArgument[0]);
                int MxID = int.Parse(commandArgument[2]);
                ModiyRID.Text    = RID.ToString();
                ModifyMxID2.Text = MxID.ToString();
                SuperviseBLL  superviseBLL = new SuperviseBLL();
                R_Supervise   supervise    = superviseBLL.FindSupervise(RID);
                SqlDataReader read         = superviseAssignBLL.FindSuperviseAssignByRID(RID);
                string        AssignNoStr  = "";
                string        DeptNameStr  = "";
                while (read.Read())
                {
                    if (read["AssignNo"].ToString() != "")
                    {
                        AssignNoStr           += read["AssignNo"].ToString() + ",";
                        Session["OldAssignNo"] = AssignNoStr;
                    }
                    Session["OldAssignNo"] = AssignNoStr;
                    DeptNameStr           += read["DeptName"].ToString() + ",";
                }
                SetDepartment2.Text  = DeptNameStr;
                SetDeptCharge2.Text  = AssignNoStr;
                ModifyBigTitle2.Text = supervise.Title;
                RegisterJS(@"
                  $('#ModifyBigTitleModal').modal({
                    show: true,
                    backdrop: 'static'
                });", this);
            } //删除议题
            else if (e.CommandName == "DeleteBigTitle_Click")
            {
                string             RID                = e.CommandArgument.ToString();
                SuperviseBLL       superviseBLL       = new SuperviseBLL();
                SuperviseAssignBLL superviseAssignBLL = new SuperviseAssignBLL();
                int num = superviseAssignBLL.DeleteSuperviseAssignByRID(RID);
                if (num != 0)
                {
                    Response.Write("<script language='javascript'>alert('删除成功!')</script>");
                    Page_Load(sender, e);
                }
                else
                {
                    Response.Write("<script language='javascript'>alert('删除失败!')</script>");
                }
            }
            //点击添加步骤
            if (e.CommandName == "openModifySuperviseMxModal")
            {
                SuperviseMxBLL superviseMxBLL  = new SuperviseMxBLL();
                string[]       commandArgument = e.CommandArgument.ToString().Split(',');

                string AssignID = commandArgument[0];
                string RID      = commandArgument[1];
                string bigTitle = commandArgument[2];
                ModifyAssignID.Text = AssignID.ToString();
                ModifyRID.Text      = RID.ToString();
                ModifyBigTitle.Text = bigTitle;
                RegisterJS(@"
                 $('#ModifyTitle').val('');
                 $('#ModifyFinishDate').val('');
                 $('#ModifySetStaff').val('');
                  $('#ModifySuperviseMxModal').modal({
                    show: true,
                    backdrop: 'static'
                });", this);
            }
            //点击修改步骤
            else if (e.CommandName == "openModifySmallTitleModal")
            {
                string[] commandArgument = e.CommandArgument.ToString().Split(',');
                int      MxID            = int.Parse(commandArgument[0]);
                string   bigTitle        = commandArgument[1];
                string   smallTitle      = commandArgument[2];
                string   AssignID        = commandArgument[4];
                string   RID             = commandArgument[3];
                ModifyBigTitle3.Text        = bigTitle;
                ModifySmallTitle.Text       = smallTitle;
                ModifyMxID.Text             = MxID.ToString();
                ModifyRID3.Text             = RID;
                ModifySuperiseAssignID.Text = AssignID;
                SuperviseAssignBLL superviseAssignBLL = new SuperviseAssignBLL();
                SqlDataReader      read        = superviseAssignBLL.FindSuperviseAssignByMxID(MxID);
                string             AssignNoStr = "";
                while (read.Read())
                {
                    if (read["AssignNo"].ToString() != "")
                    {
                        AssignNoStr        += read["AssignNo"].ToString() + ",";
                        Session["OldStaff"] = AssignNoStr;
                    }
                }
                ModifySetStaff2.Text = AssignNoStr;
                SuperviseMxBLL superviseMxBLL = new SuperviseMxBLL();
                RegisterJS(@"
                  $('#ModifySmallTitleModal').modal({
                    show: true,
                    backdrop: 'static'
                });", this);
            }//删除任务
            else if (e.CommandName == "DeleteSmallTitle_Click")
            {
                string[]           commandArgument    = e.CommandArgument.ToString().Split(',');
                string             MxID               = commandArgument[0];
                string             AssignD            = commandArgument[1];
                SuperviseMxBLL     superviseMxBLL     = new SuperviseMxBLL();
                SuperviseAssignBLL superviseAssignBLL = new SuperviseAssignBLL();
                int num = superviseAssignBLL.DeleteSuperviseAssignByMxIDAndAssign(MxID, AssignD);
                if (num != 0)
                {
                    Response.Write("<script language='javascript'>alert('删除成功!')</script>");
                    Page_Load(sender, e);
                }
                else
                {
                    Response.Write("<script language='javascript'>alert('删除失败!')</script>");
                }
            }
            //点击处理任务
            else if (e.CommandName == "openDealSuperviseMxModal")
            {
                string[]      commandArgument = e.CommandArgument.ToString().Split(',');
                int           assignID        = int.Parse(commandArgument[0]);
                string        bigTitle        = commandArgument[1];
                string        smallTitle      = commandArgument[2];
                string        updateReplyMemo = commandArgument[3];
                string        updateMemo      = commandArgument[4];
                UploadBLL     uploadBLL       = new UploadBLL();
                string        UserID          = Session["UserID"].ToString();
                SqlDataReader read            = uploadBLL.SearchFileByAssignIDAndUserID(assignID, UserID);
                string        file            = "";
                while (read.Read())
                {
                    if (read["Path"].ToString() != "")
                    {
                        file += read["Path"].ToString() + ",";
                    }
                }
                UpdateAssignID.Text       = assignID.ToString();
                UpdateBigTitle.Text       = bigTitle;
                UpdateSmallTitle.Text     = smallTitle;
                UpdateReplyMemo.InnerText = updateReplyMemo;
                UpdateMemo.InnerText      = updateMemo;
                string path2 = file.Replace("~/File/", "");
                UploadFile.InnerText = path2;
                RegisterJS(@"
                  $('#DealSuperviseMxModal').modal({
                    show: true,
                    backdrop: 'static'
                });", this);
            }
            else if (e.CommandName == "openSearchFiles")
            {
                UploadBLL uploadBLL = new UploadBLL();
                int       AssignID  = int.Parse(e.CommandArgument.ToString());
                DataSet   ds        = new DataSet();
                ds = uploadBLL.SearchFileByAssignID(AssignID);
                DataView dv = ds.Tables[0].DefaultView;
                FileGridView.DataSource = dv;
                FileGridView.DataBind();
                RegisterJS(@"
                $('#FileModal').modal({
                    show: true,
                    backdrop: 'static'
                }); ", this);
            }
        }