Esempio n. 1
0
    /// <summary>
    /// Bind data in the edit mode
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void BindEditData()
    {
        TaxRuleAdmin taxRuleAdmin = new TaxRuleAdmin();
        TaxClass taxClass = new TaxClass();

        if (taxId > 0)
        {
            taxClass = taxRuleAdmin.GetByTaxClassID(taxId);
            lblTitle.Text = lblTitle.Text + " - " + taxClass.Name;
            txtTaxClassName.Text = taxClass.Name;
            txtDisplayOrder.Text = taxClass.DisplayOrder.ToString();
            chkActiveInd.Checked = taxClass.ActiveInd;
        }
    }
Esempio n. 2
0
    /// <summary>
    /// Submit button click event to store in Tax Class
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        TaxRuleAdmin taxRuleAdmin = new TaxRuleAdmin();
        TaxClass taxClass = new TaxClass();

        if (taxId > 0)
        {
            taxClass = taxRuleAdmin.GetByTaxClassID(taxId);
        }

        taxClass.Name = txtTaxClassName.Text;
        taxClass.DisplayOrder = int.Parse(txtDisplayOrder.Text);
        taxClass.ActiveInd = chkActiveInd.Checked;

        bool retval = false;

        if (taxId > 0)
        {
            retval = taxRuleAdmin.UpdateTaxClass(taxClass);
        }
        else
        {
            retval = taxRuleAdmin.InsertTaxClass(taxClass);
        }

        if (retval)
        {
            // redirect to view page
            Response.Redirect("~/admin/secure/settings/taxes/view.aspx?taxId=" + taxClass.TaxClassID);
        }
        else
        {
            // display error message
            lblMsg.Text = "An error occurred while updating. Please try again.";
        }
    }
Esempio n. 3
0
    /// <summary>
    /// Binding Product Values into label Boxes
    /// </summary>
    public void BindViewData()
    {
        //Create Instance for Product Admin and Product entity
        ZNode.Libraries.Admin.ProductAdmin prodAdmin = new ProductAdmin();
        Product product=prodAdmin.GetByProductId(ItemId);

        DataSet ds = prodAdmin.GetProductDetails(ItemId);
        int Count = 0;

        //Check for Number of Rows
        if (ds.Tables[0].Rows.Count != 0)
        {
            //Bind ProductType,Manufacturer,Supplier
            lblProdType.Text = ds.Tables[0].Rows[0]["producttype name"].ToString();
            lblManufacturerName.Text = ds.Tables[0].Rows[0]["MANUFACTURER NAME"].ToString();

            //Check For Product Type
            productTypeID = int.Parse(ds.Tables[0].Rows[0]["ProductTypeId"].ToString());
            Count = prodAdmin.GetAttributeCount(int.Parse(ds.Tables[0].Rows[0]["ProductTypeId"].ToString()), ZNodeConfigManager.SiteConfig.PortalID);
            //Check product atributes count
            if (Count > 0)
            {
                tabProductDetails.Tabs[2].Enabled = true; // Enable Manage inventory tab
            }
            else
            {
                tabProductDetails.Tabs[2].Enabled = false;// Disable Manage inventory tab
            }
        }

        if (product != null)
        {
            //General Information
            lblProdName.Text = product.Name;
            lblProdNum.Text  =  product.ProductNum.ToString();
            if (Count > 0)
            {
                lblProductSKU.Text = "See Manage SKUs tab";
                lblQuantity.Text = "See Manage SKUs tab";
                lblReOrder.Text = "See Manage SKUs tab";
                lblSupplierName.Text = "See Manage SKUs tab";
            }
            else
            {
                lblProductSKU.Text = product.SKU;

                if(product.QuantityOnHand.HasValue)
                lblQuantity.Text = product.QuantityOnHand.Value.ToString();
                if(product.ReorderLevel.HasValue)
                lblReOrder.Text = product.ReorderLevel.Value.ToString();
                lblSupplierName.Text = ds.Tables[0].Rows[0]["Supplier Name"].ToString();
            }

            if (product.MaxQty.HasValue)
                lblMaxQuantity.Text = product.MaxQty.Value.ToString();

            //image
            if (product.ImageFile.Trim().Length > 0)
            {
                string ImageFilePath = ZNodeConfigManager.EnvironmentConfig.MediumImagePath + product.ImageFile;
                ItemImage.ImageUrl = ImageFilePath;
            }
            else
            {
                ItemImage.ImageUrl = ZNodeConfigManager.SiteConfig.ImageNotAvailablePath;
            }

            //Product Description and Features
            lblShortDescription.Text = product.ShortDescription;
            lblProductDescription.Text = product.Description;
            lblProductFeatures.Text = product.FeaturesDesc;
            lblproductspecification.Text = product.Specifications;
            lbladditionalinfo.Text = product.AdditionalInformation;
            lblDownloadLink.Text = product.DownloadLink;

            //Product Attributes
            if (product.RetailPrice.HasValue)
                lblRetailPrice.Text = product.RetailPrice.Value.ToString("c");
            if (product.WholesalePrice.HasValue)
                lblWholeSalePrice.Text = product.WholesalePrice.Value.ToString("c");
            lblSalePrice.Text = FormatPrice(product.SalePrice);
            lblWeight.Text = this.FormatProductWeight(product.Weight);
            if (product.Height.HasValue)
                lblHeight.Text = product.Height.Value.ToString("N2") + " " + ZNodeConfigManager.SiteConfig.DimensionUnit;
            if (product.Width.HasValue)
                lblWidth.Text = product.Width.Value.ToString("N2") + " " + ZNodeConfigManager.SiteConfig.DimensionUnit;
            if (product.Length.HasValue)
                lblLength.Text = product.Length.Value.ToString("N2") + " " + ZNodeConfigManager.SiteConfig.DimensionUnit;

            //Display Settings
            chkProductEnabled.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(bool.Parse(product.ActiveInd.ToString()));
            lblProdDisplayOrder.Text = product.DisplayOrder.ToString();
            chkIsSpecialProduct.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(this.DisplayVisible(product.HomepageSpecial));
            chkIsNewItem.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(this.DisplayVisible(product.NewProductInd));
            chkProductPricing.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(this.DisplayVisible(product.CallForPricing));
            chkproductInventory.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(this.DisplayVisible(product.InventoryDisplay));

            // Display Tax Class Name
            if (product.TaxClassID.HasValue)
            {

                TaxRuleAdmin taxRuleAdmin = new TaxRuleAdmin();
                TaxClass taxClass = taxRuleAdmin.GetByTaxClassID(product.TaxClassID.Value);

                if(taxClass != null)
                    lblTaxClass.Text = taxClass.Name;
            }

            // Recurring Billing
            imgRecurringBillingInd.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(this.DisplayVisible(product.RecurringBillingInd));
            lblBillingPeriod.Text = product.RecurringBillingPeriod;
            lblFrequency.Text = product.RecurringBillingFrequency;
            lblTotalCycles.Text = product.RecurringBillingTotalCycles.GetValueOrDefault(0).ToString();

            shipSeparatelyInd.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(product.ShipSeparately);
            lblMastePageName.Text = product.MasterPage;

            //seo
            lblSEODescription.Text = product.SEODescription;
            lblSEOKeywords.Text = product.SEOKeywords;
            lblSEOTitle.Text = product.SEOTitle;
            lblSEOURL.Text = product.SEOURL;

            //checking whether the image is active or not
            //ZNode.Libraries.Admin.ProductViewAdmin pp = new ProductViewAdmin();

            //Inventory Setting - Out of Stock Options
            if (product.TrackInventoryInd.HasValue && product.AllowBackOrder.HasValue)
            {
                if ((product.TrackInventoryInd.Value) && (product.AllowBackOrder.Value == false))
                {
                    chkCartInventoryEnabled.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(bool.Parse("true"));
                    chkIsBackOrderEnabled.Src = SetCheckMarkImage();
                    chkIstrackInvEnabled.Src = SetCheckMarkImage();

                }
                else if (product.TrackInventoryInd.Value && product.AllowBackOrder.Value)
                {
                    chkCartInventoryEnabled.Src = SetCheckMarkImage();
                    chkIsBackOrderEnabled.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(bool.Parse("true"));
                    chkIstrackInvEnabled.Src = SetCheckMarkImage();
                }
                else if ((product.TrackInventoryInd.Value == false) && (product.AllowBackOrder.Value == false))
                {
                    chkCartInventoryEnabled.Src = SetCheckMarkImage();
                    chkIsBackOrderEnabled.Src = SetCheckMarkImage();
                    chkIstrackInvEnabled.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(bool.Parse("true"));
                }
            }
            else
            {
                chkCartInventoryEnabled.Src = SetCheckMarkImage();
                chkIsBackOrderEnabled.Src = SetCheckMarkImage();
                chkIstrackInvEnabled.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(bool.Parse("true"));
            }

            //Inventory Setting - Stock Messages
            lblInStockMsg.Text = product.InStockMsg;
            lblOutofStock.Text = product.OutOfStockMsg;
            lblBackOrderMsg.Text = product.BackOrderMsg;

            if (product.DropShipInd.HasValue)
            {
                IsDropShipEnabled.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(product.DropShipInd.Value);
            }
            else
            {
                IsDropShipEnabled.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(bool.Parse("false"));
            }
            //Binding product Category
            DataSet dsCategory = prodAdmin.Get_CategoryByProductID(ItemId);
            StringBuilder Builder = new StringBuilder();
            foreach (System.Data.DataRow dr in dsCategory.Tables[0].Rows)
            {
                Builder.Append(prodAdmin.GetCategorypath(dr["Name"].ToString(),dr["Parent1CategoryName"].ToString(), dr["Parent2CategoryName"].ToString()));
                Builder.Append("<br>");
            }

            if (product.FeaturedInd)
            {
                FeaturedProduct.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(true);
            }
            else
            {
                FeaturedProduct.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(false);
            }
            lblProductCategories.Text = Builder.ToString();

            //Bind ShippingRule type
            if(product.ShippingRuleTypeID.HasValue)
            lblShippingRuleTypeName.Text = GetShippingRuleTypeName(product.ShippingRuleTypeID.Value);
            if (product.FreeShippingInd.HasValue)
                freeShippingInd.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(product.FreeShippingInd.Value);
            else
                freeShippingInd.Src = ZNode.Libraries.Framework.Business.ZNodeHelper.GetCheckMark(false);

            //Bind Grid - Product Related Items
            this.BindRelatedItems();
            //this.BindImage();
            this.BindImageDatas();
            //Bind Grid - Product Addons
            BindProductAddons();
            //Bind Grid - Inventory
            BindSKU();
            //Tiered Pricing
            BindTieredPricing();
            //Digital Asset
            BindDigitalAssets();
            //Bind product highlights
            BindProductHighlights();
        }
        else
        {
            throw (new ApplicationException("Product Requested could not be found."));
        }
    }