示例#1
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;
         }
     }
 }
示例#3
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";
                }
            }
        }
示例#4
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;
         }
     }
 }
        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;
                }
            }
        }
示例#6
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 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;
         }
     }
 }