protected void bt_Save_Click(object sender, EventArgs e)
    {
        FNA_StaffSalaryBLL bll = new FNA_StaffSalaryBLL((int)ViewState["ID"]);

        pn_detail.GetData(bll.Model);

        bll.Update();
        decimal Bounsdeduction, BonusAdd;

        #region 保存每一个员工工资情况
        foreach (GridViewRow row in gv_List.Rows)
        {
            int id = (int)gv_List.DataKeys[row.RowIndex][0];

            if (decimal.TryParse(((TextBox)row.FindControl("tbx_Bounsdeduction")).Text, out Bounsdeduction) && decimal.TryParse(((TextBox)row.FindControl("tbx_BonusAdd")).Text, out BonusAdd) && (Bounsdeduction != 0 || BonusAdd != 0))
            {
                FNA_StaffSalaryDetail detail = bll.GetDetailModel(id);
                detail.Bounsdeduction = Bounsdeduction;
                detail.BonusAdd       = BonusAdd;
                detail["Remark"]      = ((TextBox)row.FindControl("tbx_Remark")).Text;
                detail.Bonus         += detail.BonusAdd - detail.Bounsdeduction;
                bll.UpdateDetail(detail);
            }
        }
        #endregion

        if (sender != null)
        {
            MessageBox.ShowAndRedirect(this, "员工工资保存成功!", "StaffSalaryDetailList.aspx?ID=" + ViewState["ID"].ToString());
        }
        else
        {
            BindGrid();
        }
    }
    protected void bt_Save_Click(object sender, EventArgs e)
    {
        FNA_StaffSalaryBLL bll = new FNA_StaffSalaryBLL((int)ViewState["ID"]);

        pn_detail.GetData(bll.Model);

        bll.Update();
        decimal Bounsdeduction, BonusAdd;

        #region 保存每一个员工工资情况
        foreach (GridViewRow row in gv_List.Rows)
        {
            int id = (int)gv_List.DataKeys[row.RowIndex][0];

            if (decimal.TryParse(((TextBox)row.FindControl("tbx_Bounsdeduction")).Text, out Bounsdeduction) && decimal.TryParse(((TextBox)row.FindControl("tbx_BonusAdd")).Text, out BonusAdd) && (Bounsdeduction != 0 || BonusAdd != 0))
            {
                FNA_StaffSalaryDetail detail = bll.GetDetailModel(id);
                detail.Bounsdeduction = Bounsdeduction;
                detail.BonusAdd = BonusAdd;
                detail["Remark"] = ((TextBox)row.FindControl("tbx_Remark")).Text;
                detail.Bonus += detail.BonusAdd - detail.Bounsdeduction;
                bll.UpdateDetail(detail);
            }

        }
        #endregion

        if (sender != null)
            MessageBox.ShowAndRedirect(this, "员工工资保存成功!", "StaffSalaryDetailList.aspx?ID=" + ViewState["ID"].ToString());
        else
            BindGrid();
    }