Esempio n. 1
0
        /// <summary>
        /// 点击确定触发事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_sumbit_onclick(object sender, EventArgs e)
        {
            try
            {
                string           flag       = "审核不通过";
                Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"];
                //项目ID
                string ID = Request["ID"];
                project_model = project_bll.GetModel(int.Parse(ID));

                //审批结果
                string Status = RadioButtonList_Check.SelectedValue;

                if (!(TB_DoNote.Text.ToString().Equals("")))
                {
                    //审批意见
                    project_model.DoNote = project_model.DoNote + user_model.REALNAME + "(" + user_model.USERNAME + "): " + DateTime.Now + "</br>   " + TB_DoNote.Text.ToString() + "</br></br>";
                }
                if (!(Status.Equals("3")))//只有当这个审批人直接将此项目定为通过或是不通过时才去更新审批时间和状态及审批人
                {
                    //审批时间
                    project_model.ReadTime = DateTime.Now;
                    //审批人员
                    project_model.DoUserID = user_model.ID;
                    //审批结果
                    project_model.Status = int.Parse(Status);


                    project_bll.Update(project_model);

                    //******************在移交了项目审批人之后。还需要将自己的审核意见更改过来,并且将Isturn改成已经审核过了

                    string sql_checkuser = "******" + Status + ", Infors = Infors + '" + TB_DoNote.Text.ToString() + "</br>' WHERE (ProjectID = " + project_model.ID + ") AND (UserID = '" + user_model.ID + "') ";

                    pageControl.doSql(sql_checkuser);
                }
                else//如果是转交给别的人。则需要往Project_ShenheList里加一条记录
                {
                    //审批结果
                    project_model.Status = 0;
                    //审批人
                    project_model.DoUserID = DDL_CheckUserList.SelectedValue.ToString();//改成新的审批人

                    project_bll.Update(project_model);

                    //******************如果此审批者将此项目转给了其他人,则要根据所选择的移交审批人,将此项目发送给这个人,即向Project_ShenheList加条记录
                    Dianda.BLL.Project_ShenheList   Shenhe_bll   = new Dianda.BLL.Project_ShenheList();
                    Dianda.Model.Project_ShenheList Shenhe_model = new Dianda.Model.Project_ShenheList();

                    //在添加记录之前先检查是不是有该条记录了
                    //做这一步的目的是:在立项时已经根据当时所选择的审批人往Project_ShenheList里加了一条记录
                    //如果第一次移交给另一个人,而这个人审批时发现不属于自己审批,又转回给第一个人,
                    //这样如果再添加就会出现同一个项目,同一个审批人出现多条数据了。

                    string sqlwhere = "(ProjectID = " + project_model.ID + ") AND (UserID = '" + DDL_CheckUserList.SelectedValue.ToString() + "') ";

                    List <Dianda.Model.Project_ShenheList> Li = Shenhe_bll.GetModelList(sqlwhere);

                    if (Li.Count > 0)
                    {
                        string sql_changecheckuser = "******" + sqlwhere;

                        pageControl.doSql(sql_changecheckuser);
                    }
                    else
                    {
                        //ID
                        Shenhe_model.ID = Shenhe_bll.GetMaxId();
                        //需要审核的项目ID
                        Shenhe_model.ProjectID = project_model.ID;
                        //审核人的ID
                        Shenhe_model.UserID = DDL_CheckUserList.SelectedValue.ToString();
                        //审核状态(新建默认时默认为0:待审核)
                        Shenhe_model.Status = 0;
                        //是否到当前的用户审核:0表示未到;1表示到;2表示已经审核过
                        Shenhe_model.Isturn = 1;
                        //审核意见
                        Shenhe_model.Infors = "";

                        //向Project_ShenheList加条记录
                        Shenhe_bll.Add(Shenhe_model);
                    }

                    //******************在移交了项目审批人之后。还需要将自己的审核意见更改过来,并且将Isturn改成已经审核过了

                    string sql_checkuser = "******" + TB_DoNote.Text.ToString() + "</br>' WHERE (ProjectID = " + project_model.ID + ") AND (UserID = '" + user_model.ID + "') ";

                    pageControl.doSql(sql_checkuser);

                    ////******************项目移交给别人审核后,需要将原来在Project_Project中的审核人改成新的审核人

                    //string sql_changechecker = " UPDATE Project_Projects SET Status = 0,DoUserID='" + DDL_CheckUserList.SelectedValue.ToString() + "' WHERE (ID = " + project_model.ID + ")";

                    //pageControl1.doSql(sql_changechecker);

                    flag = "移交审核";
                }

                if (Status.Equals("1"))//表示审批通过
                {
                    flag = "审核通过";
                    if (project_model.CashCardID == 0)//如果资金卡为0,表示新建资金卡
                    {
                        string sql = " UPDATE Cash_Message SET Status = 1 WHERE (ProjectID = " + project_model.ID + ")";
                        pageControl.doSql(sql);
                    }

                    //项审批成功以后,要向Document_Folder中添加一个当前用户的顶级档案目录
                    Dianda.Model.Document_Folder docfolder_model = new Dianda.Model.Document_Folder();
                    Dianda.BLL.Document_Folder   docfolder_bll   = new Dianda.BLL.Document_Folder();
                    int id = docfolder_bll.GetMaxId();
                    docfolder_model.ID = id;
                    //目录名称
                    docfolder_model.FolderName = project_model.NAMES;
                    //上级目录
                    docfolder_model.UpID = 38;
                    //文件夹的属性
                    docfolder_model.Types = "public";
                    //是否共享
                    docfolder_model.IsShare = 0;
                    //创建的用户
                    docfolder_model.UserID = user_model.ID;
                    //删除标记
                    docfolder_model.DELFLAG = 0;
                    //当前时间
                    docfolder_model.DATETIME = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                    //栏目的路径记录(用/来隔开)
                    docfolder_model.COLUMNSPATH = "-1/38/" + docfolder_model.ID;
                    //项目ID
                    docfolder_model.ProjectID = int.Parse(ID);
                    //栏目显示的顺序
                    docfolder_model.SHUNXU = 0;
                    //栏目的路径名称
                    docfolder_model.PNAMES = "项目文档>" + project_model.NAMES;
                    //当前文件夹中文件的大小
                    docfolder_model.SizeOf = "0";

                    docfolder_bll.Add(docfolder_model);

                    if (null != project_model.Attachments && !(project_model.Attachments.ToString().Equals("")))
                    {
                        setAttachmentsToDocument(user_model.ID, id.ToString(), project_model.Attachments.ToString());//将立项申请时的上传附件保存到项目的目录中
                    }

                    //项审批成功以后往信息栏目表中添加一条记录
                    Dianda.BLL.News_ColumnsExt columnsext = new Dianda.BLL.News_ColumnsExt();

                    columnsext.addCloumns(project_model.NAMES, "PROJECT", project_model.ID.ToString(), 2);
                }

                //给业务申请者发信息
                Model.FaceShowMessage mFaceShowMessage = new Dianda.Model.FaceShowMessage();
                BLL.FaceShowMessage   bFaceShowMessage = new Dianda.BLL.FaceShowMessage();

                mFaceShowMessage.DATETIME  = DateTime.Now;
                mFaceShowMessage.FromTable = "项目审核";
                mFaceShowMessage.IsRead    = 0;
                mFaceShowMessage.NewsID    = null;
                mFaceShowMessage.NewsType  = "项目审核";
                mFaceShowMessage.ReadTime  = null;
                mFaceShowMessage.DELFLAG   = 0;
                mFaceShowMessage.ProjectID = project_model.ID;
                mFaceShowMessage.Receive   = project_model.SendUserID.ToString();
                mFaceShowMessage.URLS      = "<a href='/Admin/personalProjectManage/OAproject/manage.aspx?projectstatus=1' target='_self' title='项目审核:审核时间" + DateTime.Now.ToString() + "'>" + project_model.NAMES.ToString() + "  " + flag + "</a> (" + user_model.REALNAME + ")";

                bFaceShowMessage.Add(mFaceShowMessage);
                //给业务申请者发信息

                if (Status.Equals("3"))
                {
                    //如果项目的审批者将此项目重新转移交给了另一个审批者,那么则需要发二个提示信息,一是新的项目审批者,第二个就是原来的项目审批者

                    //给新的项目审批者发送信息

                    mFaceShowMessage.DATETIME  = DateTime.Now;
                    mFaceShowMessage.FromTable = "立项申请";
                    mFaceShowMessage.IsRead    = 0;
                    mFaceShowMessage.NewsID    = null;
                    mFaceShowMessage.NewsType  = "立项申请";
                    mFaceShowMessage.ReadTime  = null;
                    mFaceShowMessage.DELFLAG   = 0;
                    mFaceShowMessage.ProjectID = project_model.ID;
                    mFaceShowMessage.Receive   = DDL_CheckUserList.SelectedValue.ToString();
                    //mFaceShowMessage.URLS = "<a href='/Admin/personalProjectManage/OAproject/manage.aspx?projectstatus=1' target='_self' title='项目移交:移交时间" + DateTime.Now.ToString() + "'>" + project_model.NAMES.ToString() + " (移交审核)</a>";
                    mFaceShowMessage.URLS = "<a href='/Admin/SystemProjectManage/ProjectCheck/check.aspx?ID=" + project_model.ID.ToString() + "&pageindex=1&Status=0' target='_self' title='移交审核:移交时间" + DateTime.Now.ToString() + "'>" + project_model.NAMES.ToString() + "  移交审核</a>  (" + user_model.REALNAME + ")";

                    bFaceShowMessage.Add(mFaceShowMessage);
                    //给新的项目审批者发送信息
                }

                //string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?pageindex=" + Request["pageindex"] + "&Status=" + Request["Status"] + "\";</script>";


                //Response.Write(coutws);

                ScriptManager.RegisterStartupScript(this, this.GetType(), "ok", "<script>alert('操作成功!现在进入列表页面');javascript:location='manage.aspx?pageindex=" + Request["pageindex"] + "&Status=" + Request["Status"] + "';</script>", false);

                //添加操作日志

                Dianda.BLL.SYS_LogsExt bsyslog = new Dianda.BLL.SYS_LogsExt();
                bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "系统项目管理", "审核" + flag + project_model.NAMES + "项目" + ":成功!");

                //添加操作日志
            }
            catch
            {
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 确定按钮触发事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_submit_Click(object sender, EventArgs e)
        {
            try
            {
                project_model = project_bll.GetModel(int.Parse(Session["Work_ProjectId"].ToString()));

                if (null != Request["role"] && Request["role"].ToString().Equals("manager"))
                {
                    //说明是领导审批项目经费时重新上传的预算表单
                }
                else
                {
                    if (project_model.TEMP1.Equals("1") || project_model.TEMP1.Equals("3"))
                    {
                        tag.Text = "该项目上传的预算表单已经审核通过!不能再次上传!";
                        return;
                    }

                    if (FileUpload_list.FileName.Length <= 0)
                    {
                        tag.Text = "上传预算表单项不能为空!";
                        return;
                    }
                }


                if (FileUpload_list.FileName.Length > 2)
                {
                    string[] content = fileup.UpFile_COMMONS(FileUpload_list, "/AllFileUp/fileup", "");
                    //1-成功;0-失败;2-类型不支持;3-大小不符合;文件的路径;文件名称;文件类型;图标;大小;操作结果
                    if (content[0] == "0")
                    {
                        tag.Text = "文件上传失败,请重新上传!";
                        return;
                    }
                    else if (content[0] == "2")
                    {
                        tag.Text = "系统不允许此类文件上传,文件上传失败,请重新上传!";
                        return;
                    }
                    else if (content[0] == "3")
                    {
                        tag.Text = "文件上传大小不符合,文件上传失败,请重新上传!";
                        return;
                    }

                    if (null != Request["role"] && Request["role"].ToString().Equals("manager"))
                    {
                        project_model.BudgetList = project_model.BudgetList + "@" + content[1];
                    }
                    else
                    {
                        project_model.BudgetList = content[1];
                    }
                }


                if (!CashTotal.Text.ToString().Equals(""))
                {
                    if (null != Request["role"] && Request["role"].ToString().Equals("manager"))
                    {
                        if (RB_cashtotal.SelectedValue.ToString().Equals("1"))//表示经费单位选择的是万元
                        {
                            //领导在审批时重新上传预算表单时重新写的经费额。
                            project_model.TEMP2 = (Convert.ToDecimal(CashTotal.Text.ToString())).ToString() + "万元";
                        }
                        else
                        {
                            project_model.TEMP2 = (Convert.ToDecimal(CashTotal.Text.ToString())).ToString() + "元";
                        }
                    }
                    else
                    {
                        if (RB_cashtotal.SelectedValue.ToString().Equals("1"))//表示经费单位选择的是万元
                        {
                            //经费额度存放的是元
                            project_model.CashTotal = Convert.ToDecimal(CashTotal.Text.ToString()) * 10000;
                            //经费单位
                            project_model.CashDw = "万元";
                        }
                        else
                        {
                            project_model.CashTotal = Convert.ToDecimal(CashTotal.Text.ToString());
                            //经费单位
                            project_model.CashDw = "元";
                        }
                    }
                }
                //预算表单的审核状态
                if (null != Request["role"] && Request["role"].ToString().Equals("manager"))
                {
                    //
                }
                else
                {
                    project_model.TEMP1 = "0";
                }

                project_bll.Update(project_model);


                //给业务申请者发信息
                Model.FaceShowMessage mFaceShowMessage  = new Dianda.Model.FaceShowMessage();
                Model.FaceShowMessage mFaceShowMessage2 = new Dianda.Model.FaceShowMessage();
                BLL.FaceShowMessage   bFaceShowMessage  = new Dianda.BLL.FaceShowMessage();

                //DataTable dt = bFaceShowMessage.GetList("FromTable='预算表单' and NewsType='预算表单审批' and ProjectID='" + project_model.ID.ToString() + "'").Tables[0];
                List <Model.FaceShowMessage> facelist = bFaceShowMessage.GetModelList("FromTable='预算表单' and NewsType='预算表单审批' and ProjectID='" + project_model.ID.ToString() + "'");

                mFaceShowMessage.DATETIME  = DateTime.Now;
                mFaceShowMessage.FromTable = "预算表单";
                mFaceShowMessage.IsRead    = 0;
                mFaceShowMessage.NewsID    = null;
                mFaceShowMessage.NewsType  = "预算表单审批";
                mFaceShowMessage.ReadTime  = null;
                mFaceShowMessage.DELFLAG   = 0;
                mFaceShowMessage.ProjectID = project_model.ID;
                mFaceShowMessage.Receive   = project_model.DoUserID.ToString();//当前项目的审核人的ID
                mFaceShowMessage.URLS      = "<a href='/Admin/budgetManage/manage.aspx?role=manager' target='_self' title='项目预算表单'>" + project_model.NAMES.ToString() + "  预算表单 待审</a>";

                if (facelist.Count > 0)
                {
                    mFaceShowMessage2         = facelist[0];
                    mFaceShowMessage2.DELFLAG = 1;

                    // mFaceShowMessage.ID = int.Parse(dt.Rows[0]["ID"].ToString());
                    bFaceShowMessage.Update(mFaceShowMessage2);
                    bFaceShowMessage.Add(mFaceShowMessage);
                }
                else
                {
                    bFaceShowMessage.Add(mFaceShowMessage);
                }
                //给业务申请者发信息

                string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"预算表单上传成功! \");window.close();</script>";

                Response.Write(coutws);
            }
            catch
            {
            }
        }
Esempio n. 3
0
        //编辑部门确定
        protected void Button_sumbit2_Click(object sender, EventArgs e)
        {
            //修改部门ID
            project_model = project_bll.GetModel(int.Parse(Session["Work_ProjectId"].ToString()));
            //是否刷新用户数据列表(可能造成误删!)
            if (CheckBox1.Checked)
            {
                //创建SQL语句
                StringBuilder sql_dep = new StringBuilder("delete from project_userlist where projectid='" + Session["Work_ProjectId"].ToString() + "'");
                //获得参加项目的部门ID
                string dep = project_model.DepartmentID;
                //创建一个数字,指示是否是有值变更
                int sum = 0;
                //循环所有的部门
                for (int i = 0; i < CB_DepartmentID.Items.Count; i++)
                {
                    //判断是否是变更的值
                    if (dep.Contains(CB_DepartmentID.Items[i].Value))
                    {
                        //判断是否是去除有过的部门
                        if (CB_DepartmentID.Items[i].Selected == false)
                        {
                            //判断是否是首次
                            if (sum == 0)
                            {
                                sum += 1;
                                sql_dep.Append(" and ID in(select ID from vproject_userlist where ");
                                sql_dep.Append(" departmentid like '%" + CB_DepartmentID.Items[i].Value + "%'");
                            }
                            else
                            {
                                sum += 1;
                                sql_dep.Append(" or departmentid like '%" + CB_DepartmentID.Items[i].Value + "%'");
                            }
                        }
                    }
                }
                //当发生有部门去除时
                if (sum != 0)
                {
                    sql_dep.Append(")");
                    pageControl.doSql(sql_dep.ToString());
                }
            }
            //参与部门
            project_model.DepartmentID = "";
            //参与部门名称
            project_model.DepartmentNames = "";
            for (int i = 0; i < CB_DepartmentID.Items.Count; i++)
            {
                if (CB_DepartmentID.Items[i].Selected == true)
                {
                    project_model.DepartmentID = project_model.DepartmentID + CB_DepartmentID.Items[i].Value + ",";

                    project_model.DepartmentNames = project_model.DepartmentNames + CB_DepartmentID.Items[i].Text + ",";
                }
            }
            /* 截掉最后一个逗号*/
            if (project_model.DepartmentID.Length > 0)
            {
                project_model.DepartmentID    = project_model.DepartmentID.Substring(0, project_model.DepartmentID.Length - 1);
                project_model.DepartmentNames = project_model.DepartmentNames.Substring(0, project_model.DepartmentNames.Length - 1);
            }
            //修改项目
            project_bll.Update(project_model);
            //添加操作日志
            Dianda.BLL.SYS_LogsExt bsyslog    = new Dianda.BLL.SYS_LogsExt();
            Model.USER_Users       user_model = (Model.USER_Users)Session["USER_Users"];
            bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "添加部门", "添加成功");
            string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!\");location.href='manage.aspx';</script>";

            Response.Write(coutws);
        }
Esempio n. 4
0
        /// <summary>
        /// 点击删除按钮触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_delete_onclick(object sender, EventArgs e)
        {
            int num  = 0;
            int rows = GridView1.Rows.Count;

            if (rows > 0)
            {
                for (int i = 0; i < rows; i++)
                {
                    CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("CheckBox_choose");
                    if (cb.Checked)
                    {
                        num = num + 1;
                    }
                }

                if (num == 0)
                {
                    tag.Text = "删除时最少选择一条数据!";
                }
                else
                {
                    tag.Text = "";
                    for (int j = 0; j < rows; j++)
                    {
                        CheckBox    cb1 = (CheckBox)GridView1.Rows[j].Cells[0].FindControl("CheckBox_choose");
                        HiddenField hid = (HiddenField)GridView1.Rows[j].Cells[0].FindControl("Hid_ID");

                        if (cb1.Checked)
                        {
                            //获取到当前项目的基本信息
                            projects_model = projects_bll.GetModel(int.Parse(hid.Value.ToString()));
                            //将删除标记设为1
                            projects_model.DELFLAG = 1;

                            projects_bll.Update(projects_model);


                            //同时删除faceshowmessage中的projectid = ID,的数据,同时置DELFLAG=1;

                            Dianda.BLL.Project_ProjectsExt projectsExt = new Dianda.BLL.Project_ProjectsExt();

                            string sqlwhere = " ProjectID = '" + hid.Value.ToString() + "'";

                            projectsExt.DeleteTableData(sqlwhere, "FaceShowMessage");

                            //添加操作日志

                            Dianda.BLL.SYS_LogsExt bsyslog    = new Dianda.BLL.SYS_LogsExt();
                            Model.USER_Users       user_model = (Model.USER_Users)Session["USER_Users"];

                            bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "系统项目管理", "删除" + projects_model.NAMES + "项目成功");

                            //添加操作日志
                        }
                    }

                    //tag.Text = "操作成功!";

                    //string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?pageindex=" + Request["pageindex"]  + "\";</script>";
                    //Response.Write(coutws);

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ok", "<script>alert('操作成功!现在进入我的项目页面');javascript:location='manage.aspx?projectStatus=" + Request["projectstatus"].ToString() + "';</script>", false);
                }
            }
        }
Esempio n. 5
0
        ///// <summary>
        ///// 根据项目负责人来动态显示资金卡下拉列表
        ///// </summary>
        ///// <param name="CashflagID"></param>
        //protected void SetDDL_CashCardID(string CashflagID)
        //{
        //    DataTable dt3 = new DataTable();

        //    string sql2 = " SELECT ID, CardNum, CardName, LimitNums FROM Cash_Cards WHERE (CardholderID = '" + CashflagID + "') ";
        //    dt3 = pagecontrol.doSql(sql2).Tables[0];

        //    if (dt3.Rows.Count > 0)
        //    {
        //        DDL_CashCardID.Enabled = true;
        //        DDL_CashCardID.Items.Clear();
        //        for (int j = 0; j < dt3.Rows.Count; j++)
        //        {
        //            string ID = dt3.Rows[j]["ID"].ToString();
        //            string CardNum = dt3.Rows[j]["CardNum"].ToString();
        //            string CardName = dt3.Rows[j]["CardName"].ToString();
        //            string LimitNums = dt3.Rows[j]["LimitNums"].ToString();

        //            string showinfo = CardName + "[" + CardNum + "," + LimitNums + "]";

        //            ListItem li = new ListItem(showinfo, ID);
        //            DDL_CashCardID.Items.Add(li);

        //        }

        //        Button_applyfor.Enabled = true;
        //        Button_reset.Enabled = true;
        //        Button_draft.Enabled = true;
        //    }
        //    else
        //    {
        //        DDL_CashCardID.Items.Clear();
        //        ListItem li = new ListItem("暂无可选资金卡", "");
        //        DDL_CashCardID.Items.Add(li);
        //        DDL_CashCardID.Enabled = false;
        //        Button_applyfor.Enabled = false;
        //        Button_reset.Enabled = false;
        //        Button_draft.Enabled = false;
        //    }
        //}

        /// <summary>
        /// 资金卡选择切换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //protected void RB_NewAddCashCard_CheckedChanged(object sender, EventArgs e)
        //{
        //    RB_CashCardID.Checked = false;

        //    RB_NewAddCashCard.Checked = true;

        //    div_cash.Visible = true;


        //    Button_applyfor.Enabled = true;
        //    Button_reset.Enabled = true;
        //    Button_draft.Enabled = true;
        //}


        /// <summary>
        /// 资金卡选择切换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //protected void RB_CashCardID_CheckedChanged(object sender, EventArgs e)
        //{
        //    RB_CashCardID.Checked = true;

        //    RB_NewAddCashCard.Checked = false;

        //    div_cash.Visible = false;
        //}

        /// <summary>
        /// 根据项目负责人来动态显示资金卡下拉列表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //protected void DDL_LeaderID_Changed(object sender, EventArgs e)
        //{
        //    string ID = DDL_LeaderID.SelectedValue.ToString();
        //    SetDDL_CashCardID(ID);
        //}

        /// <summary>
        /// 点击重置触发事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //protected void Button_reset_Click(object sender, EventArgs e)
        //{

        //    NAME.Text = "";

        //    for (int i = 0; i < CB_DepartmentID.Items.Count; i++)
        //    {
        //        if (CB_DepartmentID.Items[i].Selected == true)
        //        {
        //            CB_DepartmentID.Items[i].Selected = false;
        //        }
        //    }
        //    TB_StartTime.Value = "";
        //    TB_EndTime.Value = "";
        //    CashTotal.Text = "";
        //    RB_CashCardID.Checked = true;
        //    RB_NewAddCashCard.Checked = false;
        //    Overviews.Value = "";
        //    div_cash.Visible = false;
        //    TB_LimitNums.Text = "";
        //    TB_Notes.Text = "";
        //}

        /// <summary>
        /// 点击申请触发事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_applyfor_Click(object sender, EventArgs e)
        {
            try
            {
                string ID = Request["ID"];
                project_model = project_bll.GetModel(int.Parse(ID));
                //项目审核人
                string douserid = project_model.DoUserID.ToString();

                string projectName = NAME.Text.ToString();

                //检查是否有该项目名称
                bool checkName = pagecontrol.Exists_Name("Project_Projects", "NAMES", projectName, "ID", ID);
                if (checkName)
                {
                    tag.Text = "该项目名称已经存在,请修改!";
                }
                else
                {
                    if (FileUpload1.FileName.Length > 2)
                    {
                        string[] content = fileup.UpFile_COMMONS(FileUpload1, "/AllFileUp/fileup", HiddenField_oldpath.Value.ToString());
                        //1-成功;0-失败;2-类型不支持;3-大小不符合;文件的路径;文件名称;文件类型;图标;大小;操作结果
                        if (content[0] == "0")
                        {
                            tag.Text = "文件上传失败,请重新上传!";
                            return;
                        }
                        else if (content[0] == "2")
                        {
                            tag.Text = "系统不允许此类文件上传,文件上传失败,请重新上传!";
                            return;
                        }
                        else if (content[0] == "3")
                        {
                            tag.Text = "文件上传大小不符合,文件上传失败,请重新上传!";
                            return;
                        }

                        project_model.Attachments = content[1];
                    }

                    Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"];

                    int statusflag = Convert.ToInt32(((Button)sender).CommandArgument.ToString());//获取到触发源

                    //项目名称
                    project_model.NAMES = NAME.Text.ToString();
                    //状态
                    project_model.Status = statusflag;
                    //项目负责人
                    project_model.LeaderID = DDL_LeaderID.SelectedValue.ToString().Split('|')[0].ToString();

                    ////参与部门--参与部门的编辑工作放在了项目成员的功能处-唐春龙-2011-02-17
                    //project_model.DepartmentID = "";
                    ////参与部门名称
                    //project_model.DepartmentNames = "";
                    //for (int i = 0; i < CB_DepartmentID.Items.Count; i++)
                    //{
                    //    if (CB_DepartmentID.Items[i].Selected == true)
                    //    {
                    //        project_model.DepartmentID = project_model.DepartmentID + CB_DepartmentID.Items[i].Value + ",";

                    //        project_model.DepartmentNames = project_model.DepartmentNames + CB_DepartmentID.Items[i].Text + ",";
                    //    }
                    //}
                    ///* 截掉最后一个逗号*/
                    //if (project_model.DepartmentID.Length > 0)
                    //{
                    //    project_model.DepartmentID = project_model.DepartmentID.Substring(0, project_model.DepartmentID.Length - 1);
                    //    project_model.DepartmentNames = project_model.DepartmentNames.Substring(0, project_model.DepartmentNames.Length - 1);
                    //}--参与部门的编辑工作放在了项目成员的功能处-唐春龙-2011-02-17

                    //项目预计起始时间
                    project_model.StartTime = Convert.ToDateTime(TB_StartTime.Value.ToString());
                    //项目预计结束时间
                    project_model.EndTime = Convert.ToDateTime(TB_EndTime.Value.ToString());
                    //预计经费
                    if (RL_ProjectType.SelectedValue.ToString().Equals("1"))//当项目类型为正常项目时才有预计经费项
                    {
                        //项目审核人
                        project_model.DoUserID = DDL_CheckUserID.SelectedValue.ToString();

                        if (!CashTotal.Text.ToString().Equals(""))
                        {
                            //project_model.CashTotal = Convert.ToDecimal(CashTotal.Text.ToString());

                            if (RB_cashtotal.SelectedValue.ToString().Equals("1"))//表示经费单位选择的是万元
                            {
                                //经费额度存放的是元
                                project_model.CashTotal = Convert.ToDecimal(CashTotal.Text.ToString()) * 10000;
                                //经费单位
                                project_model.CashDw = "万元";
                            }
                            else
                            {
                                project_model.CashTotal = Convert.ToDecimal(CashTotal.Text.ToString());
                                //经费单位
                                project_model.CashDw = "元";
                            }
                        }
                        else
                        {
                            project_model.CashTotal = null;
                        }
                    }
                    else
                    {
                        //项目审核人
                        project_model.DoUserID = "";
                    }
                    //资金卡选择

                    //DataSet ds1 = cashmessage_bll.GetList(" ProjectID = " + project_model.ID);

                    //if (RB_CashCardID.Checked == true)//如果选择的是资金卡则设为资金卡的ID;
                    //{
                    //    project_model.CashCardID = Int16.Parse(DDL_CashCardID.SelectedValue.ToString());

                    //    //如果编辑时选择的是资金卡,但是在cash_message表中发现有此项目的消息记录,则说明
                    //    //在新建此项目时选择的是新建资金卡,而现在如果修改成资金卡,则要将这条消息记录删除
                    //    if (ds1.Tables[0].Rows.Count > 0)
                    //    {
                    //        string cashid = ds1.Tables[0].Rows[0]["ID"].ToString();
                    //        cashmessage_bll.Delete(int.Parse(cashid));
                    //    }

                    //}
                    //else//如果选择的是新建资金卡则设为0,并且需要向cash_message表中加一条记录
                    //{
                    //    project_model.CashCardID = 0;

                    //    //如果原来就有记录,则修改
                    //    if (ds1.Tables[0].Rows.Count > 0)
                    //    {
                    //        //ID
                    //        string cashid = ds1.Tables[0].Rows[0]["ID"].ToString();
                    //        cashmessage_model = cashmessage_bll.GetModel(int.Parse(cashid));
                    //        //资金卡初始金额
                    //        cashmessage_model.LimitNums = Convert.ToDecimal(TB_LimitNums.Text);
                    //        //新建备注说明
                    //        cashmessage_model.Notes = TB_Notes.Text.ToString();

                    //        cashmessage_bll.Update(cashmessage_model);
                    //    }
                    //    else
                    //    {
                    //        //资金卡名称(暂时写的留空)
                    //        cashmessage_model.CardName = "";
                    //        //持卡人
                    //        cashmessage_model.CardholderID = DDL_LeaderID.SelectedValue;
                    //        //项目的ID
                    //        cashmessage_model.ProjectID = project_model.ID;
                    //        //初始金额
                    //        cashmessage_model.LimitNums = Convert.ToDecimal(TB_LimitNums.Text.ToString());
                    //        //填写的时间
                    //        cashmessage_model.DATETIME = Convert.ToDateTime(DateTime.Now.ToString());
                    //        //发出这个消息的用户的ID
                    //        cashmessage_model.SendUserID = user_model.ID;
                    //        //备注说明
                    //        cashmessage_model.Notes = TB_Notes.Text.ToString();
                    //        //是否已经阅读
                    //        cashmessage_model.IsRead = 0;
                    //        //消息的状态
                    //        cashmessage_model.Status = 0;

                    //        Session["Cash_Message_temps"] = cashmessage_model;

                    //        //向信息表中添加一条新建资金卡的记录
                    //        cashmessage_bll.Add(cashmessage_model);
                    //    }
                    //}
                    //项目概要
                    project_model.Overviews = Overviews.Value.ToString();
                    //申请时间
                    project_model.DATETIME = Convert.ToDateTime(DateTime.Now.ToString());
                    //所属分类
                    project_model.ColumnsID = int.Parse(DDL_COLUMN.SelectedValue);

                    //修改项目
                    project_bll.Update(project_model);


                    //根据项目负责人的改变来改变项目组成员

                    string    sql_userlist = " SELECT ID, ProjectID, UserID, Status, DATETIME FROM Project_UserList WHERE (ProjectID = '" + ID + "') AND (UserID = '" + project_model.LeaderID + "') AND (Status = '1')";
                    DataTable dt           = pagecontrol.doSql(sql_userlist).Tables[0];

                    if (!(dt.Rows.Count > 0))
                    {
                        Dianda.BLL.Project_UserList   project_userlist_bll   = new Dianda.BLL.Project_UserList();
                        Dianda.Model.Project_UserList project_userlist_model = new Dianda.Model.Project_UserList();

                        // project_userlist_model.ID = project_userlist_bll.GetMaxId();

                        //项目ID
                        project_userlist_model.ProjectID = project_model.ID;
                        //项目组成员
                        project_userlist_model.UserID = project_model.LeaderID;
                        //状态
                        project_userlist_model.Status = 1;
                        //时间
                        project_userlist_model.DATETIME = DateTime.Now;

                        //向Project_UserList加条记录
                        project_userlist_bll.Add(project_userlist_model);
                    }

                    //根据所选择的分类的改变来动态的改变项目审批人的下拉列表。这样原来这个项目的审核人就发生了更改则需要将原来审核表中的UserID改成新的
                    string sql_checkuser = "******" + DDL_CheckUserID.SelectedValue.ToString() + "' WHERE (ProjectID = " + project_model.ID + ") AND (Status = 0) AND (UserID = '" + douserid + "') ";
                    pagecontrol.doSql(sql_checkuser);


                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ok", "<script>alert('操作成功!现在进入我的项目页面');javascript:location='manage.aspx?projectstatus=" + Request["status"] + "';</script>", false);

                    //添加操作日志
                    Dianda.BLL.SYS_LogsExt bsyslog = new Dianda.BLL.SYS_LogsExt();
                    bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "修改立项申请", "修改" + project_model.NAMES + "项目申请修改成功");
                    //添加操作日志

                    //tag.Text = "操作成功! 点击“返回”按钮进入我的项目页面!";
                    //addproject.Visible = false;
                    //goback.Visible = true;
                }
            }
            catch
            {
            }
        }