private void GetBuyerList() { try { string Ocode = Convert.ToString(((SessionUser)Session["SessionUser"]).OCode); if (txtS_BuyerName.Text != "") { string BuyerNameL = txtS_BuyerName.Text; List <BuyerR> BuyerList = _Buyerbll.GetBuyerListByName(Ocode, BuyerNameL); grdBuyer.DataSource = BuyerList; grdBuyer.DataBind(); } else { List <BuyerR> BuyerList = _Buyerbll.GetBuyerListAll(Ocode); grdBuyer.DataSource = BuyerList; grdBuyer.DataBind(); } } catch (Exception) { throw; } }