示例#1
0
    protected void btnMinus_Click(object sender, EventArgs e)
    {
        List <ReportFee> select = new List <ReportFee>();

        if (!(this.gvSelectedFeeList.Rows.Count == 1 && this.gvSelectedFeeList.Rows[0].Cells[0].Text == SalaryConst.EmptyText))
        {
            for (Int32 i = 0; i < this.gvSelectedFeeList.Rows.Count; i++)
            {
                CheckBox ckb = (CheckBox)this.gvSelectedFeeList.Rows[i].FindControl("ckbSelect");
                if (ckb.Checked)
                {
                    ReportFee info = new ReportFee();
                    info.ReportID = reportID;
                    info.FeeID    = this.gvSelectedFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString();
                    info.FeeName  = this.gvSelectedFeeList.DataKeys[i].Values[FeeInfoConst.FeeName].ToString();
                    select.Add(info);
                }
            }
        }
        if (select.Any())
        {
            ReportInfoAdapter.Instance.DeleteReportFee(select);
            this.GridViewDataBind();
        }
    }
示例#2
0
    protected void gvSelectedFeeList_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        TextBox tbOrderNO       = (TextBox)this.gvSelectedFeeList.Rows[e.RowIndex].FindControl("tbOrderNO");
        TextBox tbReportFeeName = (TextBox)this.gvSelectedFeeList.Rows[e.RowIndex].FindControl("tbReportFeeName");
        String  OrderNO         = tbOrderNO.Text.Trim();
        String  ReportFeeName   = tbReportFeeName.Text;

        if (string.IsNullOrEmpty(OrderNO) || !StrHelper.IsValidDecimal(OrderNO))
        {
            base.MessageBox("排序必须为数字!");
            tbOrderNO.Focus();
            return;
        }
        if (string.IsNullOrEmpty(ReportFeeName))
        {
            base.MessageBox("请填写报表列名!");
            tbReportFeeName.Focus();
            return;
        }
        ReportFee reportFeeInfo = ReportInfoAdapter.Instance.LoadReportFee(this.reportID, this.gvSelectedFeeList.DataKeys[e.RowIndex][ReportFeeConst.FeeID].ToString());

        reportFeeInfo.OrderNo       = Int32.Parse(OrderNO);
        reportFeeInfo.ReportFeeName = ReportFeeName;
        ReportInfoAdapter.Instance.UpdateReportFee(reportFeeInfo);
        this.gvSelectedFeeList.EditIndex = -1;
        this.GridViewDataBind();
    }
示例#3
0
    protected void btnAddAll_Click(object sender, EventArgs e)
    {
        List <ReportFee> select = new List <ReportFee>();

        if (!(this.gvFeeList.Rows.Count == 1 && this.gvFeeList.Rows[0].Cells[0].Text == SalaryConst.EmptyText))
        {
            for (Int32 i = 0; i < this.gvFeeList.Rows.Count; i++)
            {
                ReportFee info = new ReportFee();
                info.ReportID = reportID;
                info.FeeID    = this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString();
                info.FeeName  = this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeName].ToString();
                //info.OrderNo = Int32.Parse(this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString());
                select.Add(info);
            }
        }
        if (select.Any())
        {
            ReportInfoAdapter.Instance.InsertReportFee(select);
            this.GridViewDataBind();
        }
    }