Exemplo n.º 1
0
 protected void NoSpecialRequestGridView_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         ListItemCollection listItems = new ListItemCollection();
         Guid show_Entry_Class_ID     = new Guid(NoSpecialRequestGridView.DataKeys[e.Row.RowIndex].Values[1].ToString());
         listItems = GetClassParts(show_Entry_Class_ID);
         Guid             show_Final_Class_ID = new Guid(NoSpecialRequestGridView.DataKeys[e.Row.RowIndex].Values[2].ToString());
         ShowFinalClasses showFinalClasses    = new ShowFinalClasses(_connString, show_Final_Class_ID);
         Label            lblNewPart          = (Label)e.Row.FindControl("lblNewPart");
         if (lblNewPart != null)
         {
             lblNewPart.Text = showFinalClasses.Show_Final_Class_Description;
         }
         DropDownList ddlNewPart = (DropDownList)e.Row.FindControl("ddlNewPart");
         if (ddlNewPart != null)
         {
             foreach (ListItem item in listItems)
             {
                 ddlNewPart.Items.Add(item);
             }
             ddlNewPart.DataBind();
             ddlNewPart.SelectedValue = NoSpecialRequestGridView.DataKeys[e.Row.RowIndex].Values[2].ToString();
         }
     }
 }
Exemplo n.º 2
0
        private void EditFinalClass()
        {
            cboNewValue       = new ComboBox();
            cboNewValue.Width = panel1.Width;
            panel1.Controls.Add(cboNewValue);
            dog      = new Dogs(_connString, new Guid(_dogID));
            dogClass = new DogClasses(_connString, new Guid(_dogClassID));
            ShowFinalClasses        sfc     = new ShowFinalClasses(_connString);
            List <ShowFinalClasses> sfcList = sfc.GetShow_Final_ClassesByShow_Entry_Class_ID((Guid)dogClass.Show_Entry_Class_ID);

            if (sfcList.Count == 0)
            {
                this.DialogResult = System.Windows.Forms.DialogResult.Abort;
            }
            else
            {
                foreach (ShowFinalClasses showFinalClass in sfcList)
                {
                    ComboBoxItem item = new ComboBoxItem();
                    item.Text  = showFinalClass.Show_Final_Class_Description;
                    item.Value = showFinalClass.Show_Final_Class_ID;
                    cboNewValue.Items.Add(item);
                    if (dogClass.Show_Final_Class_ID == showFinalClass.Show_Final_Class_ID)
                    {
                        lblCurrentValue.Text    = showFinalClass.Show_Final_Class_Description;;
                        lblCurrentValue.Visible = true;
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void btnCommitSplitClasses_Click(object sender, EventArgs e)
        {
            FinalClassNames        finalClassNames    = new FinalClassNames(_connString);
            List <FinalClassNames> finalClassNameList = finalClassNames.GetFinalClassNames();

            if (finalClassNameList != null && finalClassNameList.Count > 0)
            {
                ClearFinalClassNames(finalClassNameList);
                foreach (FinalClassNames finalClassName in finalClassNameList)
                {
                    Guid?            show_Final_Class_ID = null;
                    ShowEntryClasses showEntryClass      = new ShowEntryClasses(_connString, finalClassName.Show_Entry_Class_ID);
                    ShowFinalClasses showFinalClass      = new ShowFinalClasses(_connString);
                    showFinalClass.Show_ID                      = showEntryClass.Show_ID;
                    showFinalClass.Show_Entry_Class_ID          = showEntryClass.Show_Entry_Class_ID;
                    showFinalClass.Show_Final_Class_Description = finalClassName.Show_Final_Class_Description;
                    showFinalClass.Show_Final_Class_No          = finalClassName.OrderBy;
                    show_Final_Class_ID = showFinalClass.Insert_Show_Final_Class(_user_ID);
                    if (show_Final_Class_ID == null)
                    {
                        MessageLabel.Text = "Show Final Class Insert Failed!";
                        break;
                    }
                    else
                    {
                        MessageLabel.Text = "Show Final Class Insert Successful.";
                    }
                }
            }
        }
Exemplo n.º 4
0
 protected void btnCommit_Click(object sender, EventArgs e)
 {
     FinalClassNameList = SplitClasses.DisplayFinalClassNames(_connString);
     StoreCommon();
     if (FinalClassNameList != null && FinalClassNameList.Count > 0)
     {
         MembershipUser userInfo = Membership.GetUser();
         Guid           user_ID  = (Guid)userInfo.ProviderUserKey;
         ClearFinalClassNames();
         foreach (FinalClassNames finalClassName in FinalClassNameList)
         {
             Guid?            show_Final_Class_ID = null;
             ShowEntryClasses showEntryClass      = new ShowEntryClasses(_connString, finalClassName.Show_Entry_Class_ID);
             ShowFinalClasses showFinalClass      = new ShowFinalClasses(_connString);
             showFinalClass.Show_ID                      = showEntryClass.Show_ID;
             showFinalClass.Show_Entry_Class_ID          = showEntryClass.Show_Entry_Class_ID;
             showFinalClass.Show_Final_Class_Description = finalClassName.Show_Final_Class_Description;
             showFinalClass.Show_Final_Class_No          = finalClassName.OrderBy;
             show_Final_Class_ID = showFinalClass.Insert_Show_Final_Class(user_ID);
             if (show_Final_Class_ID == null)
             {
                 MessageLabel.Text = "Show Final Class Insert Failed!";
                 break;
             }
             else
             {
                 MessageLabel.Text = "Show Final Class Insert Successful.";
             }
         }
     }
 }
Exemplo n.º 5
0
    private ListItemCollection GetClassParts(Guid show_Entry_Class_ID)
    {
        ListItemCollection      listItems          = new ListItemCollection();
        ShowFinalClasses        showFinalClasses   = new ShowFinalClasses(_connString);
        List <ShowFinalClasses> showFinalClassList = showFinalClasses.GetShow_Final_ClassesByShow_Entry_Class_ID(show_Entry_Class_ID);

        foreach (ShowFinalClasses row in showFinalClassList)
        {
            ListItem item = new ListItem(row.Show_Final_Class_Description, row.Show_Final_Class_ID.ToString());
            listItems.Add(item);
        }
        return(listItems);
    }
Exemplo n.º 6
0
        private void PopulateClassListComboBox()
        {
            ShowFinalClasses        showFinalClasses = new ShowFinalClasses(_connString);
            List <ShowFinalClasses> splitClassList   = showFinalClasses.GetSplitClassParts(_show_ID);

            foreach (ShowFinalClasses finalClass in splitClassList)
            {
                ComboBoxItem item = new ComboBoxItem();
                item.Value = finalClass.Show_Final_Class_ID.ToString();
                item.Text  = finalClass.Show_Final_Class_Description;
                cboClassParts.Items.Add(item);
            }
        }
Exemplo n.º 7
0
        private void PopulateClasses()
        {
            cboShowClasses.Items.Clear();
            ShowFinalClasses        showFinalClasses   = new ShowFinalClasses(Utils.ConnectionString());
            List <ShowFinalClasses> showFinalClassList = showFinalClasses.GetShow_Final_ClassesByShow_ID(_showID);
            ComboBoxItem            item = null;

            foreach (ShowFinalClasses sfc in showFinalClassList)
            {
                item       = new ComboBoxItem();
                item.Text  = sfc.Show_Final_Class_Description;
                item.Value = sfc.Show_Final_Class_ID;

                cboShowClasses.Items.Add(item);
            }
        }
Exemplo n.º 8
0
        private void ClearFinalClassNames(List <FinalClassNames> finalClassNameList)
        {
            StringBuilder sb = new StringBuilder("Error List:");

            if (finalClassNameList != null && finalClassNameList.Count > 0)
            {
                foreach (FinalClassNames finalClassName in finalClassNameList)
                {
                    int delCount = 0;
                    ShowFinalClasses showFinalClasses = new ShowFinalClasses(_connString);
                    delCount = showFinalClasses.DeleteShowFinalClassesByShowEntryClass(finalClassName.Show_Entry_Class_ID);
                    if (delCount <= 0)
                    {
                        sb.AppendLine(string.Format("\nShow Final Class Delete Failed for {0}!", finalClassName.Class_Name_Description));
                    }
                }
            }
            //MessageLabel.Text = sb.ToString();
        }
Exemplo n.º 9
0
 private void PopulateClassList(string Show_ID)
 {
     if (!string.IsNullOrEmpty(Show_ID))
     {
         Guid                    show_ID             = new Guid(Show_ID);
         ShowFinalClasses        showFinalClasses    = new ShowFinalClasses(_connString);
         List <ShowFinalClasses> tblShowFinalClasses = showFinalClasses.GetShow_Final_ClassesByShow_ID(show_ID);
         List <ShowFinalClasses> classList           = new List <ShowFinalClasses>();
         ShowFinalClasses        allClasses          = new ShowFinalClasses(_connString);
         allClasses.Show_Final_Class_Description = "All Classes";
         allClasses.Show_Final_Class_ID          = new Guid();
         classList.Add(allClasses);
         foreach (ShowFinalClasses row in tblShowFinalClasses)
         {
             classList.Add(row);
         }
         lstClasses.DataSource = classList;
         lstClasses.DataBind();
     }
 }
Exemplo n.º 10
0
        private void cboClassParts_SelectedIndexChanged(object sender, EventArgs e)
        {
            //No of part requests is greater than the number in the part
            int classPart     = 0;
            int requiredCount = 0;
            int actualCount   = 0;

            ShowFinalClasses showFinalClasses = new ShowFinalClasses(_connString, new Guid((cboClassParts.SelectedItem as ComboBoxItem).Value.ToString()));
            FinalClassNames  finalClassNames  = new FinalClassNames(_connString, showFinalClasses.Show_Final_Class_No);

            requiredCount = (int)finalClassNames.Entries;
            DogClasses        dogClasses   = new DogClasses(_connString);
            List <DogClasses> dogClassList = dogClasses.GetDog_ClassesByShow_Entry_Class_ID((Guid)showFinalClasses.Show_Entry_Class_ID);

            int.TryParse(showFinalClasses.Show_Final_Class_Description.Substring(showFinalClasses.Show_Final_Class_Description.Length - 1), out classPart);
            if (classPart > 0)
            {
                foreach (DogClasses dogClass in dogClassList)
                {
                    if (dogClass.Preferred_Part == classPart)
                    {
                        actualCount++;
                    }
                }
            }

            lblRequiredCount.Text = requiredCount.ToString();
            lblActualCount.Text   = actualCount.ToString();

            if (actualCount > requiredCount)
            {
                lblActualCount.ForeColor   = Color.Red;
                lblRequiredCount.ForeColor = Color.Red;
            }
            else
            {
                lblActualCount.ForeColor   = Color.Lime;
                lblRequiredCount.ForeColor = Color.Lime;
            }
        }
Exemplo n.º 11
0
        private void PopulateDogClassesGrid(string entrantID)
        {
            string connString = Utils.ConnectionString();

            Guid entrant_ID = new Guid(entrantID);

            DogClasses        dogClasses = new DogClasses(connString);
            List <DogClasses> dcList     = dogClasses.GetDog_ClassesByEntrant_ID(entrant_ID);

            DataTable dt = new DataTable();

            DataColumn dcDogClassID     = new DataColumn("DogClassID");
            DataColumn dcEntrantID      = new DataColumn("EntrantID");
            DataColumn dcDogID          = new DataColumn("DogID");
            DataColumn dcKCName         = new DataColumn("KCName");
            DataColumn dcBreed          = new DataColumn("Breed");
            DataColumn dcGender         = new DataColumn("Gender");
            DataColumn dcRegNo          = new DataColumn("RegNo");
            DataColumn dcDOB            = new DataColumn("DOB");
            DataColumn dcMeritPoints    = new DataColumn("MeritPoints");
            DataColumn dcBreeder        = new DataColumn("Breeder");
            DataColumn dcSire           = new DataColumn("Sire");
            DataColumn dcDam            = new DataColumn("Dam");
            DataColumn dcEntryClassName = new DataColumn("EntryClassName");
            DataColumn dcPreferredPart  = new DataColumn("PreferredPart");
            DataColumn dcFinalClassName = new DataColumn("FinalClassName");
            DataColumn dcHandler        = new DataColumn("Handler");
            DataColumn dcRingNo         = new DataColumn("RingNo");
            DataColumn dcRunningOrder   = new DataColumn("RunningOrder");
            DataColumn dcSpecialRequest = new DataColumn("SpecialRequest");

            dt.Columns.Add(dcDogClassID);
            dt.Columns.Add(dcEntrantID);
            dt.Columns.Add(dcDogID);
            dt.Columns.Add(dcKCName);
            dt.Columns.Add(dcBreed);
            dt.Columns.Add(dcGender);
            dt.Columns.Add(dcRegNo);
            dt.Columns.Add(dcDOB);
            dt.Columns.Add(dcMeritPoints);
            dt.Columns.Add(dcBreeder);
            dt.Columns.Add(dcSire);
            dt.Columns.Add(dcDam);
            dt.Columns.Add(dcEntryClassName);
            dt.Columns.Add(dcPreferredPart);
            dt.Columns.Add(dcFinalClassName);
            dt.Columns.Add(dcHandler);
            dt.Columns.Add(dcRingNo);
            dt.Columns.Add(dcRunningOrder);
            dt.Columns.Add(dcSpecialRequest);

            object[] dogRow = new object[19];
            foreach (DogClasses dc in dcList)
            {
                Dogs             dog = new Dogs(connString, (Guid)dc.Dog_ID);
                ShowEntryClasses sec = new ShowEntryClasses(connString, (Guid)dc.Show_Entry_Class_ID);
                ClassNames       cn  = new ClassNames(connString, (int)sec.Class_Name_ID);
                DogBreeds        db  = new DogBreeds(connString, (int)dog.Dog_Breed_ID);
                DogGender        dg  = new DogGender(connString, (int)dog.Dog_Gender_ID);

                dogRow[0] = dc.Dog_Class_ID;
                dogRow[1] = entrant_ID;
                dogRow[2] = dog.Dog_ID;
                dogRow[3] = dog.Dog_KC_Name;
                dogRow[4] = db.Description;
                dogRow[5] = dg.Description;
                dogRow[6] = dog.Reg_No;
                DateTime DOB = (DateTime)dog.Date_Of_Birth;
                dogRow[7]  = string.Format("{0}/{1}/{2}", DOB.Day, DOB.Month, DOB.Year);
                dogRow[8]  = dog.Merit_Points;
                dogRow[9]  = dog.Breeder;
                dogRow[10] = dog.Sire;
                dogRow[11] = dog.Dam;
                dogRow[12] = string.Concat(sec.Class_No, " - ", cn.Class_Name_Description);
                dogRow[13] = dc.Preferred_Part.ToString();
                if (dc.Show_Final_Class_ID != null && dc.Show_Final_Class_ID != new Guid())
                {
                    ShowFinalClasses sfc = new ShowFinalClasses(connString, (Guid)dc.Show_Final_Class_ID);
                    dogRow[14] = sfc.Show_Final_Class_Description;
                }
                else
                {
                    dogRow[14] = "Not Yet Assigned";
                }
                People handler = new People(connString, (Guid)dc.Handler_ID);
                dogRow[15] = handler.Person_FullName;
                dogRow[16] = string.IsNullOrWhiteSpace(dc.Ring_No.ToString()) ? "Not Yet Assigned" : dc.Ring_No.ToString();
                dogRow[17] = string.IsNullOrWhiteSpace(dc.Running_Order.ToString()) ? "Not Yet Assigned" : dc.Running_Order.ToString();
                dogRow[18] = dc.Special_Request;

                dt.Rows.Add(dogRow);
            }
            dgvDogClasses.DataSource = dt;
            dgvDogClasses.Columns["DogClassID"].Visible = false;
            dgvDogClasses.Columns["EntrantID"].Visible  = false;
            dgvDogClasses.Columns["DogID"].Visible      = false;
            //dgvDogClasses.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            //dgvDogClasses.AutoSize = true;
        }