protected void btn_Salary_AddRate_Click(object sender, EventArgs e) { PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]); PM_SalaryLevelDetail item=new PM_SalaryLevelDetail(); item.Complete1 = decimal.Parse(this.txt_kswcl.Text); item.Complete2 = decimal.Parse(this.txt_jzwcl.Text); item.Rate = decimal.Parse(this.txt_tcxs.Text); bll.AddDetail(item); this.txt_kswcl.Text = this.txt_jzwcl.Text; this.txt_tcxs.Text = ""; this.txt_jzwcl.Text = ""; BindData(); }
protected void btn_del_levelRate_Click(object sender, EventArgs e) { foreach (GridViewRow gr in ud_grid_salary.Rows) { if (((CheckBox)gr.FindControl("chk_ID")).Checked == true) { int id = int.Parse(ud_grid_salary.DataKeys[gr.RowIndex]["PM_SalaryLevelDetail_ID"].ToString()); PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]); PM_SalaryLevelDetail pm = new PM_SalaryLevelDetail(); bll.DeleteDetail(id); //ListTable<PM_SalaryLevelDetail> _details = ViewState["Details"] as ListTable<PM_SalaryLevelDetail>; //_details.Remove(id.ToString()); //ViewState["Details"] = _details; //PM_SalaryLevelBLL bll = new PM_SalaryLevelBLL((int)ViewState["ID"]); //bll.Model.ID = (int)ViewState["ID"]; ////PM_SalaryLevelDetail iitem = new PM_SalaryLevelDetail(int.Parse(ud_grid.DataKeys[gr.RowIndex]["ID"].ToString())); //bll.DeleteDetail(); } } BindData(); }