示例#1
0
        public List <CatalogueList> GetCatalogueListByRingNumber()
        {
            List <CatalogueList> retVal = new List <CatalogueList>();

            try
            {
                CatalogueListBL catalogueListByRingNumbers = new CatalogueListBL(_connString);
                tblCatalogueListByRingNumber = catalogueListByRingNumbers.GetCatalogueListOrderByRingNumber();
                if (tblCatalogueListByRingNumber != null && tblCatalogueListByRingNumber.Rows.Count > 0)
                {
                    foreach (DataRow row in tblCatalogueListByRingNumber.Rows)
                    {
                        CatalogueList catalogueListByRingNumber = new CatalogueList(_connString);
                        catalogueListByRingNumber.Ring_No               = Utils.DBNullToShort(row["Ring_No"]);
                        catalogueListByRingNumber.Owner                 = Utils.DBNullToString(row["Owner"]);
                        catalogueListByRingNumber.Address               = Utils.DBNullToString(row["Address"]);
                        catalogueListByRingNumber.Dog_KC_Name           = Utils.DBNullToString(row["Dog_KC_Name"]);
                        catalogueListByRingNumber.Dog_Breed_Description = Utils.DBNullToString(row["Dog_Breed_Description"]);
                        catalogueListByRingNumber.Dog_Gender            = Utils.DBNullToString(row["Dog_Gender"]);
                        catalogueListByRingNumber.Date_Of_Birth         = Utils.DBNullToString(row["Date_Of_Birth"]);
                        catalogueListByRingNumber.Class_Name            = Utils.DBNullToString(row["Class_Name"]);
                        catalogueListByRingNumber.Catalogue             = Utils.DBNullToBool(row["Catalogue"]);

                        retVal.Add(catalogueListByRingNumber);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }


            return(retVal);
        }
示例#2
0
        public static List <CatalogueList> GetCatalogueListData(string connString, string Show_ID)
        {
            List <CatalogueList> retVal = new List <CatalogueList>();

            try
            {
                CatalogueList catalogue = new CatalogueList(connString);
                Guid          show_ID   = new Guid(Show_ID);
                if (catalogue.PopulateCatalogueListByRingNumber(show_ID))
                {
                    retVal = catalogue.GetCatalogueListByRingNumber();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retVal);
        }
示例#3
0
 protected void btnGetCatalogueList_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Show_ID))
     {
         divCatalogueList.Visible = true;
         CatalogueListByRingNumberList = CatalogueList.GetCatalogueListData(Show_ID);
         if (CatalogueListByRingNumberList != null && CatalogueListByRingNumberList.Count > 0)
         {
             short ring_No = 0;
             List<CatalogueList> displayList = new List<CatalogueList>();
             CatalogueList displayItem = new CatalogueList();
             foreach (CatalogueList row in CatalogueListByRingNumberList)
             {
                 if (row.Ring_No != ring_No && ring_No != 0)
                 {
                     //new ring number
                     CreateDisplayItem(displayItem);
                     displayList.Add(displayItem);
                     displayItem = new CatalogueList();
                 }
                 //existing ring number
                 displayItem.Ring_No = row.Ring_No;
                 displayItem.Owners.Add(row.Owner);
                 displayItem.Addresses.Add(row.Address);
                 displayItem.Dog_KC_Name = row.Dog_KC_Name;
                 displayItem.Dog_Breed_Description = row.Dog_Breed_Description;
                 displayItem.Dog_Gender = row.Dog_Gender;
                 displayItem.Date_Of_Birth = row.Date_Of_Birth;
                 displayItem.Breeders.Add(row.Breeder);
                 displayItem.Sire = row.Sire;
                 displayItem.Dam = row.Dam;
                 displayItem.Class_NameList.Add(row.Class_Name);
                 displayItem.BreederIsOwner = row.BreederIsOwner;
                 displayItem.Catalogue = row.Catalogue;
                 ring_No = row.Ring_No;
             }
             CreateDisplayItem(displayItem);
             displayList.Add(displayItem);
         }
     }
 }
示例#4
0
        public List<CatalogueList> GetCatalogueListByRingNumber()
        {
            List<CatalogueList> catalogueListByRingNumbersList = new List<CatalogueList>();
            CatalogueListBL catalogueListByRingNumbers = new CatalogueListBL();
            tblCatalogueListByRingNumber = catalogueListByRingNumbers.GetCatalogueListByRingNumber();

            if (tblCatalogueListByRingNumber != null && tblCatalogueListByRingNumber.Count > 0)
            {
                foreach (sss.tblCatalogueListByRingNumberRow row in tblCatalogueListByRingNumber)
                {
                    CatalogueList catalogueListByRingNumber = new CatalogueList();
                    catalogueListByRingNumber.Ring_No = row.Ring_No;
                    catalogueListByRingNumber.Owner = row.Owner;
                    catalogueListByRingNumber.Address = row.Address;
                    catalogueListByRingNumber.Dog_KC_Name = row.Dog_KC_Name;
                    catalogueListByRingNumber.Dog_Breed_Description = row.Dog_Breed_Description;
                    catalogueListByRingNumber.Dog_Gender = row.Dog_Gender;
                    catalogueListByRingNumber.Date_Of_Birth = row.Date_Of_Birth;
                    catalogueListByRingNumber.Breeder = row.Breeder;
                    catalogueListByRingNumber.Sire = row.Sire;
                    catalogueListByRingNumber.Dam = row.Dam;
                    catalogueListByRingNumber.Class_Name = row.Class_Name;
                    catalogueListByRingNumber.BreederIsOwner = row.BreederIsOwner;
                    if (!row.IsCatalogueNull())
                    {
                        catalogueListByRingNumber.Catalogue = row.Catalogue;
                    }
                    else
                    {
                        catalogueListByRingNumber.Catalogue = false;
                    }
                    catalogueListByRingNumbersList.Add(catalogueListByRingNumber);
                }
            }

            return catalogueListByRingNumbersList;
        }
示例#5
0
 public static List<CatalogueList> GetCatalogueListData(string Show_ID)
 {
     List<CatalogueList> catalogueList = new List<CatalogueList>();
     CatalogueList catalogue = new CatalogueList();
     Guid show_ID = new Guid(Show_ID);
     if (catalogue.PopulateCatalogueListByRingNumber(show_ID))
     {
         catalogueList = catalogue.GetCatalogueListByRingNumber();
     }
     return catalogueList;
 }
示例#6
0
    private void CreateDisplayItem(CatalogueList displayItem)
    {
        //TableRow r0 = new TableRow();
        //TableCell r0c0 = new TableCell();
        //r0c0.Text = string.Empty;
        //r0c0.CssClass = "tableCellWidth1";
        //r0.Cells.Add(r0c0);
        //TableCell r0c2 = new TableCell();
        //r0c2.Text = string.Empty;
        //r0c2.CssClass = "tableCellWidth2";
        //r0.Cells.Add(r0c2);
        //TableCell r0c3 = new TableCell();
        //r0c3.Text = string.Empty;
        //r0c3.CssClass = "tableCellWidth3";
        //r0.Cells.Add(r0c3);
        //TableCell r0c4 = new TableCell();
        //r0c4.Text = string.Empty;
        //r0c4.CssClass = "tableCellWidth4";
        //r0.Cells.Add(r0c4);
        //TableCell r0c5 = new TableCell();
        //r0c5.Text = string.Empty;
        //r0c5.CssClass = "tableCellWidth5";
        //r0.Cells.Add(r0c5);
        //TableCell r0c6 = new TableCell();
        //r0c6.Text = string.Empty;
        //r0c6.CssClass = "tableCellWidth6";
        //r0.Cells.Add(r0c6);
        //TableCell r0c7 = new TableCell();
        //r0c7.Text = string.Empty;
        //r0c7.CssClass = "tableCellWidth7";
        //r0.Cells.Add(r0c7);
        //TableCell r0c8 = new TableCell();
        //r0c8.Text = string.Empty;
        ////r0c8.CssClass = "tableCellWidth8";
        //r0.Cells.Add(r0c8);
        //tblCatalogueTable.Rows.Add(r0);

        TableRow r1 = new TableRow();
        TableCell r1c1 = new TableCell();
        r1c1.CssClass = "CellBold";
        if (displayItem.Catalogue)
        {
            r1c1.Text = "*";
        }
        else
        {
            r1c1.Text = string.Empty;
        }
        r1.Cells.Add(r1c1);
        string ownerList = string.Empty;
        foreach (string owner in displayItem.Owners)
        {
            if (ownerList.IndexOf(owner) == -1)
            {
                ownerList = string.Format("{0}{1}", ownerList, " & " + owner);
            }
        }
        TableCell r1c2 = new TableCell();
        r1c2.ColumnSpan = 2;
        r1c2.CssClass = "CellBold";
        r1c2.Text = ownerList.Substring(3);
        r1.Cells.Add(r1c2);
        TableCell r1c3 = new TableCell();
        r1c3.ColumnSpan = 5;
        r1c3.Text = displayItem.Addresses[0];
        r1.Cells.Add(r1c3);
        if(displayItem.Owners[0] != PreviousOwner)
            tblCatalogueTable.Rows.Add(r1);
        PreviousOwner = displayItem.Owners[0];

        TableRow r2 = new TableRow();
        TableCell r2c1 = new TableCell();
        r2c1.CssClass = "CellBold";
        r2c1.Text = displayItem.Ring_No.ToString();
        r2.Cells.Add(r2c1);
        TableCell r2c2 = new TableCell();
        r2c2.CssClass = "CellBold";
        r2c2.Text = displayItem.Dog_KC_Name;
        r2.Cells.Add(r2c2);
        TableCell r2c3 = new TableCell();
        r2c3.Text = displayItem.Dog_Breed_Description;
        r2.Cells.Add(r2c3);
        TableCell r2c4 = new TableCell();
        r2c4.Text = displayItem.Dog_Gender;
        r2.Cells.Add(r2c4);
        TableCell r2c5 = new TableCell();
        r2c5.Width = 5;
        r2c5.Text = displayItem.Date_Of_Birth;
        r2.Cells.Add(r2c5);
        string breederList = string.Empty;
        foreach (string breeder in displayItem.Breeders)
        {
            if (breederList.IndexOf(breeder) == -1)
            {
                breederList = string.Format("{0}{1}", breederList, " & " + breeder);
            }
        }
        TableCell r2c6 = new TableCell();
        if (displayItem.BreederIsOwner)
        {
            r2c6.Text = "Owner";
        }
        else
        {
            r2c6.Text = breederList.Substring(3);
        }
        r2.Cells.Add(r2c6);
        TableCell r2c7 = new TableCell();
        r2c7.Text = displayItem.Sire;
        r2.Cells.Add(r2c7);
        TableCell r2c8 = new TableCell();
        r2c8.Text = displayItem.Dam;
        r2.Cells.Add(r2c8);
        tblCatalogueTable.Rows.Add(r2);

        string classList = string.Empty;
        foreach (string className in displayItem.Class_NameList)
        {
            if (!string.IsNullOrEmpty(className))
            {
                if (classList.IndexOf(className) == -1)
                {
                    classList = string.Format("{0}{1}", classList, " & " + className);
                    TableRow r3 = new TableRow();
                    TableCell r3c1 = new TableCell();
                    r3c1.ColumnSpan = 8;
                    r3c1.CssClass = "CellRightBold";
                    r3c1.Text = className;
                    r3.Cells.Add(r3c1);
                    tblCatalogueTable.Rows.Add(r3);
                }
            }
        }
    }