Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         //instantiate a new instance of engineer service
         //get all clients from engineer service and data bind them to UI
         engineerService = new EngineerService(System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString, User.Identity.GetUserId());
         if (!IsPostBack)
         {
             ClientListView.DataSource = engineerService.getClients();
             ClientListView.DataBind();
         }
     }
     catch (Exception)
     {
         Response.Redirect("~/Errors/InternalErrors.aspx", true);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Call engineer service to return all clients belong to the same district
 /// </summary>
 /// <returns>A list of clients</returns>
 public List <Client> GetClients()
 {
     return(engineerService.getClients().ToList());
 }