private void ClearEntryFields() { //Common.Reset(); Common.Person_ID = null; Common.Person_Address_ID = null; Owner_ID = null; Common.Owner_ID = Owner_ID; Club_ID = null; Common.Club_ID = Club_ID; Show_ID = null; Common.Show_ID=Show_ID; DogList doglist = new DogList(); Common.MyDogList=null; Common.DogOwnerList = null; Common.DogBreederList = null; Withold_Address = false; Common.Withold_Address = Withold_Address; Catalogue = false; Common.Catalogue = Catalogue; Overnight_Camping = false; Common.Overnight_Camping = Overnight_Camping; Send_Running_Order = false; Common.Send_Running_Order = Send_Running_Order; Entry_Date = null; txtEntryDate.Text = Entry_Date; Common.Entry_Date = Entry_Date; Overpayment = null; Common.Overpayment = Overpayment; Underpayment = null; Common.Underpayment = Underpayment; Offer_Of_Help = false; Common.Offer_Of_Help = Offer_Of_Help; Help_Details = null; Common.Help_Details = Help_Details; Common.Handler_ID = null; divEntryDetails.Visible = false; divDogList.Visible = false; divOwnerList.Visible = false; divClubDetails.Visible = false; divClubList.Visible = true; divShowDetails.Visible = false; divShowList.Visible = false; divAddCompetitor.Visible = false; PopulateForm(); }
protected void Page_Load(object sender, EventArgs e) { MessageLabel.Text = string.Empty; GetCommon(); if (!string.IsNullOrEmpty(Common.Club_ID)) { Club_ID = Common.Club_ID; PopulateClub(Club_ID); PopulateShowGridView(Club_ID); divShowList.Visible = true; } else { PopulateClubGridView(); divClubList.Visible = true; divClubDetails.Visible = false; } if (!string.IsNullOrEmpty(Common.Show_ID)) { Show_ID = Common.Show_ID; PopulateShow(Show_ID); divGetOwner.Visible = true; } else { if (!string.IsNullOrEmpty(Club_ID)) { PopulateShowGridView(Club_ID); divShowList.Visible = true; } else { divShowList.Visible = false; divShowDetails.Visible = false; divGetOwner.Visible = false; } } if (!string.IsNullOrEmpty(Common.Owner_ID)) { Owner_ID = Common.Owner_ID; AddOwnerToList(Owner_ID); Owner_ID = null; Common.Owner_ID = Owner_ID; } if (Common.DogOwnerList != null && Common.DogOwnerList.Count != 0) { divOwnerList.Visible = true; DogOwnerList ownerList = new DogOwnerList(); ownerList.MyDogOwnerList = Common.DogOwnerList; PopulateOwnerGridView(ownerList.MyDogOwnerList); divGetDog.Visible = true; } else { divOwnerList.Visible = false; divGetDog.Visible = false; } if (!string.IsNullOrEmpty(Common.Current_Dog_ID)) { Current_Dog_ID = Common.Current_Dog_ID; AddDogToList(Current_Dog_ID); Current_Dog_ID = null; Common.DogAdded = true; Common.Current_Dog_ID = Current_Dog_ID; } if (Common.MyDogList != null && Common.MyDogList.Count != 0) { if (!string.IsNullOrEmpty(Entrant_ID) && !Common.DogAdded) { //GetEntrantByShowAndDog(); Guid entrant_ID = new Guid(Entrant_ID); Common.MyDogList = null; PopulateEntrant(entrant_ID); PopulateDogList(entrant_ID); } divDogList.Visible = true; DogList dogList = new DogList(); dogList.MyDogList = Common.MyDogList; PopulateDogGridView(dogList.MyDogList); divGetDog.Visible = true; if(string.IsNullOrEmpty(Entrant_ID)) GetEntrantByShowAndDog(); divEntryDetails.Visible = true; if (!string.IsNullOrEmpty(Common.Entrant_ID)) { divAddCompetitor.Visible = false; divUpdateCompetitor.Visible = true; } else { divAddCompetitor.Visible = true; divUpdateCompetitor.Visible = false; } } else { divDogList.Visible = false; divAddCompetitor.Visible = false; divUpdateCompetitor.Visible = false; divEntryDetails.Visible = false; } if (!Page.IsPostBack) { PopulateForm(); if (!string.IsNullOrEmpty(Entrant_ID)) { Guid entrant_ID = new Guid(Entrant_ID); PopulateOwnerList(entrant_ID); } } }
protected void DogGridView_RowDeleting(object sender, GridViewDeleteEventArgs e) { string dog_id = DogGridView.DataKeys[e.RowIndex]["Dog_ID"].ToString(); DogList dogList = new DogList(); dogList.MyDogList = Common.MyDogList; int dogCount = dogList.DeleteDog(e.RowIndex); PopulateDogGridView(dogList.MyDogList); Common.MyDogList = dogList.MyDogList; }
protected void AddDogToList(string current_Dog_ID) { Guid dog_ID = new Guid(current_Dog_ID); Dogs dog = new Dogs(dog_ID); DogList dogList = new DogList(); dogList.MyDogList = Common.MyDogList; Dogs dg = null; if (dogList.MyDogList != null) dg = dogList.MyDogList.Find(delegate(Dogs d) { return d.Dog_ID == dog_ID; }); if (dg == null) { int dogCount = dogList.AddDog(dog); PopulateDogGridView(dogList.MyDogList); Common.MyDogList = dogList.MyDogList; } }
private void PopulateDogList() { List<DogClasses> tblDog_Classes; DogClasses dogClasses = new DogClasses(); Guid entrant_ID = new Guid(Common.Entrant_ID); DogList dogList = new DogList(); tblDog_Classes = dogClasses.GetDog_ClassesByEntrant_ID(entrant_ID); if (tblDog_Classes != null && tblDog_Classes.Count > 0) { DogOwnerList dogOwnerList = new DogOwnerList(); foreach (DogClasses dogClassRow in tblDog_Classes) { Dogs dog = new Dogs((Guid)dogClassRow.Dog_ID); dogList.AddDog(dog); } } if (dogList != null) Common.MyDogList = dogList.MyDogList; }
protected void EntryGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { EntryGridRowIndex = e.Row.RowIndex; Entrant_ID = EntryGridView.DataKeys[EntryGridRowIndex].Value.ToString(); if (!string.IsNullOrEmpty(Entrant_ID)) { Guid entrant_ID = new Guid(Entrant_ID); GridView gvDogs = e.Row.FindControl("DogGridView") as GridView; GridView gvOwners = e.Row.FindControl("OwnerGridView") as GridView; List<DogClasses> tblDog_Classes; DogClasses dogClasses = new DogClasses(); tblDog_Classes = dogClasses.GetDog_ClassesByEntrant_ID(entrant_ID, ExclNFC); if (tblDog_Classes != null && tblDog_Classes.Count > 0) { DogOwnerList dogOwnerList = new DogOwnerList(); DogList dogList = new DogList(); foreach (DogClasses dogClassRow in tblDog_Classes) { Dogs dog = new Dogs((Guid)dogClassRow.Dog_ID); dogList.AddDog(dog); List<DogOwners> lnkDog_Owners; DogOwners dogOwner = new DogOwners(); lnkDog_Owners = dogOwner.GetDogOwnersByDog_ID((Guid)dogClassRow.Dog_ID); if (lnkDog_Owners != null && lnkDog_Owners.Count > 0) { foreach (DogOwners dogOwnerRow in lnkDog_Owners) { People person = new People(dogOwnerRow.Owner_ID); dogOwnerList.AddOwner(person); } gvOwners.DataSource = dogOwnerList.MyDogOwnerList; gvOwners.DataBind(); } dogList.SortDogList(); gvDogs.DataSource = dogList.MyDogList; gvDogs.DataBind(); } } } } }