protected void BtnUpdate_Click(object sender, EventArgs e) { if (HiddeniD.Value == "") { DisplayMessage("Edit The Record"); DdlMonthList.Focus(); return; } int count = 0; string Status = ""; if (RbtnApproved.Checked == true) { count = 1; Status = "Approved"; } if (RbtnCancelled.Checked == true) { count = 1; Status = "Cancelled"; } if (count == 0) { DisplayMessage("Select RadioButton"); RbtnApproved.Focus(); Status = ""; return; } int UpdationCheck = 0; UpdationCheck = ObjClaim.UpdateRecord_In_Pay_Employee_Claim(Session["CompId"].ToString(), HiddeniD.Value, TxtClaimNameList.Text, TxtClaimDiscList.Text, DdlvalueTypelist.SelectedValue, Txtvaluelist.Text, DdlMonthListPanel.SelectedValue, TxtpanelYearList.Text, Status, Session["UserId"].ToString(), DateTime.Now.ToString()); if (UpdationCheck != 0) { DisplayMessage("Record Updated"); DataTable dtGrid = new DataTable(); dtGrid = ObjClaim.GetRecord_From_PayEmployeeClaim(Session["CompId"].ToString(), "0", "0", DdlMonthList.SelectedValue, TxtYear.Text, "Pending", "", ""); GridViewClaimList.DataSource = dtGrid; GridViewClaimList.DataBind(); PanelUpdateClaim.Visible = false; ResetPanel(); DdlMonthList.Focus(); } else { DisplayMessage("Record Not Updated"); } }
protected void GridViewPenaltyList_Sorting(object sender, GridViewSortEventArgs e) { HdfSort.Value = HdfSort.Value == "ASC" ? "DESC" : "ASC"; DataTable dt = new DataTable(); dt = (DataTable)Session["dtFilter"]; DataView dv = new DataView(dt); string Query = "" + e.SortExpression + " " + HdfSort.Value + ""; dv.Sort = Query; dt = dv.ToTable(); Session["dtFilter"] = dt; GridViewClaimList.DataSource = dt; GridViewClaimList.DataBind(); }
protected void IbtnDelete_command(object sender, CommandEventArgs e) { HiddeniD.Value = e.CommandArgument.ToString(); int CheckDeletion = 0; CheckDeletion = ObjClaim.DeleteRecord_in_Pay_Employee_Claim(Session["CompId"].ToString(), HiddeniD.Value, "False", Session["UserId"].ToString(), DateTime.Now.ToString()); if (CheckDeletion != 0) { DisplayMessage("Record Deleted"); DataTable dtGrid = new DataTable(); dtGrid = ObjClaim.GetRecord_From_PayEmployeeClaim(Session["CompId"].ToString(), "0", "0", DdlMonthList.SelectedValue, TxtYear.Text, "Cancelled", "", ""); GridViewClaimList.DataSource = dtGrid; GridViewClaimList.DataBind(); } else { DisplayMessage("Record Not Deleted"); } }
void GridBind_ClaimList(string Month, string Year) { DataTable Dt = new DataTable(); Dt = ObjClaim.GetRecord_From_PayEmployeeClaim(Session["CompId"].ToString(), "0", "0", Month, Year, "Pending", "", ""); if (Dt.Rows.Count > 0) { GridViewClaimList.DataSource = Dt; GridViewClaimList.DataBind(); Session["dtFilter"] = Dt; } else { Dt.Clear(); GridViewClaimList.DataSource = Dt; GridViewClaimList.DataBind(); DisplayMessage("Record Not found"); DdlMonthList.Focus(); } }