示例#1
0
        private void loadRegionItem(HyperCatalog.Business.Region region, string initialOffset, string offset)
        {
            if (region != null && regionList != null)
            {
                //add the region in the lists
                regionList.Items.Add(new ListItem(offset + (region.Name == null || region.Name.Equals(string.Empty) ? region.Code : region.Name) + " (" + region.TotalCountryCount + ")", region.Code));
                txtRegionCodeValue.Items.Add(new ListItem(region.Name == null || region.Name.Equals(string.Empty) ? region.Code : region.Name, region.Code));

                //load child regions
                foreach (HyperCatalog.Business.Region subRegion in region.SubRegions)
                {
                    loadRegionItem(subRegion, initialOffset, offset + initialOffset);
                }
            }
        }
示例#2
0
        private void AddRegion(HyperCatalog.Business.Region region, PLCList plcDates, int offSet)
        {
            Trace.Write("Enter Add Region [" + region.Code + "]");
            //Fix for eZilla #70617 ( GEMSTONE: WW & NA PLC dates are not visible in UI) - Prabhu
            PLC p = new PLC();

            p.CountryCode = region.Code;
            #region identify if region is in Item PLC list
            if (plcDates != null)
            {
                foreach (PLC plc in plcDates)
                {
                    if (plc.CountryCode == region.Code2)
                    {
                        p = plc;
                        break;
                    }
                }
            }
            #endregion
            //UltraGridRow newRow = new UltraGridRow(new object[] { "", region.Code + " - " + region.Name, "", null, null, null, null, null, "R", region.Code, region.ParentCode, offSet });
            UltraGridRow newRow = new UltraGridRow(new object[] { "", region.Code + " - " + region.Name, "", p.BlindDate, p.FullDate, p.ObsoleteDate, p.AnnouncementDate, p.RemovalDate, "R", region.Code, region.ParentCode, offSet, "",
                                                                  p.BlindLocked, p.FullLocked, p.ObsoleteLocked, p.AnnouncementLocked, p.RemovalLocked, p.EndOfSupportLocked,
                                                                  p.DiscontinueLocked, p.EndOfLifeLocked, p.BlindDateType, p.FullDateType, p.ObsoleteDateType, p.AnnouncementDateType,
                                                                  p.RemovalDateType, p.EndOfSupportDateType, p.DiscontinueDateType, p.EndOfLifeDateType, p.Excluded, p.ExcludeModifierId, p.EndOfSupportDate, p.DiscontinueDate, p.EndOfLifeDate });
            //Fix for eZilla #70617 ( GEMSTONE: WW & NA PLC dates are not visible in UI) - Prabhu

            dg.Rows.Add(newRow);
            rowCount++;
            newRow.Cells.FromKey("Region").Style.Padding.Left = Unit.Parse((offSet * 5).ToString() + "px");
            newRow.Cells.FromKey("Region").Style.CssClass     = "hc_region";
            newRow.DataKey = region.Code;

            #region Add extra button at the end of the row
            newRow.Cells.FromKey("ApplyChilds").Text = "<IMG title='Clear all sub countries' src='/hc_v4/img/recursive.gif' onclick='CSC(\"" + dg.ClientID + "\", " + newRow.Index.ToString() + ");' BORDER=0 VALIGN=MIDDLE BORDER=0 STYLE='cursor:hand'></IMG>";
            #endregion
            AddCountrieRows(region.Countries, plcDates, offSet + 1);
            foreach (HyperCatalog.Business.Region subRegion in region.SubRegions)
            {
                //Fix for eZilla #70617 ( GEMSTONE: WW & NA PLC dates are not visible in UI) - Prabhu
                if (subRegion.SubRegions.Count > 0 || subRegion.Countries.Count > 0 || Item.NodeOID > 0)
                {
                    AddRegion(subRegion, plcDates, offSet + 1);
                }
            }
            Trace.Write("Exit Add Region [" + region.Code + "]");
        }
示例#3
0
        /// <summary>
        /// Load country list
        /// </summary>
        private void loadCountries()
        {
            _countries = null;

            //empty country list
            countriesGrid.Rows.Clear();

            foreach (HyperCatalog.Business.Country country in countries)
            {
                HyperCatalog.Business.Region region = country.Region;

                //build a new row for this country
                UltraGridRow newRow = new UltraGridRow(new object[] { country.Code, country.Name, region != null ? region.Code + (region.Name != null ? " - " + region.Name : "") : "" });
                newRow.DataKey = country.Code;

                //add this row to the grid
                countriesGrid.Rows.Add(newRow);
            }
        }
示例#4
0
        public void LoadPLCGrid()
        {
            Trace.Write("Enter LoadPLCGrid");
            dg.Rows.Clear();
            rowCount = 0;

            using (PLCList plc = Item != null ? Item.PLCDates : null)
            {
                if (SessionState.Culture.Type == CultureType.Locale)
                {
                    // Country
                    using (CountryList countries = new CountryList())
                    {
                        countries.Add(SessionState.Culture.Country);
                        AddCountrieRows(countries, plc, 0);
                    }
                }
                else
                {
                    // Region or master region
                    using (HyperCatalog.Business.Region rootRegion = HyperCatalog.Business.Region.GetByShortCode(SessionState.Culture.CountryCode))
                    {
                        AddRegion(rootRegion, plc, 0);
                    }
                }

                Utils.InitGridSort(ref dg, false);
                if (rowCount > 0)
                {
                    if (rowCount == 1)
                    {
                        // Add empty row
                        UltraGridRow newRow = new UltraGridRow(new object[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                                                              string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                                                              string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                                                              string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty,
                                                                              string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty });
                        dg.Rows.Add(newRow);
                        newRow.Cells.FromKey("Region").AllowEditing         = AllowEditing.No;
                        newRow.Cells.FromKey("Region").Style.CssClass       = "ro";
                        newRow.Cells.FromKey("Blind").AllowEditing          = AllowEditing.No;
                        newRow.Cells.FromKey("Blind").Style.CssClass        = "ro";
                        newRow.Cells.FromKey("PID").AllowEditing            = AllowEditing.No;
                        newRow.Cells.FromKey("PID").Style.CssClass          = "ro";
                        newRow.Cells.FromKey("POD").AllowEditing            = AllowEditing.No;
                        newRow.Cells.FromKey("POD").Style.CssClass          = "ro";
                        newRow.Cells.FromKey("Announcement").AllowEditing   = AllowEditing.No;
                        newRow.Cells.FromKey("Announcement").Style.CssClass = "ro";
                        newRow.Cells.FromKey("Removal").AllowEditing        = AllowEditing.No;
                        newRow.Cells.FromKey("Removal").Style.CssClass      = "ro";

                        rowCount++;
                    }

                    int height = (rowCount + 1) * 20; // (nb rows + header)
                    if (height < 300)
                    {
                        dg.Height = Unit.Pixel(height);
                    }
                }
                dg.DisplayLayout.CellClickActionDefault        = CellClickAction.Edit;
                dg.DisplayLayout.AllowSortingDefault           = AllowSorting.No;
                dg.DisplayLayout.UseFixedHeaders               = true;
                dg.Columns.FromKey("ApplyChilds").Header.Fixed = true;
                dg.Columns.FromKey("Region").Header.Fixed      = true;
                //Commented for fix QC 7304: Crystal UAT - In the Product Life Cycle section Delete functionality still available
                //dg.Columns.FromKey("ApplyChilds").Hidden = !SessionState.User.HasCapability(CapabilitiesEnum.MANAGE_PLC);
                dg.Columns.FromKey("ApplyChilds").Hidden = true;

                Trace.Write("Exit LoadPLCGrid");
            }
        }
示例#5
0
 /// <summary>
 /// Recursively add regions in the list of regions
 /// </summary>
 /// <param name="region">Current region to add</param>
 /// <param name="offset">Text offset to prefix the region name (responsible for indentation along the hierarchy)</param>
 private void loadRegionItem(HyperCatalog.Business.Region region, string initialOffset)
 {
     loadRegionItem(region, initialOffset, string.Empty);
 }