//Delete Planhier table protected void DeleteRecordBen(object sender, GridViewDeleteEventArgs e) { lblErrBen.Text = ""; GridViewRow row = (GridViewRow)grdvBen.Rows[e.RowIndex]; int _phid = Int32.Parse(grdvBen.DataKeys[e.RowIndex].Value.ToString()); planhierRecord delRec = new planhierRecord(); Label _glbl = (Label)row.FindControl("lblGrp"); Label _tlbl = (Label)row.FindControl("lblTier"); Label _plbl = (Label)row.FindControl("lblPlancd"); Label _dlbl = (Label)row.FindControl("lblDesc"); Label _ylbl = (Label)row.FindControl("lblYrmo"); delRec.PlanGroup = _glbl.Text; delRec.TierCode = _tlbl.Text; delRec.PlanCode = _plbl.Text; delRec.PlanDesc = _dlbl.Text; delRec.EffYrmo = _ylbl.Text; try { BenhierDAL.deletePlanhier(_phid); auditDeleteBen(delRec, _phid, ddlProgCd.SelectedItem.Value); //ddlEffYrmo.DataBind(); //ddlProgCd.DataBind(); bindResult(); } catch (Exception ex) { lblErrBen.Text = ex.Message; } }
//Update Planhier table protected void UpdateRecordBen(object sender, GridViewUpdateEventArgs e) { lblErrBen.Text = ""; GridViewRow row = (GridViewRow)grdvBen.Rows[e.RowIndex]; int _phid = Int32.Parse(grdvBen.DataKeys[e.RowIndex].Value.ToString()); DropDownList _grpDDLU = (DropDownList)row.FindControl("ddlGrp"); DropDownList _tierDDLU = (DropDownList)row.FindControl("ddlTier"); TextBox _planTxtU = (TextBox)row.FindControl("txtPlancd"); TextBox _dscTxtU = (TextBox)row.FindControl("txtDesc"); TextBox _yrmoTxtU = (TextBox)row.FindControl("txtYrmo"); string _grp = _grpDDLU.SelectedItem.Text; string _tier = _tierDDLU.SelectedItem.Text; string _plan = _planTxtU.Text; string _dsc = _dscTxtU.Text; string _yrmoeff = _yrmoTxtU.Text; string _bid = ddlProgCd.SelectedItem.Value; planhierRecord oldValues = BenhierDAL.oldplanhierValues(_phid); try { BenhierDAL.updatePlanhier(_phid, _grp, _plan, _dsc, _tier, _yrmoeff); auditUpdateBen(oldValues, _phid, _grp, _tier, _plan, _dsc, _yrmoeff, _bid); grdvBen.EditIndex = -1; bindResult(); } catch (Exception ex) { lblErrBen.Text = ex.Message; } }
protected void auditDeleteBen(planhierRecord dValues, int _pid, string _progmcd) { Session["taskId"] = Convert.ToInt32(Session["taskId"]) + 1; Audit.auditUserTask(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "IPBA", "Benefit Hierarchy", "NRC", "Delete", "Planhier", "ph_plangrp", _pid.ToString(), _progmcd, dValues.PlanGroup, ""); Audit.auditUserTask(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "IPBA", "Benefit Hierarchy", "NRC", "Delete", "Planhier", "ph_plancd", _pid.ToString(), _progmcd, dValues.PlanCode, ""); Audit.auditUserTask(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "IPBA", "Benefit Hierarchy", "NRC", "Delete", "Planhier", "ph_plandesc", _pid.ToString(), _progmcd, dValues.PlanDesc, ""); Audit.auditUserTask(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "IPBA", "Benefit Hierarchy", "NRC", "Delete", "Planhier", "ph_tiercd", _pid.ToString(), _progmcd, dValues.TierCode, ""); Audit.auditUserTask(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "IPBA", "Benefit Hierarchy", "NRC", "Delete", "Planhier", "ph_yrmo", _pid.ToString(), _progmcd, dValues.EffYrmo, ""); }
protected void auditUpdateBen(planhierRecord oValues, int _pid, string _grp1, string _tier1, string _plan1, string _dsc1, string _yrm1, string _bid) { Session["taskId"] = Convert.ToInt32(Session["taskId"]) + 1; if (!oValues.PlanGroup.Equals(_grp1)) { Audit.auditUserTask(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "IPBA", "Benefit Hierarchy", "NRC", "Update", "Planhier", "ph_plangrp", _pid.ToString(), _bid.ToString(), oValues.PlanGroup, _grp1); } if (!oValues.PlanCode.Equals(_plan1)) { Audit.auditUserTask(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "IPBA", "Benefit Hierarchy", "NRC", "Update", "Planhier", "ph_plancd", _pid.ToString(), _bid.ToString(), oValues.PlanCode, _plan1); } if (!oValues.PlanDesc.Equals(_dsc1)) { Audit.auditUserTask(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "IPBA", "Benefit Hierarchy", "NRC", "Update", "Planhier", "ph_plandesc", _pid.ToString(), _bid.ToString(), oValues.PlanDesc, _dsc1); } if (!oValues.TierCode.Equals(_tier1)) { Audit.auditUserTask(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "IPBA", "Benefit Hierarchy", "NRC", "Update", "Planhier", "ph_tiercd", _pid.ToString(), _bid.ToString(), oValues.TierCode, _tier1); } if (!oValues.EffYrmo.Equals(_yrm1)) { Audit.auditUserTask(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "IPBA", "Benefit Hierarchy", "NRC", "Update", "Planhier", "ph_yrmo", _pid.ToString(), _bid.ToString(), oValues.EffYrmo, _yrm1); } }