예제 #1
0
        /// <summary>
        /// 点击恢复按钮触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_recover_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");
                        string id = GridView1.DataKeys[j]["ID"].ToString();
                        if (cb1.Checked)
                        {
                            mCash_Cards        = new Dianda.Model.Cash_Cards();
                            mCash_Cards        = bCash_Cards.GetModel(Int32.Parse(id));
                            mCash_Cards.Statas = 1;
                            bCash_Cards.Update(mCash_Cards);

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


                            // 添加操作日志
                            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 + ")", "恢复资金卡" + mCash_Cards.CardNum /*Request["tags"].ToString()*/, "恢复资金卡成功");

                            string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?pageindex=" + Request["pageindex"] + "\";</script>";
                            Response.Write(coutws);
                        }
                    }
                }
            }
        }
 /// <summary>
 /// 根据资金卡的ID,获取到资金卡明细的列表
 /// </summary>
 /// <param name="CardID"></param>
 private void showList(string CardID)
 {
     try
     {
         if (!string.IsNullOrEmpty(CardID))
         {
             Cards_model       = Cards_bll.GetModel(int.Parse(CardID));
             TB_Balance.Text   = Cards_model.Balance.ToString();
             TB_LimitNums.Text = Cards_model.LimitNums.ToString();
         }
     }
     catch
     {
     }
 }
예제 #3
0
        /// <summary>
        /// 初始化显面信息
        /// </summary>
        /// <param name="id"></param>
        protected void ShowInitInfo(string id)
        {
            try
            {
                Cards_model = Cards_bll.GetModel(int.Parse(id));
                //资金卡编号
                TB_CardNum.Text = Cards_model.CardNum.ToString();
                //资金卡名称
                txtCardName.Text = Cards_model.CardName.ToString();
                //所属项目
                ddlProjectID.SelectedValue = Cards_model.ProjectID.ToString();
                //所属预算报告
                DDL_Budget.SelectedValue = Cards_model.SFOrderID.ToString();
                //所属部门
                ddlDepartmentID.SelectedValue = Cards_model.DepartmentID.ToString();
                //持卡人
                ddlCardholderID.SelectedValue = Cards_model.CardholderID.ToString();
                //到期时间
                TB_DateTime.Value = Convert.ToDateTime(Cards_model.EndTime.ToString()).ToString("yyyy-MM-dd");
                //审批人
                ddlApproverIDs.SelectedValue = Cards_model.ApproverIDs.ToString();
                //初始化资金卡详细

                Balance   = Cards_model.Balance.ToString();
                LimitNums = Cards_model.LimitNums.ToString();
                Cardsid   = Cards_model.ID.ToString();
                ShowCash_CarDetailMX();

                string    sql = "select ID from dbo.Cash_Apply where CashCertificateID='" + id + "' union all select ID from dbo.Cash_Apply_History where CashCertificateID='" + id + "'";
                DataTable dt  = pageControl.doSql(sql).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    //付全文    2013-4-12   不管是否记账,开放资金卡细目明细及可用金额修改
                    //string msg = "已有记账明细或经费预约,不能进行编辑!";
                    //tag.Text = msg;
                    //tag2.Text = msg;
                    //Button_sumbit.Visible = false;
                }
                else
                {
                    tag.Text              = "";
                    tag2.Text             = "";
                    Button_sumbit.Visible = true;
                }
            }
            catch
            { }
        }
예제 #4
0
        /// <summary>
        /// 加载所属部门信息
        /// </summary>
        private void GetddlDepartmentID()
        {
            DataTable dt  = new DataTable();
            string    sql = "SELECT ID,[Name] FROM USER_Groups WHERE DELFLAG=0 and Tags='部门' group by ID,[Name]";

            dt = pageControl.doSql(sql).Tables[0];
            if (dt.Rows.Count > 0)
            {
                this.ddlDepartmentID.DataSource     = dt;
                this.ddlDepartmentID.DataTextField  = "Name";
                this.ddlDepartmentID.DataValueField = "ID";
                this.ddlDepartmentID.DataBind();

                Cards_model = Cards_bll.GetModel(int.Parse(id));
                ddlDepartmentID.SelectedValue = Cards_model.DepartmentID;
            }
        }
        /// <summary>
        /// 根据资金卡的ID,获取到资金卡明细的列表
        /// </summary>
        /// <param name="CardID"></param>
        private void showList(string CardID)
        {
            try
            {
                Label_TOTAL.Text = "0";
                bool isnew = true;//是否是新的
                if (String.IsNullOrEmpty(CardID))
                {
                }
                else
                {
                    ViewState["_cardID_tcl_control"] = CardID;//要处理的资金卡的ID

                    DataSet ds = bllCardDetail.GetList("CardID='" + CardID + "' order by ID ASC");
                    if (ds != null)
                    {
                        if (ds.Tables[0] != null)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                ViewState["_isModifyControl_tcl"] = "1";//1表示是修改明细列表
                                //已经保存过数据了。直接赋值
                                GridView1.DataSource = ds.Tables[0];
                                GridView1.DataBind();
                                isnew             = false;
                                Cards_model       = Cards_bll.GetModel(int.Parse(CardID));
                                TB_Balance.Text   = Cards_model.Balance.ToString();
                                TB_LimitNums.Text = Cards_model.LimitNums.ToString();
                                getBili();//获取比例值
                            }
                        }
                    }
                }
                if (isnew)
                {
                    showDetailList();
                }
            }
            catch
            {
            }
        }
예제 #6
0
        /// <summary>
        ///点击确定按钮触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_sumbit_Click(object sender, EventArgs e)
        {
            try
            {
                string NAME = this.txtCardName.Text;//获取到资金卡名称
                if (String.IsNullOrEmpty(NAME))
                {
                    tag.Text = "名称不能为空,请填写名称!";
                    return;
                }
                bool checkName = bCash_CardsExt.Exists(NAME);
                if (checkName)
                {
                    tag.Text = "该名称已经存在,请修改!";
                    return;
                }
                if (string.IsNullOrEmpty(TB_DateTime.Value) || DateTime.Parse(TB_DateTime.Value) < DateTime.Parse(DateTime.Now.ToLongDateString()))
                {
                    tag.Text = "到期日期必须大于或等于当前日期";
                    return;
                }
                if (!Cash_CarDetailMX1.ReturnTnF())
                {
                    tag.Text = "未添加明细,请添加!";
                    return;
                }

                int       intMaxID = bCash_Cards.GetMaxId();
                int       ZJK      = 0;
                DataTable dt       = new DataTable();
                dt = bCash_Cards.GetList("Statas=0 or Statas=1").Tables[0];
                if (dt.Rows.Count > 0)
                {
                    ZJK = dt.Rows.Count;
                }
                mCash_Cards    = new Dianda.Model.Cash_Cards();
                mCash_Cards.ID = intMaxID;

                string time = DateTime.Now.ToString("yyyyMMdd");
                //资金卡编号
                mCash_Cards.CardNum = "zjk" + time + ZJK.ToString("0000");
                //资金卡名称
                mCash_Cards.CardName = NAME;
                //所属项目
                mCash_Cards.ProjectID = Int32.Parse(this.ddlProjectID.SelectedValue);

                //所属预算报告
                mCash_Cards.SFOrderID = int.Parse(DDL_Budget.SelectedValue.ToString());
                //所属部门
                mCash_Cards.DepartmentID = this.ddlDepartmentID.SelectedValue;
                //持卡人
                mCash_Cards.CardholderID = this.ddlCardholderID.SelectedValue;
                //到期时间
                mCash_Cards.EndTime = DateTime.Parse(TB_DateTime.Value);
                //审批人
                mCash_Cards.ApproverIDs = this.ddlApproverIDs.SelectedValue;
                //创建日期
                mCash_Cards.DATETIME = DateTime.Now;
                //状态
                mCash_Cards.Statas = 1;
                //创建人
                mCash_Cards.DoUserID = ((Model.USER_Users)Session["USER_Users"]).USERNAME;
                //新建时,可用金额和预算金额及当前余额都是一样
                decimal Balance = decimal.Parse(Cash_CarDetailMX1.Balance);
                //预算金额
                mCash_Cards.Balance = Balance;
                //可用金额
                mCash_Cards.LimitNums = Balance;
                //当前余额
                mCash_Cards.YEBalance = Balance;

                int carid = bCash_CardsExt.Add(mCash_Cards);

                Cash_CarDetailMX1.Submit(carid);
                /*-------------------资金卡明细----------begin--------*/
                //开始操作资金卡明细信息
                //GridView GV = Cash_CarDetailList.GV1;
                //if (GV.Rows.Count > 0)
                //{
                //    Model.Cash_CardsDetail cardsdetail_model = new Dianda.Model.Cash_CardsDetail();
                //    BLL.Cash_CardsDetail cardsdetail_bll = new Dianda.BLL.Cash_CardsDetail();
                //    for (int i = 0; i < GV.Rows.Count; i++)
                //    {
                //        HiddenField HF_DetailID = (HiddenField)GV.Rows[i].FindControl("HiddenField_deid");
                //        TextBox TB_balance = (TextBox)GV.Rows[i].FindControl("TextBox_balance");
                //        DropDownList DropDownList_Unit = (DropDownList)GV.Rows[i].FindControl("DropDownList_Unit");
                //        int Unit = int.Parse(DropDownList_Unit.SelectedValue.ToString());
                //        RadioButtonList RadioButtonList_typename = (RadioButtonList)GV.Rows[i].FindControl("RadioButtonList_typename");
                //        //ID
                //        cardsdetail_model.ID = cardsdetail_bll.GetMaxId();
                //        //资金卡ID
                //        cardsdetail_model.CardID = carid;
                //        //明细项目的ID
                //        cardsdetail_model.DetailID = int.Parse(HF_DetailID.Value.ToString());

                //        //在新建资金卡时,预算金额、可用金额、当前余额都是一样的

                //        //各明细项的当前余额
                //        cardsdetail_model.Balance = decimal.Parse(TB_balance.Text.ToString()) * Unit;
                //        //预算金额
                //        cardsdetail_model.Oldbalance = decimal.Parse(TB_balance.Text.ToString()) * Unit;
                //        //可用金额
                //        cardsdetail_model.KYbalance = decimal.Parse(TB_balance.Text.ToString()) * Unit;

                //        //单位
                //        cardsdetail_model.Unit = Unit;
                //        //细目的类型
                //        cardsdetail_model.TypesName = RadioButtonList_typename.SelectedValue.ToString();

                //        cardsdetail_bll.Add(cardsdetail_model);
                //    }
                //}
                /*-------------------资金卡明细----------begin--------*/

                /*---------------------一旦为某一个预算报告新创建了一个新的资金卡,就要在预算报告的资金卡数量上加1 -----------begin--------------*/

                BLL.Cash_SF_Order   order_bll   = new Dianda.BLL.Cash_SF_Order();
                Model.Cash_SF_Order order_model = new Dianda.Model.Cash_SF_Order();

                string SFOrderID = mCash_Cards.SFOrderID.ToString();
                order_model = order_bll.GetModel(int.Parse(SFOrderID));
                //资金卡数量加1
                order_model.CarNums = order_model.CarNums + 1;
                order_bll.Update(order_model);

                /*---------------------一旦为某一个预算报告新创建了一个新的资金卡,就要在预算报告的资金卡数量上加1---------------end------------*/

                Cash_CarDetailMX1.main(carid.ToString());
                tag.Text                   = "操作成功!";
                tag2.Text                  = "操作成功!";
                this.lblCardNum.Text       = mCash_Cards.CardNum;
                this.Button_sumbit.Visible = false;
                //this.Button_reset.Visible = false;
                //string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx" + "\";</script>";
                //Response.Write(coutws);

                //添加操作日志
                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 + ")", "新增资金卡", "新增资金卡" + mCash_Cards.CardNum + "成功");

                //添加操作日志
                string coutws = "alert(\"操作成功!现在返回列表页面\"); ";
                coutws += "location.href = \"manage.aspx?pageindex=" + Request["pageindex"] + "\";";

                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "addScript", coutws, true);
            }
            catch
            {
                tag.Text = "操作失败,请重试!";
            }
        }
예제 #7
0
        /// <summary>
        ///点击确定按钮触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_sumbit_Click(object sender, EventArgs e)
        {
            try
            {
                string NAME = this.txtCardName.Text;//获取到资金卡名称
                if (String.IsNullOrEmpty(NAME))
                {
                    tag.Text = "名称不能为空,请填写名称!";
                    return;
                }

                if (string.IsNullOrEmpty(TB_DateTime.Value) || DateTime.Parse(TB_DateTime.Value) < DateTime.Parse(DateTime.Now.ToLongDateString()))
                {
                    tag.Text = "到期日期必须大于或等于当前日期";
                    return;
                }
                if (!Cash_CarDetailMX1.ReturnTnF())
                {
                    tag.Text = "未添加明细,请添加!";
                    return;
                }

                Cards_model = Cards_bll.GetModel(Int32.Parse(id));
                //资金卡名称
                Cards_model.CardName = NAME;
                //所属项目
                Cards_model.ProjectID = Int32.Parse(this.ddlProjectID.SelectedValue);
                //所属预算报告
                Cards_model.SFOrderID = int.Parse(DDL_Budget.SelectedValue.ToString());
                //所属部门
                Cards_model.DepartmentID = this.ddlDepartmentID.SelectedValue;
                //持卡人
                Cards_model.CardholderID = this.ddlCardholderID.SelectedValue;
                //到期时间
                Cards_model.EndTime = DateTime.Parse(TB_DateTime.Value);
                //审批人
                Cards_model.ApproverIDs = this.ddlApproverIDs.SelectedValue;
                //创建日期
                Cards_model.DATETIME = DateTime.Now;
                //状态
                Cards_model.Statas = 1;
                //创建人
                Cards_model.DoUserID = ((Model.USER_Users)Session["USER_Users"]).USERNAME;
                //原可用金额
                string oldLimitNums = Cards_model.LimitNums.ToString();
                //调整后的可用金额
                string newLimitNums = Cash_CarDetailMX1.LimitNums;
                //差额
                decimal cj = decimal.Parse(newLimitNums) - decimal.Parse(oldLimitNums);
                if (cj > 0)
                {
                    //当前余额(可用金额增加或减少多少,当前余额对应的调整)
                    Cards_model.YEBalance = Cards_model.YEBalance + cj;

                    Cards_model.TEMP0 = Cards_model.TEMP0 + "&nbsp;&nbsp;" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + ",增加" + cj + "元,可用金额由" + oldLimitNums + "元调整为" + newLimitNums + "元<br>";
                }
                else
                {
                    cj = decimal.Parse(oldLimitNums) - decimal.Parse(newLimitNums);

                    //当前余额(可用金额增加或减少多少,当前余额对应的调整)
                    Cards_model.YEBalance = Cards_model.YEBalance - cj;

                    Cards_model.TEMP0 = Cards_model.TEMP0 + "&nbsp;&nbsp;" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + ",减少" + cj + "元,可用金额由" + oldLimitNums + "元调整为" + newLimitNums + "元<br>";
                }
                //可用金额
                Cards_model.LimitNums = decimal.Parse((newLimitNums));
                //预算金额
                Cards_model.Balance = decimal.Parse((Cash_CarDetailMX1.Balance));

                Cards_bll.Update(Cards_model);

                Cash_CarDetailMX1.CJ = cj;
                Cash_CarDetailMX1.Submit(int.Parse(id));

                /*-------------------资金卡明细----------begin-----------------------*/
                //开始操作资金卡明细信息
                //GridView GV = Cash_CarDetailList.GV1;
                //if (GV.Rows.Count > 0)
                //{
                //    Model.Cash_CardsDetail cardsdetail_model = new Dianda.Model.Cash_CardsDetail();
                //    BLL.Cash_CardsDetail cardsdetail_bll = new Dianda.BLL.Cash_CardsDetail();
                //    for (int i = 0; i < GV.Rows.Count; i++)
                //    {
                //        HiddenField HF_ID = (HiddenField)GV.Rows[i].FindControl("HiddenField_ID");

                //        HiddenField HF_DetailID = (HiddenField)GV.Rows[i].FindControl("HiddenField_deid");
                //        TextBox TB_balance = (TextBox)GV.Rows[i].FindControl("TextBox_balance");
                //        DropDownList DropDownList_Unit = (DropDownList)GV.Rows[i].FindControl("DropDownList_Unit");
                //        int Unit = int.Parse(DropDownList_Unit.SelectedValue.ToString());
                //        RadioButtonList RadioButtonList_typename = (RadioButtonList)GV.Rows[i].FindControl("RadioButtonList_typename");

                //        cardsdetail_model = cardsdetail_bll.GetModel(int.Parse(HF_ID.Value.ToString()));
                //        //资金卡ID
                //        cardsdetail_model.CardID =int.Parse(id);
                //        //明细项目的ID
                //        cardsdetail_model.DetailID = int.Parse(HF_DetailID.Value.ToString());


                //        //编辑时,预算金额不变,还是最初始的值,但是可用金额有可能被调整了。。那么当前余额也要对应增加或减

                //        //当前余额 (可用金额调整额度是多少,就要在原来的当前余额基础上加减多少)
                //        if (cj > 0)
                //        {
                //            //首先获得可用金额调整的差值
                //            decimal cz = decimal.Parse(TB_balance.Text.ToString()) * Unit - decimal.Parse(cardsdetail_model.KYbalance.ToString());
                //            cardsdetail_model.Balance = cardsdetail_model.Balance + cz;
                //        }
                //        else
                //        {
                //            //首先获得可用金额调整的差值
                //            decimal cz = decimal.Parse(cardsdetail_model.KYbalance.ToString()) - decimal.Parse(TB_balance.Text.ToString()) * Unit;
                //            cardsdetail_model.Balance = cardsdetail_model.Balance - cz;
                //        }
                //        //可用金额
                //        cardsdetail_model.KYbalance = decimal.Parse(TB_balance.Text.ToString()) * Unit;
                //        //单位
                //        cardsdetail_model.Unit = Unit;
                //        //细目的类型
                //        cardsdetail_model.TypesName = RadioButtonList_typename.SelectedValue.ToString();

                //        cardsdetail_bll.Update(cardsdetail_model);
                //    }
                //}
                /*-------------------资金卡明细----------begin-------------------------------*/

                tag.Text                   = "操作成功!";
                tag2.Text                  = "操作成功!";
                this.TB_CardNum.Text       = Cards_model.CardNum.ToString();
                this.Button_sumbit.Visible = false;

                //添加操作日志
                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 + ")", "编辑资金卡", "编辑资金卡" + Cards_model.CardNum + "成功");
                //添加操作日志

                string coutws = "alert(\"操作成功!现在返回列表页面\"); ";
                coutws += "location.href = \"manage.aspx?pageindex=" + Request["pageindex"] + "&role=manage\";";

                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "addScript", coutws, true);
            }
            catch
            {
                tag.Text = "操作失败,请重试!";
            }
        }
예제 #8
0
        /// <summary>
        ///点击确定按钮触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_sumbit_Click(object sender, EventArgs e)
        {
            try
            {
                // string NAME = this.txtControlInfo.Text;//获取到资金卡名称

                //资金调整说明
                string  NAME  = "";
                decimal money = 0;

                foreach (GridViewRow item in GridView1.Rows)
                {
                    Label       la          = (Label)item.FindControl("Label_Name");
                    TextBox     tx          = (TextBox)item.FindControl("txtBalance");
                    Label       lb          = (Label)item.FindControl("LB_Balance");
                    HiddenField HF_DetailID = (HiddenField)item.FindControl("HF_DetailID");
                    string      ID          = GridView1.DataKeys[item.RowIndex].Value.ToString();
                    string      cashmoney   = "";

                    Model.Cash_CardsDetail CardDetail_model = new Dianda.Model.Cash_CardsDetail();
                    BLL.Cash_CardsDetail   CardDetail_bll   = new Dianda.BLL.Cash_CardsDetail();
                    CardDetail_model = CardDetail_bll.GetModel(int.Parse(HF_DetailID.Value));

                    if (rblDoType.SelectedValue == "2")
                    {
                        //if (double.Parse(tx.Text.ToString()) > double.Parse(lb.Text.ToString()))
                        //{
                        //    tag.Text = la.Text + "减少的金额不能大于可用金额!";
                        //    tag2.Text = la.Text + "减少的金额不能大于可用金额!";
                        //    return;
                        //}

                        if (decimal.Parse(tx.Text) == 0)
                        {
                            cashmoney = tx.Text;
                        }
                        else
                        {
                            cashmoney = "-" + tx.Text;
                        }
                        //在原来该细目的可用金额基础上减去输入的值 
                        CardDetail_model.Balance = Decimal.Parse(CardDetail_model.Balance.ToString()) - Decimal.Parse(tx.Text.ToString());
                        CardDetail_bll.Update(CardDetail_model);
                    }
                    else
                    {
                        cashmoney = tx.Text;
                        //在原来该细目的可用金额基础上加上输入的值 
                        CardDetail_model.Balance = Decimal.Parse(CardDetail_model.Balance.ToString()) + Decimal.Parse(tx.Text.ToString());
                        CardDetail_bll.Update(CardDetail_model);
                    }

                    NAME  += ID + "," + la.Text + "," + cashmoney + "|";
                    money += decimal.Parse(tx.Text);
                }
                NAME = NAME.Remove(NAME.LastIndexOf("|"));
                if (String.IsNullOrEmpty(NAME))
                {
                    tag.Text  = "调整说明不能为空,请填写调整说明!";
                    tag2.Text = "调整说明不能为空,请填写调整说明!";
                    return;
                }
                mCash_Cards         = new Dianda.Model.Cash_Cards();
                mCash_Cards         = bCash_Cards.GetModel(Int32.Parse(common.cleanXSS(Request["ID"]))); //Cash_Cards的ID)
                mCash_Apply_History = new Dianda.Model.Cash_Apply_History();
                mCash_Apply_History.CashCertificateID = Int32.Parse(common.cleanXSS(Request["ID"]));     //Cash_Cards的ID
                //mCash_Apply_History.ControlInfo = this.txtControlInfo.Text;
                //资金调整说明
                mCash_Apply_History.ControlInfo = NAME;
                if (this.rblDoType.SelectedValue == "1")//增加
                {
                    mCash_Apply_History.Balance = Decimal.Parse(this.lblLimitNums.Text) + money;
                }
                else//减少
                {
                    mCash_Apply_History.Balance = Decimal.Parse(this.lblLimitNums.Text) - money;
                }
                mCash_Apply_History.DATETIME = DateTime.Now;
                mCash_Apply_History.DoUser   = ((Model.USER_Users)Session["USER_Users"]).USERNAME;
                mCash_Apply_History.DoType   = rblDoType.SelectedValue == "1" ? "增加" + money + "元" : "减少" + money + "元";
                mCash_Apply_History.NOTES    = TextBox1.Text;
                bCash_Apply_History.Add(mCash_Apply_History);

                string oldLimitNums = mCash_Cards.LimitNums.ToString();
                //要在对应的资金卡中增加或是减少的可用金额
                if (this.rblDoType.SelectedValue == "1")//增加
                {
                    mCash_Cards.YEBalance = (mCash_Cards.YEBalance + money);
                    //mCash_Cards.TEMP0 = mCash_Cards.TEMP0 + "&nbsp;&nbsp;" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + ",增加" + money + "元,可用金额由" + oldLimitNums + "元调整为" + mCash_Cards.LimitNums + "元<br> ";
                }
                else//减少
                {
                    mCash_Cards.YEBalance = (mCash_Cards.YEBalance - money);
                    //mCash_Cards.TEMP0 = mCash_Cards.TEMP0 + "&nbsp;&nbsp;" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + ",减少" + money + "元,可用金额由" + oldLimitNums + "元调整为" + mCash_Cards.LimitNums + "元<br> ";
                }
                bCash_Cards.Update(mCash_Cards);
                //this.ucshow1.BindData();
                Read_Data(common.cleanXSS(Request["id"].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_Cards.CardholderID;
                mFaceShowMessage.DELFLAG   = 0;
                mFaceShowMessage.URLS      = ((Model.USER_Users)Session["USER_Users"]).REALNAME + "(" + ((Model.USER_Users)Session["USER_Users"]).USERNAME.ToString() + ")调整了您的资金卡[" + mCash_Cards.CardName + "]!<a href='/Admin/cashCardManage/showHistory.aspx?id=" + Request["ID"] + "' target='_self' title='操作记录查看'>点击查看</a>";
                bFaceShowMessage.Add(mFaceShowMessage);
                /*给业务申请者发信息*/

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

                //添加操作日志
                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 + ")", "资金卡调整", "资金卡" + ((rblDoType.SelectedValue == "1") ? "增加" : "减少") + money + "成功");
                //添加操作日志

                if (((Button)sender).ID == "Button_sumbit")
                {
                    string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入明细页面\"); ";
                    if (PageStr == "add")
                    {
                        coutws += "location.href = \"" + _PageAdd1 + ReturnCS() + "\";</script>";
                    }
                    else
                    {
                        coutws += "location.href = \"showHistory.aspx?id=" + common.cleanXSS(Request["id"]) + "&PageRole=manage\";</script>";
                    }
                    Response.Write(coutws);
                }
                else
                {
                    //foreach (GridViewRow item1 in GridView1.Rows)
                    //{
                    //    TextBox tx = (TextBox)item1.FindControl("txtBalance");
                    //    tx.Text = "0";

                    //}
                    ShowDDLControlInfo(common.cleanXSS(Request["id"]));
                    TextBox1.Text = "";
                    //tag.Text = "";
                }
            }
            catch
            {
                tag.Text  = "操作失败,请重试!";
                tag2.Text = "操作失败,请重试!";
            }
        }