public int SaveItemAndAttributes(ItemsInfo.ItemSaveBasicInfo itemObj, AspxCommonInfo aspxCommonObj)
        {
            try
            {
                string uplodedDownlodableFormValue = string.Empty;

                if (itemObj.ItemTypeId == 2 && itemObj.DownloadItemsValue != "")
                {
                    FileHelperController downLoadableObj = new FileHelperController();
                    string tempFolder = @"Upload\temp";
                    uplodedDownlodableFormValue = downLoadableObj.MoveFileToDownlodableItemFolder(tempFolder,
                                                                                                  itemObj.DownloadItemsValue,
                                                                                                  @"Modules/AspxCommerce/AspxItemsManagement/DownloadableItems/",
                                                                                                  itemObj.ItemId, "item_");
                    itemObj.DownloadItemsValue = uplodedDownlodableFormValue;
                }


                int itemID = AspxItemMgntController.SaveUpdateItemAndAttributes(itemObj, aspxCommonObj);

                //kit produtct
                if (itemObj.ItemTypeId == 6)
                {

                    AspxKitController _kitCtl = new AspxKitController();
                    _kitCtl.SaveKits(itemObj.KitConfig, itemID, aspxCommonObj);
                }
                //return "({\"returnStatus\":1,\"Message\":'Item saved successfully.'})";
                int storeId = aspxCommonObj.StoreID;
                int portalId = aspxCommonObj.PortalID;
                string culture = aspxCommonObj.CultureName;
                // if (itemID > 0 && sourceFileCol != "" && dataCollection != "")
                if (itemID > 0 && itemObj.SourceFileCol != "" && itemObj.DataCollection != "")
                {
                    StoreSettingConfig ssc = new StoreSettingConfig();
                    int itemLargeThumbNailHeight = Convert.ToInt32(ssc.GetStoreSettingsByKey(StoreSetting.ItemLargeThumbnailImageHeight, storeId, portalId, culture));
                    int itemLargeThumbNailWidth = Convert.ToInt32(ssc.GetStoreSettingsByKey(StoreSetting.ItemLargeThumbnailImageWidth, storeId, portalId, culture));
                    int itemMediumThumbNailHeight = Convert.ToInt32(ssc.GetStoreSettingsByKey(StoreSetting.ItemMediumThumbnailImageHeight, storeId, portalId, culture));
                    int itemMediumThumbNailWidth = Convert.ToInt32(ssc.GetStoreSettingsByKey(StoreSetting.ItemMediumThumbnailImageWidth, storeId, portalId, culture));
                    int itemSmallThumbNailHeight = Convert.ToInt32(ssc.GetStoreSettingsByKey(StoreSetting.ItemSmallThumbnailImageHeight, storeId, portalId, culture));
                    int itemSmallThumbNailWidth = Convert.ToInt32(ssc.GetStoreSettingsByKey(StoreSetting.ItemSmallThumbnailImageWidth, storeId, portalId, culture));
                    var dataCollection = itemObj.DataCollection;
                    dataCollection = dataCollection.Replace("../", "");
                    SaveImageContents(itemID, @"Modules/AspxCommerce/AspxItemsManagement/uploads/", itemObj.SourceFileCol,
                                      dataCollection, itemLargeThumbNailHeight, itemLargeThumbNailWidth, itemMediumThumbNailHeight, itemMediumThumbNailWidth,
                                      itemSmallThumbNailHeight, itemSmallThumbNailWidth, "item_", aspxCommonObj.CultureName, aspxCommonObj.PortalID);
                }
                else if (itemID > 0 && itemObj.SourceFileCol == "" && itemObj.DataCollection == "")
                {
                    DeleteImageContents(itemID);
                }
                return itemID;
                //if (itemID == 0)
                //{
                //    //SaveImageContents(itemID, @"Modules/AspxCommerce/AspxItemsManagement/uploads/", sourceFileCol, dataCollection, "item_");
                //    //TODO:: DELTE UPLOADED FILE FROM DOWNLOAD FOLDER

                //}
            }
            catch (Exception ex)
            {
                throw ex;
                //ErrorHandler errHandler = new ErrorHandler();
                //if (errHandler.LogWCFException(ex))
                //{
                //    return "({\"returnStatus\":-1,\"errorMessage\":'" + ex.Message + "'})";
                //}
                //else
                //{
                //    return "({\"returnStatus\":-1,\"errorMessage\":'Error while saving item!'})";
                //}
            }
        }
        public int SaveKit(Kit kit, AspxCommonInfo commonInfo)
        {

            try
            {
                AspxKitController controller = new AspxKitController();
                return controller.SaveKit(kit, commonInfo);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
        public List<Kit> GetKits(AspxCommonInfo commonInfo)
        {
            try
            {
                AspxKitController controller = new AspxKitController();
                return controller.GetKits(commonInfo);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public void SaveItemKits(List<ItemKit> mappedKits, int itemID, AspxCommonInfo commonInfo)
        {
            try
            {
                AspxKitController controller = new AspxKitController();
                controller.SaveItemKits(mappedKits, itemID, commonInfo);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
        public List<ItemKit> GetItemKits(int itemID, AspxCommonInfo commonInfo)
        {

            try
            {
                AspxKitController controller = new AspxKitController();
                return controller.GetItemKits(itemID, commonInfo);
            }
            catch (Exception e)
            {
                throw e;
            }

        }
        public List<KitInfo> GetKitsGrid(int offset, int limit, string kitname, AspxCommonInfo commonInfo)
        {
            try
            {

                AspxKitController controller = new AspxKitController();
                return controller.LoadKits(offset, limit, kitname, commonInfo);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public void DeleteKitComponent(string kitComponentIds, AspxCommonInfo commonInfo)
        {
            try
            {
                AspxKitController controller = new AspxKitController();
                controller.DeleteKitComponent(kitComponentIds, commonInfo);


            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
        //---------------Get UserReferred Friends--------------------------
        //[WebMethod]
        //public List<ReferToFriendInfo> GetUserReferredFriends(int offset, int limit, AspxCommonInfo aspxCommonObj)
        //{
        //    try
        //    {
        //        List<ReferToFriendInfo> lstReferFriend = AspxReferFriendController.GetUserReferredFriends(offset, limit, aspxCommonObj);
        //        return lstReferFriend;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}
        #endregion

        #region Items Management


        public bool CheckKitComponentExist(string ComponentName, AspxCommonInfo aspxCommonObj)
        {
            try
            {
                AspxKitController controller = new AspxKitController();
                bool isUnique = controller.CheckKitComponentExist(ComponentName, aspxCommonObj);
                return isUnique;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }