/// <summary>
        /// 点击重置按钮触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_reset_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 = "";
                    string info = "";
                    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");
                        string id = GridView1.DataKeys[j]["ID"].ToString();
                        string ApplierRealName = GridView1.DataKeys[j]["ApplierRealName"].ToString();
                        string GetDateTime     = GridView1.DataKeys[j]["GetDateTime"].ToString();
                        string ApplyCount      = GridView1.DataKeys[j]["ApplyCount"].ToString();

                        if (cb1.Checked)
                        {
                            mCash_Apply          = new Dianda.Model.Cash_Apply();
                            mCash_Apply          = bCash_Apply.GetModel(Int32.Parse(id));
                            mCash_Apply.Statas   = 2;
                            mCash_Apply.DoUserID = ((Model.USER_Users)Session["USER_Users"]).ID;
                            bCash_Apply.Update(mCash_Apply);
                            info    += ("(" + ApplierRealName + "申请额度" + ApplyCount + "在" + GetDateTime + ")");
                            tag.Text = "操作成功!";
                            // string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?pageindex=" + Request["pageindex"] + "\";</script>";

                            Model.Cash_Cards mCash_Cards = new Dianda.Model.Cash_Cards();
                            BLL.Cash_Cards   bCash_Cards = new Dianda.BLL.Cash_Cards();
                            mCash_Cards = bCash_Cards.GetModel(Int32.Parse(mCash_Apply.CashCertificateID.ToString()));

                            /*给业务申请者发信息*/
                            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.Receive   = mCash_Apply.ApplierID;
                            mFaceShowMessage.URLS      = "<a href='/Admin/cashCardManage/manageCashApplyPerson.aspx' target='_self' title='经费预约:提交时间" + DateTime.Now + "'>" + mCash_Cards.CardName + "的经费预约 审核不通过 </a>  (" + ((Model.USER_Users)Session["USER_Users"]).REALNAME + ")";
                            bFaceShowMessage.Add(mFaceShowMessage);
                            /*给业务申请者发信息*/
                        }
                    }

                    // 添加操作日志
                    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 + ")", "审核经费预约", "审核预约" + info + "不通过:成功");

                    string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manageCashApply.aspx?pageindex=" + pageindexHidden.Value + "&date=" + DDList_RQ.SelectedValue + "&status=" + this.ddlStatas.SelectedValue + "\";</script>";
                    Response.Write(coutws);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///点击确定按钮触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_sumbit_Click(object sender, EventArgs e)
        {
            try
            {
                string strLimitNums = (this.ddlCardName.SelectedItem.Text.Split(',')[1]).Split(']')[0];//cash表纪录的金额
                strLimitNums = strLimitNums.Split(':')[1];
                double dLimitNums     = double.Parse(strLimitNums);
                string strApplyCount  = this.txtApplyCount.Text;
                double dApplyCount    = double.Parse(strApplyCount);
                string strGetDateTime = this.txtGetDateTime.Value;
                //DateTime dTimeInput = new DateTime(Int32.Parse(strGetDateTime.Split('-')[0]), Int32.Parse(strGetDateTime.Split('-')[1]), Int32.Parse(strGetDateTime.Split('-')[2]), Int32.Parse(this.ddlHour.SelectedValue), Int32.Parse(this.ddlMin.SelectedValue), 0);
                DateTime dTimeInput = Convert.ToDateTime(strGetDateTime + RadioButtonList_shijian.SelectedValue.ToString());
                //用途
                string UserFor = this.txtUseFor.Text.Trim();
                if (RBlist_YYLX.SelectedValue == "1")
                {
                    if (dApplyCount > dLimitNums)
                    {
                        tag.Text = "申请数额不能超过所选资金卡的余额!";
                        return;
                    }
                }
                //用途拼接字符串
                UserFor = "[" + RBlist_YYLX.SelectedItem.Text + "]" + UserFor;

                if (Convert.ToDateTime(Convert.ToDateTime(strGetDateTime).ToString("yyyy-MM-dd")) < Convert.ToDateTime(DateTime.Now.AddDays(2).ToString("yyyy-MM-dd")))
                {
                    tag.Text = "经费预约必须提前二天,请电话联系相关人员!";
                    return;
                }
                mCash_Apply                   = new Dianda.Model.Cash_Apply();
                mCash_Apply.ProjectID         = Int32.Parse(this.ddlProjectID.SelectedValue);
                mCash_Apply.CashCertificateID = this.ddlCardName.SelectedValue;
                mCash_Apply.ApplyCount        = decimal.Parse(strApplyCount);
                mCash_Apply.GetDateTime       = dTimeInput;
                mCash_Apply.UseFor            = UserFor;
                mCash_Apply.ApplierTel        = this.txtApplierTel.Text;
                mCash_Apply.ApplierID         = ((Model.USER_Users)Session["USER_Users"]).ID;
                mCash_Apply.DATETIME          = DateTime.Now;
                mCash_Apply.Statas            = 0;//(0-待审核、1表示审核通过、2表示审核不通过)
                mCash_Apply.DoUserID          = ((Model.USER_Users)Session["USER_Users"]).ID;

                bCash_Apply.Add(mCash_Apply);

                /*给业务申请者发信息*/
                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.Receive   = "经费预约";
                mFaceShowMessage.ProjectID = Int32.Parse(this.ddlProjectID.SelectedValue);
                mFaceShowMessage.DELFLAG   = 0;
                //mFaceShowMessage.URLS = ((Model.USER_Users)Session["USER_Users"]).REALNAME + "(" + ((Model.USER_Users)Session["USER_Users"]).USERNAME.ToString() + ")经费预约<a href='/Admin/cashCardManage/manageCashApply.aspx' target='_self' title='经费预约:提交时间" + DateTime.Now + "'>点击处理</a>";
                mFaceShowMessage.URLS = "<a href='/Admin/cashCardManage/manageCashApply.aspx' target='_self' title='经费预约:提交时间" + DateTime.Now + "'>经费预约  金额 " + dApplyCount + "</a>" + "  " + dTimeInput + " (" + ((Model.USER_Users)Session["USER_Users"]).REALNAME + ")";
                bFaceShowMessage.Add(mFaceShowMessage);
                /*给业务申请者发信息*/

                Model.Cash_Cards mCash_Cards = new Dianda.Model.Cash_Cards();
                BLL.Cash_Cards   bCash_Cards = new Dianda.BLL.Cash_Cards();
                mCash_Cards = bCash_Cards.GetModel(Int32.Parse(this.ddlCardName.SelectedValue));



                //添加操作日志
                Dianda.BLL.SYS_LogsExt bsyslog    = new Dianda.BLL.SYS_LogsExt();
                Model.USER_Users       user_model = (Model.USER_Users)Session["USER_Users"];
                bsyslog.addlogs(((Model.USER_Users)Session["USER_Users"]).REALNAME + "(" + ((Model.USER_Users)Session["USER_Users"]).USERNAME + ")", "添加经费预约", "预约" + dTimeInput + "时间取" + strApplyCount + ":成功");
                //添加操作日志

                //tag.Text = "操作成功!";
                string coutws = "";
                if (parentpage == "manageCashApplyPerson")
                {
                    //  coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manageCashApplyPerson.aspx?pageindex=" + Request["pageindex"] + "&status=" + Request["status"] + "&parentpage=" + Request["parentpage"] + "\";</script>";
                    coutws = "alert(\"操作成功!现在进入列表页面\"); location.href = \"manageCashApplyPerson.aspx?pageindex=" + Request["pageindex"] + "&status=" + Request["status"] + "&parentpage=" + Request["parentpage"] + "\";";
                }
                else
                {
                    // coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manageCashApply.aspx?pageindex=" + Request["pageindex"] + "&status=" + Request["status"] + "\";</script>";
                    coutws = "alert(\"操作成功!现在进入列表页面\"); location.href = \"manageCashApply.aspx?pageindex=" + Request["pageindex"] + "&status=" + Request["status"] + "\";";
                }
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", coutws, true);
                //  Response.Write(coutws);
            }
            catch
            {
                tag.Text = "操作失败,请重试!";
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Dianda.Model.Cash_Cards model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Cash_Cards(");
            strSql.Append("CardNum,CardName,CardholderID,DepartmentID,ProjectID,Balance,LimitNums,ApproverIDs,DATETIME,Statas,DoUserID,EndTime,TEMP0,TEMP1,TEMP2,TEMP3,SpecialFundsID,SFOrderID,YEBalance)");
            strSql.Append(" values (");
            strSql.Append("@CardNum,@CardName,@CardholderID,@DepartmentID,@ProjectID,@Balance,@LimitNums,@ApproverIDs,@DATETIME,@Statas,@DoUserID,@EndTime,@TEMP0,@TEMP1,@TEMP2,@TEMP3,@SpecialFundsID,@SFOrderID,@YEBalance)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CardNum",        SqlDbType.VarChar,     50),
                new SqlParameter("@CardName",       SqlDbType.VarChar,     50),
                new SqlParameter("@CardholderID",   SqlDbType.VarChar,     50),
                new SqlParameter("@DepartmentID",   SqlDbType.VarChar,     50),
                new SqlParameter("@ProjectID",      SqlDbType.Int,          4),
                new SqlParameter("@Balance",        SqlDbType.Float,        8),
                new SqlParameter("@LimitNums",      SqlDbType.Float,        8),
                new SqlParameter("@ApproverIDs",    SqlDbType.VarChar,     50),
                new SqlParameter("@DATETIME",       SqlDbType.DateTime),
                new SqlParameter("@Statas",         SqlDbType.Int,          4),
                new SqlParameter("@DoUserID",       SqlDbType.VarChar,     50),
                new SqlParameter("@EndTime",        SqlDbType.DateTime),
                new SqlParameter("@TEMP0",          SqlDbType.VarChar,   5000),
                new SqlParameter("@TEMP1",          SqlDbType.VarChar,     50),
                new SqlParameter("@TEMP2",          SqlDbType.VarChar,     50),
                new SqlParameter("@TEMP3",          SqlDbType.VarChar,     50),
                new SqlParameter("@SpecialFundsID", SqlDbType.Int,          4),
                new SqlParameter("@SFOrderID",      SqlDbType.Int,          4),
                new SqlParameter("@YEBalance",      SqlDbType.Float, 8)
            };
            parameters[0].Value  = model.CardNum;
            parameters[1].Value  = model.CardName;
            parameters[2].Value  = model.CardholderID;
            parameters[3].Value  = model.DepartmentID;
            parameters[4].Value  = model.ProjectID;
            parameters[5].Value  = model.Balance;
            parameters[6].Value  = model.LimitNums;
            parameters[7].Value  = model.ApproverIDs;
            parameters[8].Value  = model.DATETIME;
            parameters[9].Value  = model.Statas;
            parameters[10].Value = model.DoUserID;
            parameters[11].Value = model.EndTime;
            parameters[12].Value = model.TEMP0;
            parameters[13].Value = model.TEMP1;
            parameters[14].Value = model.TEMP2;
            parameters[15].Value = model.TEMP3;
            parameters[16].Value = model.SpecialFundsID;
            parameters[17].Value = model.SFOrderID;
            parameters[18].Value = model.YEBalance;
            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Dianda.Model.Cash_Cards GetModel(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 ID,CardNum,CardName,CardholderID,DepartmentID,ProjectID,Balance,LimitNums,ApproverIDs,DATETIME,Statas,DoUserID,EndTime,TEMP0,TEMP1,TEMP2,TEMP3,SpecialFundsID,SFOrderID,YEBalance from Cash_Cards ");
            strSql.Append(" where ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            Dianda.Model.Cash_Cards model = new Dianda.Model.Cash_Cards();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["ID"].ToString() != "")
                {
                    model.ID = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                model.CardNum      = ds.Tables[0].Rows[0]["CardNum"].ToString();
                model.CardName     = ds.Tables[0].Rows[0]["CardName"].ToString();
                model.CardholderID = ds.Tables[0].Rows[0]["CardholderID"].ToString();
                model.DepartmentID = ds.Tables[0].Rows[0]["DepartmentID"].ToString();
                if (ds.Tables[0].Rows[0]["ProjectID"].ToString() != "")
                {
                    model.ProjectID = int.Parse(ds.Tables[0].Rows[0]["ProjectID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Balance"].ToString() != "")
                {
                    model.Balance = decimal.Parse(ds.Tables[0].Rows[0]["Balance"].ToString());
                }
                if (ds.Tables[0].Rows[0]["LimitNums"].ToString() != "")
                {
                    model.LimitNums = decimal.Parse(ds.Tables[0].Rows[0]["LimitNums"].ToString());
                }
                model.ApproverIDs = ds.Tables[0].Rows[0]["ApproverIDs"].ToString();
                if (ds.Tables[0].Rows[0]["DATETIME"].ToString() != "")
                {
                    model.DATETIME = DateTime.Parse(ds.Tables[0].Rows[0]["DATETIME"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Statas"].ToString() != "")
                {
                    model.Statas = int.Parse(ds.Tables[0].Rows[0]["Statas"].ToString());
                }
                model.DoUserID = ds.Tables[0].Rows[0]["DoUserID"].ToString();
                if (ds.Tables[0].Rows[0]["EndTime"].ToString() != "")
                {
                    model.EndTime = DateTime.Parse(ds.Tables[0].Rows[0]["EndTime"].ToString());
                }
                model.TEMP0 = ds.Tables[0].Rows[0]["TEMP0"].ToString();
                model.TEMP1 = ds.Tables[0].Rows[0]["TEMP1"].ToString();
                model.TEMP2 = ds.Tables[0].Rows[0]["TEMP2"].ToString();
                model.TEMP3 = ds.Tables[0].Rows[0]["TEMP3"].ToString();
                if (ds.Tables[0].Rows[0]["SpecialFundsID"].ToString() != "")
                {
                    model.SpecialFundsID = int.Parse(ds.Tables[0].Rows[0]["SpecialFundsID"].ToString());
                }

                if (ds.Tables[0].Rows[0]["SFOrderID"].ToString() != "")
                {
                    model.SFOrderID = int.Parse(ds.Tables[0].Rows[0]["SFOrderID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["YEBalance"].ToString() != "")
                {
                    model.YEBalance = decimal.Parse(ds.Tables[0].Rows[0]["YEBalance"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(Dianda.Model.Cash_Cards model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Cash_Cards set ");
            strSql.Append("CardNum=@CardNum,");
            strSql.Append("CardName=@CardName,");
            strSql.Append("CardholderID=@CardholderID,");
            strSql.Append("DepartmentID=@DepartmentID,");
            strSql.Append("ProjectID=@ProjectID,");
            strSql.Append("Balance=@Balance,");
            strSql.Append("LimitNums=@LimitNums,");
            strSql.Append("ApproverIDs=@ApproverIDs,");
            strSql.Append("DATETIME=@DATETIME,");
            strSql.Append("Statas=@Statas,");
            strSql.Append("DoUserID=@DoUserID,");
            strSql.Append("EndTime=@EndTime,");
            strSql.Append("TEMP0=@TEMP0,");
            strSql.Append("TEMP1=@TEMP1,");
            strSql.Append("TEMP2=@TEMP2,");
            strSql.Append("TEMP3=@TEMP3,");
            strSql.Append("SpecialFundsID=@SpecialFundsID,");
            strSql.Append("SFOrderID=@SFOrderID,");
            strSql.Append("YEBalance=@YEBalance");
            strSql.Append(" where ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID",             SqlDbType.Int,          4),
                new SqlParameter("@CardNum",        SqlDbType.VarChar,     50),
                new SqlParameter("@CardName",       SqlDbType.VarChar,     50),
                new SqlParameter("@CardholderID",   SqlDbType.VarChar,     50),
                new SqlParameter("@DepartmentID",   SqlDbType.VarChar,     50),
                new SqlParameter("@ProjectID",      SqlDbType.Int,          4),
                new SqlParameter("@Balance",        SqlDbType.Float,        8),
                new SqlParameter("@LimitNums",      SqlDbType.Float,        8),
                new SqlParameter("@ApproverIDs",    SqlDbType.VarChar,     50),
                new SqlParameter("@DATETIME",       SqlDbType.DateTime),
                new SqlParameter("@Statas",         SqlDbType.Int,          4),
                new SqlParameter("@DoUserID",       SqlDbType.VarChar,     50),
                new SqlParameter("@EndTime",        SqlDbType.DateTime),
                new SqlParameter("@TEMP0",          SqlDbType.VarChar,   5000),
                new SqlParameter("@TEMP1",          SqlDbType.VarChar,     50),
                new SqlParameter("@TEMP2",          SqlDbType.VarChar,     50),
                new SqlParameter("@TEMP3",          SqlDbType.VarChar,     50),
                new SqlParameter("@SpecialFundsID", SqlDbType.Int,          4),
                new SqlParameter("@SFOrderID",      SqlDbType.Int,          4),
                new SqlParameter("@YEBalance",      SqlDbType.Float, 8)
            };
            parameters[0].Value  = model.ID;
            parameters[1].Value  = model.CardNum;
            parameters[2].Value  = model.CardName;
            parameters[3].Value  = model.CardholderID;
            parameters[4].Value  = model.DepartmentID;
            parameters[5].Value  = model.ProjectID;
            parameters[6].Value  = model.Balance;
            parameters[7].Value  = model.LimitNums;
            parameters[8].Value  = model.ApproverIDs;
            parameters[9].Value  = model.DATETIME;
            parameters[10].Value = model.Statas;
            parameters[11].Value = model.DoUserID;
            parameters[12].Value = model.EndTime;
            parameters[13].Value = model.TEMP0;
            parameters[14].Value = model.TEMP1;
            parameters[15].Value = model.TEMP2;
            parameters[16].Value = model.TEMP3;
            parameters[17].Value = model.SpecialFundsID;
            parameters[18].Value = model.SFOrderID;
            parameters[19].Value = model.YEBalance;
            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 点击确定触发事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_sumbit_onclick(object sender, EventArgs e)
        {
            try
            {
                //项目ID
                string projectid = Request["ID"];
                project_model = project_bll.GetModel(int.Parse(projectid.ToString()));
                Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"];
                string           checkvalue = RadioButtonList_Check.SelectedValue.ToString();
                string           flag       = "";

                string urls = "";           //接受审核通过和不通过的地址:审核通过,到项目文档中,审核不通过到只做提示

                if (checkvalue.Equals("1")) //表示审核通过
                {
                    flag = "审核通过";
                    //预算表单的审核状态
                    project_model.TEMP1 = "1";

                    //如果审核通过将上传的预算表单保存到项目的目录中
                    string    sql = "SELECT ID FROM Document_Folder WHERE (ProjectID = '" + projectid + "') AND (UpID = 38)  and delflag='0'";
                    DataTable dt  = pageControl.doSql(sql).Tables[0];

                    if (dt.Rows.Count > 0)
                    {
                        string id = dt.Rows[0]["ID"].ToString();
                        //如果审核通过将上传的预算表单保存到项目的目录中
                        if (null != project_model.BudgetList && !(project_model.BudgetList.ToString().Equals("")))
                        {
                            setAttachmentsToDocument(user_model.ID, id, project_model.BudgetList.ToString());
                        }
                    }

                    //选择资金卡
                    DataSet ds1 = cashmessage_bll.GetList(" ProjectID = " + project_model.ID);
                    DataSet ds2 = card_bll.GetList(" ProjectID = " + project_model.ID);

                    if (RB_CashCardID.Checked == true)//如果选择的是资金卡则设为资金卡的ID;
                    {
                        //如果在资金卡中以前本身就有该项目的。。则要将原来的该项目的资金卡的项目ID设空
                        if (ds2.Tables[0].Rows.Count > 0)
                        {
                            for (int i = 0; i < ds2.Tables[0].Rows.Count; i++)
                            {
                                Model.Cash_Cards card_model1 = new Dianda.Model.Cash_Cards();
                                BLL.Cash_Cards   card_bll1   = new Dianda.BLL.Cash_Cards();

                                string id = ds2.Tables[0].Rows[i]["ID"].ToString();
                                card_model1 = card_bll1.GetModel(int.Parse(id));

                                card_model1.ProjectID = null;
                                card_bll1.Update(card_model1);
                            }
                        }

                        //资金卡ID
                        string cashcardid = DDL_CashCardID.SelectedValue.ToString();
                        card_model = card_bll.GetModel(int.Parse(cashcardid));
                        //将资金卡表中的项目ID改成当前项目
                        card_model.ProjectID = int.Parse(projectid);

                        card_bll.Update(card_model);
                    }
                    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 = project_model.SendUserID.ToString();
                            //项目的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 = 1;

                            Session["Cash_Message_temps"] = cashmessage_model;

                            //向信息表中添加一条新建资金卡的记录
                            cashmessage_bll.Add(cashmessage_model);
                        }
                    }
                    BLL.Document_Folder          bllFolder  = new Dianda.BLL.Document_Folder();
                    List <Model.Document_Folder> folderlist = bllFolder.GetModelList("UpID='38' and Types='public' and ProjectID='" + projectid + "' and delflag='0'");
                    if (folderlist.Count > 0)
                    {
                        urls = "<a href='/Admin/DocumentManage/manage.aspx?CID=" + folderlist[0].COLUMNSPATH.ToString() + "&tp=1' target='_self' title='预算表单审核:审核时间" + DateTime.Now.ToString() + "'>" + project_model.NAMES.ToString() + "  预算表单  " + flag + "</a>";
                    }
                    else
                    {
                        urls = project_model.NAMES.ToString() + "  预算表单  " + flag;
                    }
                }
                else
                {
                    flag = "审核不通过";
                    //预算表单的审核状态
                    project_model.TEMP1 = "2";

                    urls = project_model.NAMES.ToString() + "  预算表单  " + flag;
                }

                project_bll.Update(project_model);


                //给业务申请者发信息
                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();//当前项目的创建人的ID
                mFaceShowMessage.URLS      = urls;

                //mFaceShowMessage.URLS = "<a href='/Admin/budgetManage/manage.aspx?role=manager&Status=" + project_model.TEMP1 + "' target='_self' title='预算表单审核:审核时间" + DateTime.Now.ToString() + "'>" + project_model.NAMES.ToString() + "  预算表单  " + flag + "</a>";

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



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


                //添加操作日志

                Dianda.BLL.SYS_LogsExt bsyslog = new Dianda.BLL.SYS_LogsExt();
                bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "预算管理", project_model.NAMES + " 预约表单" + flag);

                //添加操作日志
            }
            catch
            {
            }
        }