Ejemplo n.º 1
0
        protected void NewTabButton_Click(object sender, EventArgs e)
        {
            MessageBox1.ClearMessage();

            var t = new ProductDescriptionTab();

            t.Bvin = Guid.NewGuid().ToString().Replace("{", string.Empty).Replace("}", string.Empty);

            if (localProduct.Tabs.Count > 0)
            {
                var m = (from sort in localProduct.Tabs
                         select sort.SortOrder).Max();
                t.SortOrder = m + 1;
            }
            else
            {
                t.SortOrder = 1;
            }

            localProduct.Tabs.Add(t);
            if (HccApp.CatalogServices.ProductsUpdateWithSearchRebuild(localProduct))
            {
                Response.Redirect("ProductsEdit_TabsEdit.aspx?tid=" + t.Bvin + "&id=" + localProduct.Bvin);
            }
            else
            {
                MessageBox1.ShowError("Unable to update product tabs.");
            }

            localProduct = HccApp.CatalogServices.Products.Find(localProduct.Bvin);
            LoadItems();
        }
Ejemplo n.º 2
0
        private bool SaveItem()
        {
            MessageBox1.ClearMessage();
            var success = false;

            var p = HccApp.CatalogServices.Products.Find(productBvin);

            if (p == null)
            {
                return(false);
            }

            var tab = p.Tabs.FirstOrDefault(t => t.Bvin == tabid);

            if (tab == null)
            {
                tab      = new ProductDescriptionTab();
                tab.Bvin = tabid;
                p.Tabs.Add(tab);
            }
            tab.TabTitle = TabTitleField.Text.Trim();
            tab.HtmlData = HtmlDataField.Text.Trim();
            success      = HccApp.CatalogServices.ProductsUpdateWithSearchRebuild(p);

            if (success)
            {
                MessageBox1.ShowOk("Changes Saved!");
            }
            else
            {
                MessageBox1.ShowWarning("Unable to save changes. An administrator has been alerted.");
            }

            return(success);
        }
Ejemplo n.º 3
0
        private void RenderSingleItem(StringBuilder sb, ProductDescriptionTab t)
        {
            var destinationLink = string.Format("ProductsEdit_TabsEdit.aspx?tid={0}&id={1}", t.Bvin, productBvin);

            sb.Append("<div class=\"dragitem\" id=\"" + t.Bvin + "\"><table class=\"formtable hcGrid\" width=\"100%\"><tbody class=\"ui-sortable\"><tr>");
            sb.AppendFormat("<td width=\"30\"><a href=\"#\" class=\"handle hcIconMove\">&nbsp;</a></td>");
            sb.Append("<td><a href=\"" + destinationLink + "\">" + t.TabTitle + "</a></td>");
            sb.Append("<td width=\"75\"><a class=\"hcIconEdit\" href=\"" + destinationLink + "\">&nbsp;</a>");
            sb.Append("<a href=\"#\" class=\"trash hcIconDelete\" id=\"rem" + t.Bvin + "\">&nbsp;</a></td>");
            sb.Append("</tr></tbody></table></div>");
        }
Ejemplo n.º 4
0
        private void RenderSingleItem(StringBuilder sb, ProductDescriptionTab t)
        {
            string destinationLink = "ProductsEdit_TabsEdit.aspx?tid=" + t.Bvin + "&id=" + productBvin;

            sb.Append("<div class=\"dragitem\" id=\"" + t.Bvin + "\"><table class=\"formtable\" width=\"100%\"><tr>");
            sb.Append("<td><a href=\"" + destinationLink + "\">");
            sb.Append(t.TabTitle);
            sb.Append("</a></td>");
            sb.Append("<td width=\"75\"><a href=\"" + destinationLink + "\"><img src=\"../images/buttons/edit.png\" alt=\"edit\" /></a></td>");
            sb.Append("<td width=\"30\"><a href=\"#\" class=\"trash\" id=\"rem" + t.Bvin + "\"");
            sb.Append("><img src=\"../../images/system/trashcan.png\" alt=\"Delete\" /></a></td>");
            sb.Append("<td width=\"30\"><a href=\"#\" class=\"handle\"><img src=\"../../images/system/draghandle.png\" alt=\"Move\" /></a></td>");
            sb.Append("</tr></table></div>");
        }
Ejemplo n.º 5
0
        private void RenderSingleItem(StringBuilder sb, ProductDescriptionTab t)
        {
            var destinationLink    = string.Format("ProductsEdit_TabsEdit.aspx?tid={0}&id={1}", t.Bvin, productBvin);
            var trashcanImageUrl   = ResolveUrl("~/DesktopModules/Hotcakes/Core/Admin/Images/trashcan.png");
            var draghandleImageUrl = ResolveUrl("~/DesktopModules/Hotcakes/Core/Admin/Images/draghandle.png");

            sb.Append("<div class=\"dragitem\" id=\"" + t.Bvin +
                      "\"><table class=\"formtable hcGrid\" width=\"100%\"><tbody class=\"ui-sortable\"><tr>");
            sb.AppendFormat(
                "<td width=\"30\"><a href=\"#\" class=\"handle\"><img class=\"hcIconMove\" alt=\"Move\" /></a></td>");
            sb.Append("<td><a href=\"" + destinationLink + "\">");
            sb.Append(t.TabTitle);
            sb.Append("</a></td>");
            sb.Append("<td width=\"75\"><a href=\"" + destinationLink +
                      "\"><img class=\"hcIconEdit\" alt=\"edit\" /></a>");
            sb.Append("<a href=\"#\" class=\"trash\" id=\"rem" + t.Bvin + "\"");
            sb.AppendFormat("><img class=\"hcIconDelete\" alt=\"Delete\" /></a></td>");
            sb.Append("</tr></tbody></table></div>");
        }