public void FillRunningOrdersGrid(GridView gv, bool display)
 {
     if (!string.IsNullOrEmpty(Show_ID))
     {
         Guid? show_Final_Class_ID = null;
         if (!string.IsNullOrEmpty(Show_Final_Class_ID) && Show_Final_Class_ID != new Guid().ToString())
         {
             show_Final_Class_ID = new Guid(Show_Final_Class_ID);
         }
         Guid show_ID = new Guid(Show_ID);
         List<Guid> showList = new List<Guid>();
         showList.Add(show_ID);
         LinkedShows ls = new LinkedShows();
         List<LinkedShows> lsList = ls.GetLinked_ShowsByParent_ID(show_ID);
         if (lsList != null && lsList.Count > 0)
         {
             foreach (LinkedShows linkedShow in lsList)
             {
                 showList.Add(linkedShow.Child_Show_ID);
             }
         }
         RunningOrders.SetDay1Show_ID(showList);
         List<OwnersDogsClassesDrawn> oDCDList = OwnersDogsClassesDrawn.GetOwnersDogsClassesDrawnListData(show_ID, show_Final_Class_ID, display);
         if (display)
         {
             gv.DataSource = oDCDList;
             gv.DataBind();
         }
         else
         {
             OwnersDogsClassesDrawnList = oDCDList;
         }
     }
 }
Example #2
0
        public List <LinkedShows> GetLinked_Shows()
        {
            List <LinkedShows> retVal = new List <LinkedShows>();

            try
            {
                LinkedShowsBL linkedShows = new LinkedShowsBL(_connString);
                lnkLinkedShows = linkedShows.GetLinked_Shows();

                if (lnkLinkedShows != null && lnkLinkedShows.Rows.Count > 0)
                {
                    foreach (DataRow row in lnkLinkedShows.Rows)
                    {
                        LinkedShows linkedShow = new LinkedShows(_connString, Utils.DBNullToGuid(row["Linked_Show_ID"]));
                        retVal.Add(linkedShow);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retVal);
        }
Example #3
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);
     }
 }
Example #4
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);
             }
         }
     }
 }
Example #5
0
    protected void btnSaveLinkedShows_Click(object sender, EventArgs e)
    {
        MembershipUser userInfo = Membership.GetUser();
        Guid user_ID = (Guid)userInfo.ProviderUserKey;
        Guid parent_Show_ID = new Guid(Parent_Show_ID);
        Guid child_Show_ID = new Guid(Child_Show_ID);
        Guid? linked_Show_ID;
        LinkedShows linkedShow = new LinkedShows();
        linkedShow.Parent_Show_ID = parent_Show_ID;
        linkedShow.Child_Show_ID = child_Show_ID;
        linked_Show_ID = linkedShow.Insert_Linked_Shows(user_ID);

        if (linked_Show_ID != null)
        {
            Linked_Show_ID = linked_Show_ID.ToString();
            Common.Linked_Show_ID = Linked_Show_ID;
            divSaveLinkedShows.Visible = false;
            MessageLabel.Text = "Shows linked successfully.";
        }
        else
            MessageLabel.Text = "Show linking failed!";
    }
Example #6
0
    private void PopulateParentShowGridView()
    {
        List<LinkedShows> lnkLinkedShows;
        LinkedShows linkedShows = new LinkedShows();
        lnkLinkedShows = linkedShows.GetLinked_Shows();
        Guid club_ID = new Guid(Club_ID);
        int show_Year_ID = Int32.Parse(Show_Year_ID);
        List<Shows> tblShows;
        Shows show = new Shows();
        tblShows = show.GetShowsByClub_ID_And_Show_Year_ID(club_ID, show_Year_ID);

        List<Shows> parentShowList = new List<Shows>();
        foreach (Shows showRow in tblShows)
        {
            if (lnkLinkedShows.Count == 0)
            {
                Shows newShow = new Shows((Guid)showRow.Show_ID);
                parentShowList.Add(newShow);
            }
            else
            {
                foreach (LinkedShows linkedShowRow in lnkLinkedShows)
                {
                    if (showRow.Show_ID != linkedShowRow.Parent_Show_ID && showRow.Show_ID != linkedShowRow.Child_Show_ID)
                    {
                        Shows newShow = new Shows((Guid)showRow.Show_ID);
                        parentShowList.Add(newShow);
                    }
                }
            }
        }
        if (parentShowList != null && parentShowList.Count > 0)
        {
            ParentShowGridView.DataSource = parentShowList;
            ParentShowGridView.DataBind();
            divParentShowList.Visible = true;
            divParentShowDetails.Visible = false;
        }
        else
        {
            MessageLabel.Text = "There are no unlinked shows for this Club.";
        }
    }
Example #7
0
 private void PopulateLinkedShowGridView()
 {
     Guid club_ID = new Guid(Club_ID);
     int show_Year_ID = Int32.Parse(Show_Year_ID);
     LinkedShows linkedShows = new LinkedShows();
     List<LinkedShows> lnkLinkedShows;
     lnkLinkedShows = linkedShows.GetLinked_Shows();
     List<LinkedShows> linkedShowList = new List<LinkedShows>();
     foreach (LinkedShows linkedShowRow in lnkLinkedShows)
     {
         Shows parentShow = new Shows(linkedShowRow.Parent_Show_ID);
         Shows childShow = new Shows(linkedShowRow.Child_Show_ID);
         if (parentShow.Club_ID == club_ID && parentShow.Show_Year_ID == show_Year_ID)
         {
             LinkedShows newLinkedShow = new LinkedShows(linkedShowRow.Linked_Show_ID);
             newLinkedShow.Parent_Show_Name = parentShow.Show_Name;
             newLinkedShow.Parent_Show_Opens = parentShow.Show_Opens;
             newLinkedShow.Child_Show_Name = childShow.Show_Name;
             newLinkedShow.Child_Show_Opens = childShow.Show_Opens;
             linkedShowList.Add(newLinkedShow);
         }
     }
     if (linkedShowList != null && linkedShowList.Count > 0)
     {
         LinkedShowsGridView.DataSource = linkedShowList;
         LinkedShowsGridView.DataBind();
         divClubLinkedShows.Visible = true;
     }
     else
     {
         divClubLinkedShows.Visible = false;
     }
 }
Example #8
0
    private void PopulateChildShowGridView()
    {
        Guid club_ID = new Guid(Club_ID);
        int show_Year_ID = Int32.Parse(Show_Year_ID);
        List<Shows> tblShows;
        Shows show = new Shows();
        tblShows = show.GetShowsByClub_ID_And_Show_Year_ID(club_ID, show_Year_ID);
        List<LinkedShows> lnkLinkedShows;
        LinkedShows linkedShows = new LinkedShows();
        lnkLinkedShows = linkedShows.GetLinked_Shows();

        Guid parent_Show_ID = new Guid(Parent_Show_ID);
        List<Shows> childShowList = new List<Shows>();
        foreach (Shows row in tblShows)
        {
            if (lnkLinkedShows.Count == 0 && row.Show_ID != parent_Show_ID)
            {
                Shows childShow = new Shows((Guid)row.Show_ID);
                childShowList.Add(childShow);
            }
            else
            {
                foreach (LinkedShows linkedShowRow in lnkLinkedShows)
                {
                    if (row.Show_ID != parent_Show_ID && row.Show_ID != linkedShowRow.Parent_Show_ID && row.Show_ID != linkedShowRow.Child_Show_ID)
                    {
                        Shows childShow = new Shows((Guid)row.Show_ID);
                        childShowList.Add(childShow);
                    }
                }
            }
        }
        if (childShowList != null && childShowList.Count > 0)
        {
            ChildShowGridView.DataSource = childShowList;
            ChildShowGridView.DataBind();
        }
        else
        {
            MessageLabel.Text = "There is no second, unlinked show for this Club.";
        }
    }
Example #9
0
        public List<LinkedShows> GetLinked_Shows()
        {
            List<LinkedShows> linkedShowList = new List<LinkedShows>();
            LinkedShowsBL linkedShows = new LinkedShowsBL();
            lnkLinkedShows = linkedShows.GetLinked_Shows();

            if (lnkLinkedShows != null && lnkLinkedShows.Count > 0)
            {
                foreach (sss.lnkLinked_ShowsRow row in lnkLinkedShows)
                {
                    LinkedShows linkedShow = new LinkedShows(row.Linked_Show_ID);
                    linkedShowList.Add(linkedShow);
                }
            }

            return linkedShowList;
        }