Exemple #1
0
        protected void Fetch_Click(object sender, EventArgs e)
        {
            if (List01.SelectedIndex == 0)
            {
                MessageLabel.Text = "Select a Team to view its information";
            }
            else
            {
                try
                {
                    Controller02    sysmgr       = new Controller02();
                    Controller01    sysmgr2      = new Controller01();
                    List <Entity02> info         = null;
                    Entity03        SearchEntity = sysmgr2.FindByID(int.Parse(List01.SelectedValue));
                    info = sysmgr.FindByID(int.Parse(List01.SelectedValue));

                    info.Sort((x, y) => x.LastName.CompareTo(y.LastName));
                    List02.DataSource = info;
                    List02.DataBind();
                    Coach.Text       = SearchEntity.Coach.ToString();
                    AssistCoach.Text = SearchEntity.AssistantCoach.ToString();
                    Wins.Text        = SearchEntity.Wins.ToString();
                    Losses.Text      = SearchEntity.Losses.ToString();
                }
                catch (Exception ex)
                {
                    MessageLabel.Text = ex.Message + "Test";
                }
            }
        }
        protected void Fetch_Click(object sender, EventArgs e)
        {
            if (List01.SelectedIndex == 0)
            {
                MessageLabel.Text = "Select a team to view its players";
            }
            else
            {
                try
                {
                    TeamController sysmgr01 = new TeamController();
                    Team           info01   = null;
                    info01                  = sysmgr01.FindByPKID(int.Parse(List01.SelectedValue));
                    IDLabel01.Text          = "Coach:";
                    IDLabel02.Text          = info01.Coach.ToString();
                    NameLabel01.Text        = "Assistant Coach:";
                    NameLabel02.Text        = info01.AssistantCoach.ToString();
                    Label2.Text             = "Wins:";
                    Label3.Text             = info01.Wins.ToString();
                    DescriptionLabel01.Text = "Losses";
                    DescriptionLabel02.Text = info01.Losses.ToString();

                    PlayerController sysmgr02 = new PlayerController();
                    List <Player>    info02   = null;
                    info02 = sysmgr02.FindByID(int.Parse(List01.SelectedValue));
                    info02.Sort((x, y) => x.Name.CompareTo(y.Name));
                    List02.DataSource = info02;
                    List02.DataBind();
                }
                catch (Exception ex)
                {
                    MessageLabel.Text = ex.Message;
                }
            }
        }
Exemple #3
0
        protected void Fetch_Click(object sender, EventArgs e)
        {
            if (List01.SelectedIndex == 0)
            {
                MessageLabel.Text = "Select a category to view its products";
            }
            else
            {
                try
                {
                    Controller01 sysmgr01 = new Controller01();
                    Entity01     info01   = null;
                    info01                  = sysmgr01.FindByID(int.Parse(List01.SelectedValue));
                    IDLabel01.Text          = "Category ID:";
                    IDLabel02.Text          = info01.CategoryID.ToString();
                    NameLabel01.Text        = "Category Name:";
                    NameLabel02.Text        = info01.CategoryName;
                    DescriptionLabel01.Text = "Category Description:";
                    DescriptionLabel02.Text = info01.Description;

                    Controller02    sysmgr02 = new Controller02();
                    List <Entity02> info02   = null;
                    info02 = sysmgr02.FindByID(int.Parse(List01.SelectedValue));
                    info02.Sort((x, y) => x.ProductName.CompareTo(y.ProductName));
                    List02.DataSource = info02;
                    List02.DataBind();
                }
                catch (Exception ex)
                {
                    MessageLabel.Text = ex.Message;
                }
            }
        }
 protected void Fetch_Click01(object sender, EventArgs e)
 {
     if (List01.SelectedIndex == 0)
     {
         MessageLabel.Text = "Select a Category to view its Products";
     }
     else
     {
         try
         {
             Controller02    sysmgr02 = new Controller02();
             List <Entity02> info02   = null;
             info02 = sysmgr02.FindByID(int.Parse(List01.SelectedValue));
             //info02 = sysmgr02.List();
             info02.Sort((x, y) => x.ProductName.CompareTo(y.ProductName));
             Fetch02.Enabled       = true;
             List02.Enabled        = true;
             List02.DataSource     = info02;
             List02.DataTextField  = nameof(Entity02.ProductandID);
             List02.DataValueField = nameof(Entity02.ProductID);
             List02.DataBind();
             List02.Items.Insert(0, "select...");
         }
         catch (Exception ex)
         {
             MessageLabel.Text = ex.Message;
         }
     }
 }
Exemple #5
0
 protected void Fetch_Click01(object sender, EventArgs e)
 {
     if (List01.SelectedIndex == 0)
     {
         ShowMessage("Select a school to view its programs", "alert alert-warning");
     }
     else
     {
         ShowMessage("", "");
         try
         {
             ProgramsController sysmgr02 = new ProgramsController();
             List <Programs>    info02   = null;
             info02 = sysmgr02.FindByID(List01.SelectedValue);
             info02.Sort((x, y) => x.ProgramName.CompareTo(y.ProgramName));
             Fetch02.Enabled       = true;
             List02.Enabled        = true;
             List02.DataSource     = info02;
             List02.DataTextField  = nameof(Programs.ProgramName);
             List02.DataValueField = nameof(Programs.ProgramID);
             List02.DataBind();
             List02.Items.Insert(0, "select...");
         }
         catch (Exception ex)
         {
             ShowMessage(ex.ToString(), "alert alert-danger");
         }
     }
 }
Exemple #6
0
 protected void Fetch_Click(object sender, EventArgs e)
 {
     if (List01.SelectedIndex == 0)
     {
         MessageLabel.Text = "Select a category to view its products";
     }
     else
     {
         try
         {
             Controller01 sysmgr01 = new Controller01();
             Entity01     info01   = null;
             info01                  = sysmgr01.FindByPKID(int.Parse(List01.SelectedValue));
             NameLabel01.Text        = "Coach:";
             NameLabel02.Text        = info01.Coach;
             DescriptionLabel01.Text = "Assistant Coach:";
             DescriptionLabel02.Text = info01.AssistantCoach;
             IDLabel01.Text          = "Wins:";
             IDLabel02.Text          = info01.Wins.ToString();
             IDLabel201.Text         = "Losses:";
             IDLabel202.Text         = info01.Losses.ToString();
             Controller02    sysmgr02 = new Controller02();
             List <Entity02> info02   = null;
             info02 = sysmgr02.FindByID(int.Parse(List01.SelectedValue));
             info02.Sort((x, y) => x.FirstAndLast.CompareTo(y.FirstAndLast));
             List02.DataSource = info02;
             List02.DataBind();
         }
         catch (Exception ex)
         {
             MessageLabel.Text = ex.Message;
         }
     }
 }
Exemple #7
0
 protected void Fetch_Click01(object sender, EventArgs e)
 {
     if (List01.SelectedIndex == 0)
     {
         MessageLabel.Text = "Select School from List";
     }
     else
     {
         try
         {
             ProgramController sysmgr02 = new ProgramController();
             List <Programs>   info02   = null;
             info02 = sysmgr02.FindByID(List01.SelectedValue);
             //info02 = sysmgr02.List();
             info02.Sort((x, y) => x.ProgramName.CompareTo(y.ProgramName));
             Fetch02.Enabled       = true;
             List02.Enabled        = true;
             List02.DataSource     = info02;
             List02.DataTextField  = nameof(Programs.ProgramName);
             List02.DataValueField = nameof(Programs.ProgramID);
             List02.DataBind();
             List02.Items.Insert(0, "select...");
         }
         catch (Exception ex)
         {
             MessageLabel.Text = ex.Message;
         }
     }
 }
        protected void Fetch_Click(object sender, EventArgs e)
        {
            if (List01.SelectedIndex == 0)
            {
                MessageLabel.Text = "Select a team to view its players";
            }
            else
            {
                try
                {
                    //Controller01 Teamsysmgr = new Controller01();
                    //List<Entity01> Teaminfo = null;
                    //Teaminfo = Teamsysmgr.FindByID(int.Parse(List01.SelectedValue));
                    ////info.Sort((x, y) => x.ProductName.CompareTo(y.ProductName));
                    //TeamInfo.DataSource = Teaminfo;
                    //TeamInfo.DataBind();
                    TeamInfoLabel.Text = "Team Information";
                    Controller01    Teamsysmgr = new Controller01();
                    List <Entity01> Teaminfo   = null;
                    Teaminfo = Teamsysmgr.FindByID(int.Parse(List01.SelectedValue));
                    //Teaminfo = Teamsysmgr.List();
                    TeamInfo.DataSource = Teaminfo;
                    TeamInfo.DataBind();

                    RosterLabel.Text = "Team Roster";
                    Controller02    sysmgr = new Controller02();
                    List <Entity02> info   = null;
                    info = sysmgr.FindByID(int.Parse(List01.SelectedValue));
                    info.Sort((x, y) => x.PlayerName.CompareTo(y.PlayerName));
                    //info.Sort((x, y) => x.ProductName.CompareTo(y.ProductName));
                    List02.DataSource = info;
                    List02.DataBind();
                }
                catch (Exception ex)
                {
                    TeamInfoLabel.Text = "";
                    RosterLabel.Text   = "";
                    MessageLabel.Text  = ex.Message;
                }
            }
        }
Exemple #9
0
        protected void Fetch_Click(object sender, EventArgs e)
        {
            if (List01.SelectedIndex == 0)
            {
                MessageLabel.Text = "Select a Team to view its products";
            }
            else
            {
                try
                {
                    TeamController sysmgr01 = new TeamController();
                    Team           info01   = null;
                    info01                = sysmgr01.FindByPKID(int.Parse(List01.SelectedValue));
                    IDLabel01.Text        = "Team ID:";
                    IDLabel02.Text        = info01.TeamID.ToString();
                    NameLabel01.Text      = "Team Name:";
                    NameLabel02.Text      = info01.TeamName;
                    Coach01.Text          = "Coach:";
                    Coach02.Text          = info01.Coach;
                    AssistantCoach01.Text = "Assistant Coach:";
                    AssistantCoach02.Text = info01.AssistantCoach;
                    Wins01.Text           = "Wins:";
                    Wins02.Text           = nameof(info01.Wins);
                    Losses01.Text         = "Losses:";
                    Losses02.Text         = nameof(info01.Losses);


                    PlayerController sysmgr02 = new PlayerController();
                    List <Player>    info02   = null;
                    info02 = sysmgr02.FindByID(int.Parse(List01.SelectedValue));
                    info02.Sort((x, y) => x.NameLastandFirst.CompareTo(y.NameLastandFirst));
                    List02.DataSource = info02;
                    List02.DataBind();
                }
                catch (Exception ex)
                {
                    MessageLabel.Text = ex.Message;
                }
            }
        }
Exemple #10
0
 protected void Fetch_Click(object sender, EventArgs e)
 {
     if (List01.SelectedIndex == 0)
     {
         MessageLabel.Text = "Select a team to view details";
     }
     else
     {
         try
         {
             Controller02    sysmgr = new Controller02();
             List <Entity02> info   = null;
             info = sysmgr.FindByID(int.Parse(List01.SelectedValue));
             info.Sort((x, y) => x.PlayerName.CompareTo(y.PlayerName));
             List02.DataSource = info;
             List02.DataBind();
         }
         catch (Exception ex)
         {
             MessageLabel.Text = ex.Message;
         }
     }
 }
 protected void Fetch_Click(object sender, EventArgs e)
 {
     if (List01.SelectedIndex == 0)
     {
         MessageLabel.Text = "select team";
     }
     else
     {
         try
         {
             PlayerController sysmgr = new PlayerController();
             List <Player>    info   = null;
             info = sysmgr.Players_FindByID(int.Parse(List01.SelectedValue));
             info.Sort((x, y) => x.PlayerID.CompareTo(y.PlayerID));
             List02.DataSource = info;
             List02.DataBind();
         }
         catch (Exception ex)
         {
             MessageLabel.Text = ex.Message;
         }
     }
 }
 protected void Fetch_Click(object sender, EventArgs e)
 {
     if (List01.SelectedIndex == 0)
     {
         MessageLabel.Text = "Select a category to view its products";
     }
     else
     {
         try
         {
             ProductController sysmgr = new ProductController();
             List <Product>    info   = null;
             info = sysmgr.FindByID(int.Parse(List01.SelectedValue));
             info.Sort((x, y) => x.ProductName.CompareTo(y.ProductName));
             List02.DataSource = info;
             List02.DataBind();
         }
         catch (Exception ex)
         {
             MessageLabel.Text = ex.Message;
         }
     }
 }
 protected void Fetch_Click(object sender, EventArgs e)
 {
     if (List01.SelectedIndex == 0)
     {
         MessageLabel.Text = "Select a team to view details";
         //clear details
         Coach.Text          = "";
         AssistantCoach.Text = "";
         Wins.Text           = "";
         Losses.Text         = "";
     }
     else
     {
         try
         {
             Controller02    sysmgr = new Controller02();
             List <Entity02> info   = null;
             info = sysmgr.FindByID(int.Parse(List01.SelectedValue));
             info.Sort((x, y) => x.PlayerName.CompareTo(y.PlayerName));
             List02.DataSource = info;
             List02.DataBind();
             // Team info
             Controller01 teamController = new Controller01();
             Entity01     teamInfo       = null;
             teamInfo            = teamController.TeamGet(int.Parse(List01.SelectedValue));
             Coach.Text          = teamInfo.Coach;
             AssistantCoach.Text = teamInfo.AssistantCoach;
             Wins.Text           = teamInfo.Wins.ToString();
             Losses.Text         = teamInfo.Losses.ToString();
         }
         catch (Exception ex)
         {
             MessageLabel.Text = ex.Message;
         }
     }
 }