protected void btnRevert_Click(object sender, EventArgs e) { if (this.Session["SelectAll"] != null) { string str = this.Session["OFF_ID"].ToString(); Bill_Sys_BillTransaction_BO n_bo = new Bill_Sys_BillTransaction_BO(); if (n_bo.RevertStatausAll(this.txtCompanyId.Text, this.txtLoginCompanyId.Text, str, this.txtSearchBox.Text, this.txtFlag.Text) == 1) { this.usrMessage.PutMessage("Bill status updated successfully."); this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage); this.usrMessage.Show(); this.BinGrid(); } else { this.usrMessage.PutMessage("erro in transaction"); this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_ErrorMessage); this.usrMessage.Show(); } this.btnSelectAll_Click(null, null); } else { ArrayList list = new ArrayList(); for (int j = 0; j < this.grdBillSearch.Rows.Count; j++) { CheckBox box = (CheckBox)this.grdBillSearch.Rows[j].FindControl("ChkDelete"); if (box.Checked) { list.Add(this.grdBillSearch.DataKeys[j][1].ToString()); } } Bill_Sys_BillTransaction_BO n_bo2 = new Bill_Sys_BillTransaction_BO(); if (n_bo2.RevertStataus(list, this.txtLoginCompanyId.Text) == 1) { this.usrMessage.PutMessage("Bill status revert successfully."); this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage); this.usrMessage.Show(); this.grdBillSearch.XGridBindSearch(); } else { this.usrMessage.PutMessage("erro in transaction"); this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_ErrorMessage); this.usrMessage.Show(); } } this.Session["SelectAll"] = null; this.grdLitigationCompanyWise.XGridBind(); for (int i = 0; i < this.grdLitigationCompanyWise.Rows.Count; i++) { Label label = (Label)this.grdLitigationCompanyWise.Rows[i].FindControl("lblAmount"); LinkButton button = (LinkButton)this.grdLitigationCompanyWise.Rows[i].FindControl("lnkAmt"); switch (i) { case 0: case 1: label.Visible = true; button.Visible = false; break; default: label.Visible = false; button.Visible = true; break; } } }