Exemplo n.º 1
0
        private void UpdateDataView()
        {
            // Check if main item has a roll in its descendants
            if (itemObj.HasRollDescendant() || itemObj.GetRoll() != null)
            {
                cbFilter.Visible = true;
                UITools.ShowToolBarLabel(uwToolbar, "lbSoftRoll");
                UITools.ShowToolBarSeparator(uwToolbar, "CloseSep");
            }
            else
            {
                cbFilter.Visible = false;
                UITools.HideToolBarLabel(uwToolbar, "lbSoftRoll");
                UITools.HideToolBarSeparator(uwToolbar, "CloseSep");
            }

            cbFilter.Checked = displaySoftRoll;

            //lbTitle.Text = "Export product - " + itemObj.FullName;
            //lbError.Visible = false;
            webTree.ClearAll();
            Node mainNode = webTree.Nodes.Add("Select the Items for Summary Report");

            mainNode.CheckBox = CheckBoxes.False;
            if (displaySoftRoll && itemObj.GetRoll() != null)
            {
                itemObj = itemObj.GetRoll();
            }
            AddChild(mainNode, itemObj);
            webTree.ExpandAll();
        }
Exemplo n.º 2
0
        private void AddChild(Node n, HyperCatalog.Business.Item obj)
        {
            if ((displaySoftRoll && (obj.IsRoll || obj.GetRoll() == null)) ||
                (!displaySoftRoll && !obj.IsRoll))
            {
                Node child = new Node();
                child.DataKey = obj.Id;
                child.Text    = string.Empty;
                if (obj.IsRoll)
                {
                    child.Text += "<img src='/hc_v4/img/ed_roll.gif'> ";
                }
                child.Text    += obj.FullName;
                child.ImageUrl = child.SelectedImageUrl = "/hc_v4/ig/s_" + obj.Status.ToString().Substring(0, 1) + ".gif";
                if (obj.LevelId == skuLevelId)
                {
                    child.ImageUrl = "/hc_v4/img/type_" + obj.TypeId.ToString() + ".png";
                    if (obj.Sku.ToUpper().EndsWith("T")) // Top Value
                    {
                        child.ImageUrl = "/hc_v4/img/type_1.png";
                    }
                    child.SelectedImageUrl = child.ImageUrl;
                    switch (obj.Status.ToString())
                    {
                    case ("O"):
                        child.Text = "<font color=gray>[O] </font>" + child.Text;
                        break;

                    case ("F"):
                        child.Text = "<font color=green>[F] </font>" + child.Text;
                        break;
                    }
                }
                else
                {
                    if (obj.LevelId > skuLevelId)
                    {
                        child.SelectedImageUrl = child.ImageUrl = "/hc_v4/img/option.png";
                    }
                }
                n.Nodes.Add(child);

                foreach (HyperCatalog.Business.Item subItem in obj.Childs)
                {
                    AddChild(child, subItem);
                }
            }
        }
Exemplo n.º 3
0
        private void MoveItem()
        {
            System.Int64 parentId    = Convert.ToInt64(ViewState["NewParentId"]);
            System.Int64 oldParentId = itemObj.ParentId;
            if (parentId > 0)
            {
                using (Database dbObj = Utils.GetMainDB())
                {
                    if (dbObj != null)
                    {
                        dbObj.TimeOut = 300;
                        int r = dbObj.RunSPReturnInteger("dbo._Item_Move",
                                                         new SqlParameter("@ItemId", itemObj.Id),
                                                         new SqlParameter("@NewParentId", parentId),
                                                         new SqlParameter("@UserId", SessionState.User.Id));
                        dbObj.CloseConnection();

                        if (r < 0) // error
                        {
                            lbError.CssClass = "hc_error";
                            lbError.Text     = dbObj.LastError;
                            lbError.Visible  = true;
                        }
                        else
                        {
                            HyperCatalog.Shared.SessionState.CurrentItem = itemObj;
                            SessionState.User.LastVisitedItem            = itemObj.Id;
                            SessionState.User.QuickSave();
                            HyperCatalog.Business.Item.UpdateAllItemProductLines();

                            ItemUpdateWorkingTables dlgt1 = new ItemUpdateWorkingTables(QDEUtils.wsTranslationObj.ItemUpdateWorkingTables);
                            // call BeginInvoke to initiate the asynchronous operation
                            IAsyncResult ar1 = dlgt1.BeginInvoke(itemObj.Id, itemObj.Sku != string.Empty, null, null);

                            ItemUpdateWorkingTables dlgt2 = new ItemUpdateWorkingTables(QDEUtils.wsTranslationObj.ItemUpdateWorkingTables);
                            // call BeginInvoke to initiate the asynchronous operation
                            IAsyncResult ar2 = dlgt2.BeginInvoke(oldParentId, false, null, null);

                            Item rollItem = itemObj.GetRoll();
                            if (rollItem != null)
                            {
                                ItemUpdateWorkingTables dlgt3 = new ItemUpdateWorkingTables(QDEUtils.wsTranslationObj.ItemUpdateWorkingTables);
                                // call BeginInvoke to initiate the asynchronous operation
                                IAsyncResult ar3 = dlgt3.BeginInvoke(rollItem.Id, rollItem.Sku != string.Empty, null, null);
                            }

                            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "UpdateTV", "<script>UpdateTV();</script>");
                        }
                    }
                    else // dbObj is null
                    {
                        lbError.CssClass = "hc_error";
                        lbError.Text     = "Object database is null";
                        lbError.Visible  = true;
                    }
                }
            }
            else // parentId = 0
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "missingParent", "<script>alert('Missing parent');</script>");
            }
        }
Exemplo n.º 4
0
        private void UpdateDataView()
        {
            // Default value
            lbError.Visible                    = false;
            rbFinal.Checked                    = true;
            pnlSoftRoll.Visible                = false;
            pnlChildren.Visible                = false;
            pnlMasterPublishing.Visible        = false;
            pnlForceTranslationToDraft.Visible = false;
            pnlReport.Visible                  = false;

            // Update culture title
            if (culture != null)
            {
                uwToolbar.Items.FromKeyLabel("Culture").Text    = culture.Name;
                uwToolbar.Items.FromKeyLabel("Culture").Image   = "/hc_v4/img/flags/" + culture.CountryCode + ".gif";
                uwToolbar.Items.FromKeyLabel("Culture").ToolTip = culture.CountryCode;
            }

            if (item != null)
            {
                // update title
                lbTitle.Text = item.FullName;
                if (lbTitle.Text.Length > 50)
                {
                    lbTitle.Text = lbTitle.Text.Substring(0, 49) + "...";
                }

                bool isUgd = true;

                if (inputFormId == -1)
                {
                    #region "display or not panel to include children"
                    pnlChildren.Visible = item.Childs.Count > 0;
                    if (isUgd)
                    {
                        tdChildren.Attributes["class"] = "ugd";
                    }
                    else
                    {
                        tdChildren.Attributes["class"] = "uga";
                    }
                    isUgd = !isUgd;
                    #endregion
                    #region "display or not panel to soft roll"
                    Item itemRoll = item.GetRoll();
                    // item has a soft roll (that is initialized for regional or local culture) or item is a soft roll
                    if (item.IsRoll || (itemRoll != null && (culture.Type == CultureType.Master || (culture.Type != CultureType.Master && itemRoll.IsInitialized))))
                    {
                        pnlSoftRoll.Visible = true;
                        if (isUgd)
                        {
                            tdSoftRoll.Attributes["class"] = "ugd";
                        }
                        else
                        {
                            tdSoftRoll.Attributes["class"] = "uga";
                        }
                        isUgd = !isUgd;
                    }
                    #endregion
                }
                #region "display if current language is Master"
                wdMasterPublishing.Value = GetExistingMasterPublishingDate();
                if (SessionState.Culture.Type == HyperCatalog.Business.CultureType.Master && rbFinal.Checked)
                {
                    pnlMasterPublishing.Visible = true;
                    if (isUgd)
                    {
                        tdMasterPublishing.Attributes["class"] = "ugd";
                        tdCalendar.Attributes["class"]         = "ugd";
                    }
                    else
                    {
                        tdMasterPublishing.Attributes["class"] = "uga";
                        tdCalendar.Attributes["class"]         = "uga";
                    }
                    isUgd = !isUgd;
                }
                #endregion
                #region "display panel to force translation"
                pnlForceTranslationToDraft.Visible = true;
                if (isUgd)
                {
                    tdForceTranslation.Attributes["class"] = "ugd";
                }
                else
                {
                    tdForceTranslation.Attributes["class"] = "uga";
                }
                isUgd = !isUgd;
                #endregion
                #region "display panel to create report"
                pnlReport.Visible = true;
                if (isUgd)
                {
                    tdReport.Attributes["class"] = "ugd";
                }
                else
                {
                    tdReport.Attributes["class"] = "uga";
                }
                isUgd = !isUgd;
                #endregion
            }
        }