Exemplo n.º 1
0
 public void DeleteImageContents(Int32 itemID)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         obj.DeleteItemImageByItemID(itemID);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
 public List<CategoryInfo> GetCategoryList(string prefix, bool isActive, string cultureName, Int32 storeID, Int32 portalID, string userName, int itemId)
 {
     ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
     List<CategoryInfo> catList = obj.GetCategoryList(prefix, isActive, cultureName, storeID, portalID, userName, itemId);
     return catList;
 }
Exemplo n.º 3
0
 public bool CheckUniqueItemSKUCode(string SKU, int itemId, int storeId, int portalId, string cultureName)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         return obj.CheckUniqueSKUCode(SKU, itemId, storeId, portalId, cultureName);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
 public List<AttributeFormInfo> GetItemFormAttributesValuesByItemID(int itemID, int attributeSetID, int itemTypeID, int storeID, int portalID, string userName, string culture)
 {
     ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
     List<AttributeFormInfo> frmItemAttributes = obj.GetItemAttributesValuesByItemID(itemID, attributeSetID, itemTypeID, storeID, portalID, userName, culture);
     return frmItemAttributes;
 }
Exemplo n.º 5
0
 public void UpdateItemIsActiveByItemID(int itemId, int storeId, int portalId, string userName, bool isActive)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         obj.UpdateItemIsActive(itemId, storeId, portalId, userName, isActive);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 6
0
 public List<TaxRulesInfo> GetAllTaxRules(int storeID, int portalID, bool isActive)
 {
     ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
     List<TaxRulesInfo> lstTaxManageRule = obj.GetAllTaxRules(storeID, portalID, isActive);
     return lstTaxManageRule;
 }
Exemplo n.º 7
0
 public List<AttributeFormInfo> GetItemFormAttributesByitemSKUOnly(string itemSKU, int storeID, int portalID, string userName, string culture)
 {
     ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
     List<AttributeFormInfo> frmItemFieldList = obj.GetItemFormAttributesByItemSKUOnly(itemSKU, storeID, portalID, userName, culture);
     return frmItemFieldList;
 }
Exemplo n.º 8
0
 public List<DownLoadableItemGetInfo> GetDownLoadableItemsList(int offset, int limit, string Sku, string name, int storeId, int portalId, string userName, string cultureName, System.Nullable<bool> CheckUser)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         return obj.GetDownLoadableItemsList(offset, limit, Sku, name, storeId, portalId, userName, cultureName, CheckUser);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 9
0
 public List<ItemsInfo> GetItemsList(int offset, int limit, string Sku, string name, string itemType, string attributesetName, string visibility, System.Nullable<bool> isActive, int storeId, int portalId, string userName, string cultureName)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         return obj.GetAllItems(offset, limit, Sku, name, itemType, attributesetName, visibility, isActive, storeId, portalId, userName, cultureName);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 10
0
 public List<LowStockItemsInfo> GetLowStockItemsList(int offset, int limit, string Sku, string name, System.Nullable<bool> isActive, int storeId, int portalId, string userName, string cultureName)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         return obj.GetAllLowStockItems(offset, limit, Sku, name, isActive, storeId, portalId, userName, cultureName);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 11
0
 public List<OrderItemsGroupByItemIDInfo> GetOrderedItemsList(int offset, int limit, string name, int storeId, int portalId, string userName, string cultureName)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         return obj.GetOrderedItemsList(offset, limit, name, storeId, portalId, userName, cultureName);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 12
0
 public List<AttributeFormInfo> GetItemDetailsByitemSKU(string itemSKU, int attributeSetID, int itemTypeID, int storeID, int portalID, string userName, string culture)
 {
     ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
     List<AttributeFormInfo> frmItemAttributes = obj.GetItemDetailsInfoByItemSKU(itemSKU, attributeSetID, itemTypeID, storeID, portalID, userName, culture);
     return frmItemAttributes;
 }
Exemplo n.º 13
0
 public ItemBasicDetailsInfo GetItemBasicInfoByitemSKU(string itemSKU, int storeID, int portalID, string userName, string culture)
 {
     ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
     ItemBasicDetailsInfo frmItemAttributes = obj.GetItemBasicInfo(itemSKU, storeID, portalID, userName, culture);
     return frmItemAttributes;
 }
Exemplo n.º 14
0
 public List<LatestItemsInfo> GetLatestItemsList(int storeId, int portalId, string userName, string cultureName, int count)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         return obj.GetLatestItemsByCount(storeId, portalId, userName, cultureName, count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 15
0
 public List<ItemsInfo> GetCrossSellItemsList(int offset, int limit, int storeId, int portalId, int selfItemId, string userName, string culture)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         return obj.GetCrossSellItemsByItemID(offset, limit, storeId, portalId, selfItemId, userName, culture);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 16
0
 public void DeleteItemByItemID(string itemId, int storeId, int portalId, string userName)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         obj.DeleteSingleItem(itemId, storeId, portalId, userName);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 17
0
 public List<CostVariantInfo> GetCostVariantsOptionsList(int itemId, int storeId, int portalId, string cultureName)
 {
     try
     {
         ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();
         return obj.GetAllCostVariantOptions(itemId, storeId, portalId, cultureName);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 18
0
        public int SaveUpdateItemAndAttributes(int itemID, int itemTypeID, int attributeSetID, int storeID, int portalID, string userName, string culture, int taxClassID, string categoriesIDs, string relatedItemsIDs, string upSellItemsIDs, string crossSellItemsIDs, string downloadItemsValue, ASPXNameValue[] formVars)
        {
            bool isModified = false;
            bool updateFlag = false;
            if (itemID > 0)
            {
                isModified = true;
                updateFlag = true;
            }
            int itemLargeThumbNailSize = Convert.ToInt32(StoreSetting.GetStoreSettingValueByKey(StoreSetting.ItemLargeThumbnailImageSize, storeID,
                                                                                                portalID, culture));
            int itemMediumThumbNailSize = Convert.ToInt32(StoreSetting.GetStoreSettingValueByKey(StoreSetting.ItemMediumThumbnailImageSize,
                                                                                                 storeID, portalID, culture));
            int itemSmallThumbNailSize = Convert.ToInt32(StoreSetting.GetStoreSettingValueByKey(StoreSetting.ItemSmallThumbnailImageSize, storeID,
                                                                                                portalID, culture));
            int _attributeID = 0;
            int _inputTypeID = 0;
            int _ValidationTypeID = 8;
            int _attributeSetGroupID = 0;
            bool _isIncludeInPriceRule = false;
            bool _isIncludeInPromotions = false;
            int _displayOrder = 0;

            string sku = "";
            string activeFrom = "";
            string activeTo = "";
            string hidePrice = "";
            string isHideInRSS = "";
            string isHideToAnonymous = "";

            bool toInsertIntoDB = true;
            bool isFormValid = true;
            string _imageVar = string.Empty;
            int _imageCounterFirst = 0;

            ItemsManagementSqlProvider obj = new ItemsManagementSqlProvider();

            for (int i = 0; i < formVars.Length; i++)
            {
                string attribValue = formVars[i].value;
                //string jsonResult = formVars[i].name.Replace('%', '_');
                string jsonResult = formVars[i].name.Replace('-', ' ');
                string[] jsonVar = jsonResult.Split('_');
                FormValidation formValidation = new FormValidation();

                if (jsonVar.Length > 1)
                {
                    _attributeID = Int32.Parse(jsonVar[0]);
                    _inputTypeID = Int32.Parse(jsonVar[1]);
                    _ValidationTypeID = Int32.Parse(jsonVar[2]);
                    _attributeSetGroupID = Int32.Parse(jsonVar[4]);
                    _isIncludeInPriceRule = bool.Parse(jsonVar[5]);
                    _isIncludeInPromotions = bool.Parse(jsonVar[6]);
                    _displayOrder = Int32.Parse(jsonVar[7]);

                    //Save To Database 1. [aspx_Items] 2. Others 
                    if (_attributeID == 4)
                    {
                        sku = formVars[i].value;
                    }
                    else if (_attributeID == 22)
                    {
                        activeFrom = formVars[i].value;
                    }
                    else if (_attributeID == 23)
                    {
                        activeTo = formVars[i].value;
                    }
                    else if (_attributeID == 26)
                    {
                        hidePrice = formVars[i].value;
                    }
                    else if (_attributeID == 27)
                    {
                        isHideInRSS = formVars[i].value;
                    }
                    else if (_attributeID == 28)
                    {
                        isHideToAnonymous = formVars[i].value;
                    }


                    if (itemID == 0 && updateFlag == false)
                    {
                        itemID = obj.AddItem(itemID, itemTypeID, attributeSetID, taxClassID, storeID, portalID, userName, culture, true, isModified,
                            sku, activeFrom, activeTo, hidePrice, isHideInRSS, isHideToAnonymous, categoriesIDs, relatedItemsIDs, upSellItemsIDs, crossSellItemsIDs, downloadItemsValue, updateFlag);
                    }
                    else if (itemID > 0 && i == formVars.Length - 1)
                    {
                        itemID = obj.AddItem(itemID, itemTypeID, attributeSetID, taxClassID, storeID, portalID, userName, culture, true, isModified,
                            sku, activeFrom, activeTo, hidePrice, isHideInRSS, isHideToAnonymous, categoriesIDs, relatedItemsIDs, upSellItemsIDs, crossSellItemsIDs, downloadItemsValue, updateFlag);
                    }

                    if (itemID > 0)
                    {
                        if (_inputTypeID == 1)
                        {
                            if (_ValidationTypeID == 3)
                            {
                                if (formValidation.ValidateValue(formVars[i].name, _ValidationTypeID, formVars[i].value))
                                {
                                    attribValue = formVars[i].value;
                                }
                                else
                                {
                                    isFormValid = false;
                                    break;
                                }
                            }
                            else if (_ValidationTypeID == 5)
                            {
                                if (formValidation.ValidateValue(formVars[i].name, _ValidationTypeID, formVars[i].value))
                                {
                                    attribValue = formVars[i].value;
                                }
                                else
                                {
                                    isFormValid = false;
                                    break;
                                }
                            }
                            else
                            {
                                if (formValidation.ValidateValue(formVars[i].name, _ValidationTypeID, formVars[i].value))
                                {
                                    attribValue = formVars[i].value;
                                }
                                else
                                {
                                    isFormValid = false;
                                    break;
                                }
                            }
                        }
                        else if (_inputTypeID == 2)
                        {
                            if (formValidation.ValidateValue(formVars[i].name, _ValidationTypeID, formVars[i].value))
                            {
                                attribValue = formVars[i].value;
                            }
                            else
                            {
                                isFormValid = false;
                                break;
                            }
                        }
                        else if (_inputTypeID == 3)
                        {
                            if (formValidation.ValidateValue(formVars[i].name, _ValidationTypeID, formVars[i].value))
                            {
                                if (!string.IsNullOrEmpty(formVars[i].value))
                                {
                                    attribValue = formVars[i].value;
                                }
                            }
                            else
                            {
                                isFormValid = false;
                                break;
                            }
                        }
                        else if (_inputTypeID == 4)
                        {
                            if (formValidation.ValidateValue(formVars[i].name, _ValidationTypeID, formVars[i].value))
                            {
                                if (!string.IsNullOrEmpty(formVars[i].value))
                                {
                                    attribValue = formVars[i].value;
                                }
                            }
                            else
                            {
                                isFormValid = false;
                                break;
                            }
                        }
                        else if (_inputTypeID == 5 || _inputTypeID == 6 || _inputTypeID == 9 || _inputTypeID == 10 ||
                                 _inputTypeID == 11 || _inputTypeID == 12)
                        {
                            if (formValidation.ValidateValue(formVars[i].name, _ValidationTypeID, formVars[i].value))
                            {
                                attribValue = formVars[i].value;
                            }
                            else
                            {
                                isFormValid = false;
                                break;
                            }
                        }
                        else if (_inputTypeID == 7)
                        {
                            if (formValidation.ValidateValue(formVars[i].name, _ValidationTypeID, formVars[i].value))
                            {
                                attribValue = formVars[i].value;
                            }
                            else
                            {
                                isFormValid = false;
                                break;
                            }
                        }

                        else if (_inputTypeID == 8)
                        {
                            if (_imageCounterFirst % 2 == 0)
                            {
                                toInsertIntoDB = false;
                                if (!string.IsNullOrEmpty(formVars[i].value) && formVars[i].value.ToLower() != "undefined")
                                {
                                    if (formValidation.ValidateValue(formVars[i].name, _ValidationTypeID, formVars[i].value))
                                    {
                                        _imageVar = attribValue;
                                    }
                                    else
                                    {
                                        isFormValid = false;
                                        break;
                                    }
                                }
                                else
                                {
                                    _imageVar = "";
                                }
                            }
                            else
                            {
                                toInsertIntoDB = true;

                                if (attribValue != _imageVar)
                                {
                                    //_imageVar = _imageVar.Replace("../", "");
                                    _imageVar = _imageVar.Replace("/", "\\");
                                    //attribValue = attribValue.Replace("../", "");
                                    attribValue = attribValue.Replace("/", "\\");

                                    string tempFolder = @"Upload\temp";
                                    FileHelperController fileObj = new FileHelperController();
                                    attribValue = fileObj.MoveFileToModuleFolder(tempFolder, attribValue, _imageVar, itemLargeThumbNailSize, itemMediumThumbNailSize,  itemSmallThumbNailSize, @"Modules\ASPXCommerce\ASPXItemsManagement\uploads\", itemID, "item_");
                                }
                            }
                            _imageCounterFirst++;
                        }
                    }
                    if (isFormValid && toInsertIntoDB)
                    {
                        obj.SaveUpdateItemAttributes(itemID, attributeSetID, storeID, portalID, userName, culture, true, isModified, attribValue,
                            _attributeID, _inputTypeID, _ValidationTypeID, _attributeSetGroupID, _isIncludeInPriceRule, _isIncludeInPromotions,
                            _displayOrder);
                    }
                }
            }
            return itemID;
        }