Ejemplo n.º 1
0
 protected void Clear(object sender, EventArgs e)
 {
     PlayerID.Text  = "";
     FirstName.Text = "";
     Age.Text       = "";
     GuardianList.ClearSelection();
     TeamList.ClearSelection();
 }
Ejemplo n.º 2
0
 protected void Clear_Fields(object sender, EventArgs e)
 {
     GuardianList.ClearSelection();
     TeamList.ClearSelection();
     FirstName.Text           = "";
     LastName.Text            = "";
     Age.Text                 = "";
     Gender.Text              = "";
     AHCN.Text                = "";
     MedicalAlertDetails.Text = "";
 }
 protected void Clear(object sender, EventArgs e)
 {
     TextBox1.Text = "";
     TextBox2.Text = "";
     TextBox3.Text = "";
     GuardianList.ClearSelection();
     TeamList.ClearSelection();
     TextBox6.Text = "";
     TextBox7.Text = "";
     TextBox8.Text = "";
     TextBox9.Text = "";
 }
Ejemplo n.º 4
0
 protected void Clear(object sender, EventArgs e)
 {
     PlayerID.Text  = "";
     FirstName.Text = "";
     LastName.Text  = "";
     Age.Text       = "";
     Gender.Text    = "";
     AlbertaHealthCareNumber.Text = "";
     MedicalAlertDetails.Text     = "";
     TeamList.ClearSelection();
     GuardianList.ClearSelection();
 }
Ejemplo n.º 5
0
 protected void Clear(object sender, EventArgs e)
 {
     ID.Text        = "";
     FirstName.Text = "";
     LastName.Text  = "";
     Age.Text       = "";
     Gender.Text    = "";
     ABHealth.Text  = "";
     TeamList.ClearSelection();
     GuardianList.ClearSelection();
     MedicalAlert.Text = "";
 }
 protected void Clear(object sender, EventArgs e)
 {
     ID.Text     = "";
     FName.Text  = "";
     LName.Text  = "";
     Age.Text    = "";
     Gender.Text = "";
     HCard.Text  = "";
     MAlert.Text = "";
     TeamList.ClearSelection();
     GuardianList.ClearSelection();
 }
Ejemplo n.º 7
0
 protected void Clear_Click(object sender, EventArgs e)
 {
     PlayerID.Text = "";
     TeamList.ClearSelection();
     GuardianList.ClearSelection();
     FirstName.Text               = "";
     LastName.Text                = "";
     Age.Text                     = "";
     RadioMale.Checked            = false;
     RadioFemale.Checked          = false;
     AlbertaHealthcareNumber.Text = "";
     MedicalAlertDetails.Text     = "";
 }
Ejemplo n.º 8
0
 protected void BindGuardianList()
 {
     try
     {
         Controller03    sysmgr = new Controller03();
         List <Entity03> info   = null;
         info = sysmgr.List();
         info.Sort((x, y) => x.GuardianName.CompareTo(y.GuardianName));
         GuardianList.DataSource     = info;
         GuardianList.DataTextField  = nameof(Entity03.GuardianName);
         GuardianList.DataValueField = nameof(Entity03.GuardianID);
         GuardianList.DataBind();
         GuardianList.Items.Insert(0, "Select . . . ");
     }
     catch (Exception ex)
     {
         errormsgs.Add(GetInnerException(ex).ToString());
         LoadMessageDisplay(errormsgs, "alert alert-danger");
     }
 }
Ejemplo n.º 9
0
        protected void BindGuardian()
        {
            try
            {
                GuardianController sysmgr = new GuardianController();
                List <Guardian>    info   = sysmgr.Guardian_List();

                info.Sort((x, y) => x.FullName.CompareTo(y.FullName));
                GuardianList.DataSource     = info;
                GuardianList.DataTextField  = "FullName";
                GuardianList.DataValueField = "GuardianID";
                GuardianList.DataBind();
                GuardianList.Items.Insert(0, "Select...");
            }
            catch (Exception ex)
            {
                errormsgs.Add(GetInnerException(ex).ToString());
                LoadMessageDisplay(errormsgs, "alert alert-danger");
            }
        }
Ejemplo n.º 10
0
 protected void BindGuardianList()
 {
     try
     {
         GuardianController guardianController = new GuardianController();
         List <Guardian>    guardianInfo       = null;
         guardianInfo = guardianController.Guardian_List();
         guardianInfo.Sort((x, y) => x.FullName.CompareTo(y.FullName));
         GuardianList.DataSource     = guardianInfo;
         GuardianList.DataTextField  = nameof(Guardian.FullName);
         GuardianList.DataValueField = nameof(Guardian.GuardianID);
         GuardianList.DataBind();
         GuardianList.Items.Insert(0, "Select a guardian...");
     }
     catch (Exception ex)
     {
         //Message.Visible = true;
         errorMessageList.Add(GetInnerException(ex).ToString());
         LoadMessageDisplay(errorMessageList, "alert alert-danger");
     }
 }
 protected void BindGuardianList()
 {
     try
     {
         GuardianController sysmgr = new GuardianController();
         List <Guardian>    info   = null;
         info = sysmgr.List();
         info.Sort((x, y) => x.Name.CompareTo(y.Name));
         GuardianList.DataSource     = info;
         GuardianList.DataTextField  = nameof(Guardian.Name);
         GuardianList.DataValueField = nameof(Guardian.GuardianID);
         GuardianList.DataBind();
         ListItem myitem = new ListItem();
         myitem.Value = "0";
         myitem.Text  = "select...";
         GuardianList.Items.Insert(0, myitem);
     }
     catch (Exception ex)
     {
         ShowMessage(GetInnerException(ex).ToString(), "alert alert-danger");
     }
 }
Ejemplo n.º 12
0
        protected void DeletePlayer_Click(object sender, EventArgs e)
        {
            int playerid = 0;

            if (string.IsNullOrEmpty(PlayerID.Text))
            {
                errormsgs.Add("Search for a player to delete");
            }
            else if (!int.TryParse(PlayerID.Text, out playerid))
            {
                errormsgs.Add("Player ID is invalid");
            }
            else if (playerid < 1)
            {
                errormsgs.Add("Product ID is invalid");
            }


            if (errormsgs.Count > 0)
            {
                LoadMessageDisplay(errormsgs, "alert alert-danger");
            }
            else
            {
                try
                {
                    PlayerController sysmgr = new PlayerController();

                    int rowsaffected = sysmgr.Player_Delete(playerid);
                    if (rowsaffected > 0)
                    {
                        errormsgs.Add("Player has been deleted");
                        LoadMessageDisplay(errormsgs, "alert alert-success");
                        BindPlayerList();

                        PlayerID.Text = "";
                        GuardianList.ClearSelection();
                        TeamList.ClearSelection();
                        FirstName.Text = "";
                        LastName.Text  = "";
                        Age.Text       = "";
                        Gender.ClearSelection();
                        AlbertaHealthCareNumber.Text = "";
                        MedicalAlertDetails.Text     = "";

                        PlayerList.ClearSelection();
                    }
                    else
                    {
                        errormsgs.Add("Player has not been deleted. Player was not found.");
                        LoadMessageDisplay(errormsgs, "alert alert-info");
                        BindPlayerList();
                    }
                }
                catch (DbUpdateException ex)
                {
                    UpdateException updateException = (UpdateException)ex.InnerException;
                    if (updateException.InnerException != null)
                    {
                        errormsgs.Add(updateException.InnerException.Message.ToString());
                    }
                    else
                    {
                        errormsgs.Add(updateException.Message);
                    }
                    LoadMessageDisplay(errormsgs, "alert alert-danger");
                }
                catch (DbEntityValidationException ex)
                {
                    foreach (var entityValidationErrors in ex.EntityValidationErrors)
                    {
                        foreach (var validationError in entityValidationErrors.ValidationErrors)
                        {
                            errormsgs.Add(validationError.ErrorMessage);
                        }
                    }
                    LoadMessageDisplay(errormsgs, "alert alert-danger");
                }
                catch (Exception ex)
                {
                    errormsgs.Add(GetInnerException(ex).ToString());
                    LoadMessageDisplay(errormsgs, "alert alert-danger");
                }
            }
        }