示例#1
0
    /// <summary>
    /// Handles the SiteSelector's selection changed event.
    /// </summary>
    void Selector_SelectedIndexChanged(object sender, EventArgs e)
    {
        OptionCategoryGrid.WhereCondition = SelectSite.GetSiteWhereCondition("CategorySiteID");
        OptionCategoryGrid.ReloadData();

        // Save selected value
        StoreSiteFilterValue(SelectSite.SiteID);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // New option category action
        hdrActions.ActionsList.Add(new HeaderAction()
        {
            ControlType = HeaderActionTypeEnum.Hyperlink,
            Text        = GetString("OptionCategory_List.NewItemCaption"),
            RedirectUrl = ResolveUrl("OptionCategory_New.aspx?siteId=" + SelectSite.SiteID),
            ImageUrl    = GetImageUrl("Objects/Ecommerce_OptionCategory/add.png")
        });

        // Set site selector visibility
        CurrentMaster.DisplaySiteSelectorPanel = AllowGlobalObjects;

        OptionCategoryGrid.WhereCondition = SelectSite.GetSiteWhereCondition("CategorySiteID");

        AddMenuButtonSelectScript("ProductOptions", "");
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // New item link
        string[,] actions       = new string[1, 6];
        actions[0, 0]           = HeaderActions.TYPE_HYPERLINK;
        actions[0, 1]           = GetString("OptionCategory_List.NewItemCaption");
        actions[0, 2]           = null;
        actions[0, 3]           = ResolveUrl("OptionCategory_New.aspx?siteId=" + SelectSite.SiteID);
        actions[0, 4]           = null;
        actions[0, 5]           = GetImageUrl("Objects/Ecommerce_OptionCategory/add.png");
        this.hdrActions.Actions = actions;

        // Set master title
        this.CurrentMaster.Title.TitleText          = GetString("optioncategory_edit.itemlistlink");
        this.CurrentMaster.Title.TitleImage         = GetImageUrl("Objects/Ecommerce_OptionCategory/object.png");
        this.CurrentMaster.Title.HelpName           = "helpTopic";
        this.CurrentMaster.Title.HelpTopicName      = "list_categories";
        this.CurrentMaster.DisplaySiteSelectorPanel = AllowGlobalObjects;

        OptionCategoryGrid.WhereCondition = SelectSite.GetSiteWhereCondition("CategorySiteID");

        AddMenuButtonSelectScript("ProductOptions", "");
    }
示例#4
0
 /// <summary>
 /// Creates where condition for UniGrid.
 /// </summary>
 private void InitWhereCondition()
 {
     UniGrid.WhereCondition = SelectSite.GetSiteWhereCondition("ManufacturerSiteID");
 }
 /// <summary>
 /// Creates where condition for UniGrid and reloads it.
 /// </summary>
 private void InitWhereCondition()
 {
     UniGrid.WhereCondition = SelectSite.GetSiteWhereCondition("DepartmentSiteID");
 }
 /// <summary>
 /// Creates where condition for UniGrid and reloads it.
 /// </summary>
 private void InitWhereCondition()
 {
     UniGrid.WhereCondition = SelectSite.GetSiteWhereCondition("ShippingOptionSiteID");
 }
示例#7
0
    private string GetWhereCondition()
    {
        string where = "";

        // Display ONLY products - not product options
        where += " (SKUOptionCategoryID IS NULL) AND ";

        // Value from txtName
        if (txtName.Text.Trim() != "")
        {
            where += "SKUName LIKE '%" + txtName.Text.Trim().Replace("'", "''") + "%' AND ";
        }

        // Value from txtNumber
        if (isAdvancedMode && (txtNumber.Text != ""))
        {
            where += "SKUNumber LIKE '%" + txtNumber.Text.Trim().Replace("'", "''") + "%' AND ";
        }

        // Product type
        if ((string)this.selectProductTypeElem.Value != "ALL")
        {
            // If standard product is selected
            if ((string)this.selectProductTypeElem.Value == SKUInfoProvider.GetSKUProductTypeString(SKUProductTypeEnum.Product))
            {
                where += String.Format("ISNULL(SKUProductType, 'PRODUCT') = '{0}' AND ", this.selectProductTypeElem.Value);
            }
            else
            {
                where += String.Format("SKUProductType = '{0}' AND ", this.selectProductTypeElem.Value);
            }
        }

        // Value from departmentElem
        if (departmentElem.DepartmentID > 0)
        {
            where += "(SKUDepartmentID=" + departmentElem.DepartmentID + ") AND ";
        }
        else if (departmentElem.DepartmentID == -5)
        {
            where += "(SKUDepartmentID IS NULL) AND ";
        }


        // Internal status value
        if (isAdvancedMode && (internalStatusElem.InternalStatusID > 0))
        {
            where += "InternalStatusID = " + internalStatusElem.InternalStatusID + " AND ";
        }

        // Store status value
        if (isAdvancedMode && (publicStatusElem.PublicStatusID > 0))
        {
            where += "PublicStatusID = " + publicStatusElem.PublicStatusID + " AND ";
        }

        // Assigned to document
        switch (this.drpAssignedToDocument.SelectedValue)
        {
        case "0":
            where += "SKUID NOT IN (SELECT NodeSKUID FROM View_CMS_Tree_Joined WHERE NodeSKUID IS NOT NULL) AND ";
            break;

        case "1":
            where += "SKUID IN (SELECT NodeSKUID FROM View_CMS_Tree_Joined WHERE NodeSiteID = " + CMSContext.CurrentSiteID + " AND NodeSKUID IS NOT NULL) AND ";
            break;
        }

        CurrentUserInfo cui = CMSContext.CurrentUser;

        if (cui != null)
        {
            if (cui.IsGlobalAdministrator || cui.IsAuthorizedPerResource("CMS.Ecommerce", "AccessAllDepartments"))
            {
                // Display products from all departments to Global administrator
                if (where != "")
                {
                    // Trim ending ' AND'
                    where = where.Remove(where.Length - 4);
                }
            }
            else
            {
                // Complete where
                where += "((SKUDepartmentID IS NULL) OR SKUDepartmentID IN (SELECT DepartmentID FROM COM_UserDepartment WHERE UserID=" + CMSContext.CurrentUser.UserID + "))";
            }

            where = "(" + where + ") AND (" + SelectSite.GetSiteWhereCondition("SKUSiteID") + ")";

            return(where);
        }
        return(null);
    }
 /// <summary>
 /// Creates where condition for UniGrid.
 /// </summary>
 private void InitWhereCondition()
 {
     gridElem.WhereCondition = SelectSite.GetSiteWhereCondition("SupplierSiteID");
 }
示例#9
0
 /// <summary>
 /// Creates where condition for UniGrid.
 /// </summary>
 private void InitWhereCondition()
 {
     gridElem.WhereCondition = SelectSite.GetSiteWhereCondition("DiscountLevelSiteID");
 }
 /// <summary>
 /// Creates where condition for UniGrid and reloads it.
 /// </summary>
 private void InitWhereCondition()
 {
     UniGrid.WhereCondition = SelectSite.GetSiteWhereCondition("PaymentOptionSiteID");
 }