Exemple #1
0
 public static void AllocateRunningOrders(string show_ID, Guid user_ID)
 {
     Guid newShow_ID = new Guid(show_ID);
     List<Guid> showList = new List<Guid>();
     showList.Add(newShow_ID);
     LinkedShows ls = new LinkedShows();
     List<LinkedShows> lsList = ls.GetLinked_ShowsByParent_ID(newShow_ID);
     if (lsList != null && lsList.Count > 0)
     {
         foreach (LinkedShows linkedShow in lsList)
         {
             showList.Add(linkedShow.Child_Show_ID);
         }
     }
     SetDay1Show_ID(showList);
     if (OwnersDogsClassesDrawn.DeleteOwnersDogsClassesDrawnList())
     {
         foreach (Guid s_ID in showList)
         {
             OwnersDrawn = null;
             DogsDrawn = null;
             Shows show = new Shows(s_ID);
             if (!(bool)show.Running_Orders_Allocated)
             {
                 AllEntriesInClass = OwnersDogsClassesDrawn.GetOwnersDogsClassesDrawnListData(s_ID, null, false);
                 AllocateRunningOrdersStage1(s_ID, user_ID);
                 AllocateRunningOrdersStage2(s_ID, user_ID);
                 AllocateRunningOrdersStage3(s_ID, user_ID);
                 show.Running_Orders_Allocated = true;
                 show.Update_Show(s_ID, user_ID);
             }
         }
     }
 }
Exemple #2
0
 public static void ClearRunningOrders(string show_ID, Guid user_ID)
 {
     Guid newShow_ID = new Guid(show_ID);
     List<Guid> showList = new List<Guid>();
     showList.Add(newShow_ID);
     LinkedShows ls = new LinkedShows();
     List<LinkedShows> lsList = ls.GetLinked_ShowsByParent_ID(newShow_ID);
     if (lsList != null && lsList.Count > 0)
     {
         foreach (LinkedShows linkedShow in lsList)
         {
             showList.Add(linkedShow.Child_Show_ID);
         }
     }
     List<OwnersDogsClassesDrawn> oDCDList = new List<OwnersDogsClassesDrawn>();
     oDCDList = OwnersDogsClassesDrawn.GetOwnersDogsClassesDrawnListData(newShow_ID, null, true);
     if (oDCDList != null && oDCDList.Count > 0)
     {
         SetClassesAndDrawQty(newShow_ID);
         foreach (ClassesAndDrawQty classRow in ClassesAndDrawQtyList)
         {
             foreach (OwnersDogsClassesDrawn row in oDCDList)
             {
                 if (row.Show_Final_Class_ID == classRow.Show_Final_Class_ID)
                 {
                     SetRunningOrderNull(row, user_ID);
                 }
             }
         }
     }
     foreach (Guid s_ID in showList)
     {
         Shows show = new Shows(s_ID);
         show.Running_Orders_Allocated = false;
         show.Update_Show(s_ID, user_ID);
     }
 }
    protected void btnUpdateShow_Click(object sender, EventArgs e)
    {
        MembershipUser userInfo = Membership.GetUser();
        Guid user_ID = (Guid)userInfo.ProviderUserKey;

        ReadFormFields();
        if (!string.IsNullOrEmpty(Show_ID))
        {
            Guid show_ID = new Guid(Show_ID);
            Guid club_ID = new Guid(Club_ID);
            Guid venue_ID = new Guid(Venue_ID);

            if (ValidateShow())
            {
                Shows show = new Shows(show_ID);
                if (HasChanges(show))
                {
                    show.Club_ID = club_ID;
                    show.Show_Year_ID = Convert.ToInt32(lstShowYears.SelectedValue);
                    show.Show_Type_ID = Convert.ToInt32(lstShowTypes.SelectedValue);
                    show.Venue_ID = venue_ID;
                    show.Show_Name = txtShowName.Text;
                    show.Show_Opens = DateTime.Parse(Request.Form[txtShowDateTime.UniqueID]);
                    show.Judging_Commences = DateTime.Parse(Request.Form[txtJudgingDateTime.UniqueID]);
                    show.Closing_Date = DateTime.Parse(Request.Form[txtCloseDateTime.UniqueID]);
                    short res;
                    if (short.TryParse(txtMaxClassesPerDog.Text, out res))
                        show.MaxClassesPerDog = res;

                    if (show.Update_Show(show_ID, user_ID))
                    {
                        MessageLabel.Text = "The show was updated successfully";
                        PopulateShowGridView(Club_ID);
                        if (!string.IsNullOrEmpty(btnReturn.PostBackUrl))
                        {
                            DivReturn.Visible = true;
                            divAddClasses.Visible = true;
                        }
                    }
                }
                else
                {
                    MessageLabel.Text = "Update cancelled as no changes have been made.";
                }
            }
        }
    }