private void BindAgentCompany() { try { List <AgentCompanies> list = AgentCompanies.List(SessionManager.GetAgentCode(HttpContext.Current)); if (list != null && list.Count > 0) { rpt_Company.DataSource = list; rpt_Company.DataBind(); } else { rpt_Company.DataSource = null; rpt_Company.DataBind(); // l_Error.Text = "Agent Companies are not found."; l_Error.Visible = true; } } catch (Exception ex) { var message = new JavaScriptSerializer().Serialize(ex.Message.ToString()); var script = string.Format("alert({0});window.location='DashBoard.aspx';", message); ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", script, true); //l_Error.Text = ex.Message; //l_Error.Visible = true; } }
public static List <AgentCompanies> GetAgentCompany() { try { //string Success = "Success"; //string Fail = "Fail"; List <AgentCompanies> list = AgentCompanies.List((SessionManager.GetAgentCode(HttpContext.Current))); if (list != null && list.Count > 0) { return(list); } else { return(null); } } catch (Exception ex) { throw ex; } }