public static DataTable GetLawyerCount(ATTLawyerCount cnt) { string SQL; if (cnt.Type == LawyerType.NepalBarAssociation) { SQL = "select * from VW_LAWYER_TYPE_WISE_CNT where 1 = 1 "; } else { SQL = "select * from VW_UNIT_LAWYER_TYPE_WISE_CNT where 1 = 1 "; } if (cnt.LawyerTypeID > 0) { SQL = SQL + " and lawyer_type_id = " + cnt.LawyerTypeID; } if (cnt.UnitID > 0) { SQL = SQL + " and unit_id = " + cnt.UnitID; } try { return(SqlHelper.ExecuteDataset(CommandType.Text, SQL, Module.LJMS, null).Tables[0]); } catch (Exception ex) { throw ex; } }
public static List <ATTLawyerCount> GetLawyerCount(ATTLawyerCount cnt) { List <ATTLawyerCount> lst = new List <ATTLawyerCount>(); try { foreach (DataRow row in DLLLawyerSearch.GetLawyerCount(cnt).Rows) { ATTLawyerCount obj = new ATTLawyerCount(); if (cnt.Type == LawyerType.NepalBarCouncil) { obj.UnitName = row["unit_name"].ToString(); } else { obj.UnitName = ""; } obj.LawyerTypeName = row["lawyer_type_description"].ToString(); obj.Gender = row["gender"].ToString(); obj.Total = int.Parse(row["total"].ToString()); lst.Add(obj); } return(lst); } catch (Exception ex) { throw ex; } }
protected void btnSearchLawyer_Click(object sender, EventArgs e) { ATTLawyerCount lawyer = new ATTLawyerCount(); lawyer.LawyerTypeID = int.Parse(this.ddlLawyerType.SelectedValue); lawyer.Type = LawyerType.NepalBarAssociation; try { this.grdCount.DataSource = BLLLawyerSearch.GetLawyerCount(lawyer); this.grdCount.DataBind(); this.grdCount.Columns[0].Visible = false; } catch (Exception ex) { this.ShowMessage(ex, null); } }