Ejemplo n.º 1
0
 private void GetSavedReplays()
 {
     foreach (var i in Directory.GetFiles(FoldersHelper.GetReplayPath()).Select(path => Path.GetFileName(path)).ToArray())
     {
         _replaysList.Items.Add(i);
     }
 }
Ejemplo n.º 2
0
        protected string RenderPictureTag(string urlPhoto, string additionalUrlPhoto, string urlPath, string photoDesc, string productName, int photoId, int productId)
        {
            string strFormat = string.Empty;

            string alt = photoDesc.IsNotEmpty() ? photoDesc : productName + " - " + Resource.ClientPage_AltText + " " + photoId;

            switch (ViewMode)
            {
            case SettingsCatalog.ProductViewMode.Tiles:
                strFormat = string.Format("<a class=\"pv-lnk-photo\" href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" class=\"scp-img p-photo {4}\" {3} /></a>", urlPath,
                                          FoldersHelper.GetImageProductPath(ProductImageType.Small, additionalUrlPhoto.IsNotEmpty() ? additionalUrlPhoto : urlPhoto, false),
                                          HttpUtility.HtmlEncode(alt),
                                          InplaceEditor.Image.AttributesProduct(photoId == 0 ? productId : photoId, productId, ProductImageType.Small, true, !urlPhoto.IsNullOrEmpty(), !urlPhoto.IsNullOrEmpty()),
                                          InplaceEditor.CanUseInplace(RoleActionKey.DisplayCatalog) ? "js-inplace-image-visible-permanent" : "");
                break;

            case SettingsCatalog.ProductViewMode.List:
                strFormat = string.Format("<a class=\"pv-lnk-photo\" href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" class=\"scp-img p-photo {4}\" {3}/></a>", urlPath,
                                          FoldersHelper.GetImageProductPath(ProductImageType.Small, additionalUrlPhoto.IsNotEmpty() ? additionalUrlPhoto : urlPhoto, false),
                                          HttpUtility.HtmlEncode(alt),
                                          InplaceEditor.Image.AttributesProduct(photoId == 0 ? productId : photoId, productId, ProductImageType.Small, true, !urlPhoto.IsNullOrEmpty(), !urlPhoto.IsNullOrEmpty()),
                                          InplaceEditor.CanUseInplace(RoleActionKey.DisplayCatalog) ? "js-inplace-image-visible-permanent" : "");
                break;

            case SettingsCatalog.ProductViewMode.Table:
                if (urlPhoto.IsNotEmpty())
                {
                    strFormat = string.Format("abbr=\"{0}\"",
                                              FoldersHelper.GetImageProductPath(ProductImageType.Small, additionalUrlPhoto.IsNotEmpty() ? additionalUrlPhoto : urlPhoto, false));
                }
                break;
            }
            return(strFormat);
        }
Ejemplo n.º 3
0
    protected void Resize()
    {
        try
        {
            var photos = PhotoService.GetNamePhotos(0, PhotoType.Product);
            foreach (var photo in photos)
            {
                var path = FoldersHelper.GetImageProductPathAbsolut(ProductImageType.Original, photo);
                if (File.Exists(path))
                {
                    using (var image = ImageFromFile(path))
                    {
                        FileHelpers.SaveProductImageUseCompress(path, image, true);
                    }
                }

                ResizePhotoStatistic.Index++;
            }

            ResizePhotoStatistic.IsRun = false;
            ResizePhotoStatistic.ThreadImport.Abort();
        }
        catch (Exception e)
        {
            Debug.LogError(e);
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            form.Action = Request.RawUrl;

            vk.Visible = !SettingsGeneral.AbsoluteUrl.Contains("localhost");

            Logo.ImgSource = FoldersHelper.GetPath(FolderType.Pictures, SettingsMain.LogoImageName, false);

            if (SettingsDesign.MainPageMode == SettingsDesign.eMainPageMode.Default)
            {
                menuTop.Visible         = true;
                searchBig.Visible       = false;
                menuCatalog.Visible     = true;
                menuTopMainPage.Visible = false;
            }
            else
            {
                menuTop.Visible         = false;
                searchBig.Visible       = (SettingsDesign.SearchBlockLocation == SettingsDesign.eSearchBlockLocation.TopMenu);
                menuCatalog.Visible     = false;
                menuTopMainPage.Visible = true;

                liViewCss.Text = "<link rel=\"stylesheet\" href=\"social/css/views/twocolumns.css\" >";
            }
        }
Ejemplo n.º 5
0
 protected string RenderPictureTag(string urlPhoto, string productName, string urlPath)
 {
     return(string.Format("<a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" /></a>", urlPath,
                          urlPhoto.IsNotEmpty()
                                   ? FoldersHelper.GetImageProductPath(ProductImageType.Small, urlPhoto, false)
                                   : "images/nophoto_small.jpg", productName));
 }
Ejemplo n.º 6
0
 public LogoImage()
 {
     ImgSource  = FoldersHelper.GetPath(FolderType.Pictures, SettingsMain.LogoImageName, false);
     EnableHref = true;
     Visible    = true;
     ImgAlt     = HttpUtility.HtmlEncode(SettingsMain.LogoImageAlt);
 }
Ejemplo n.º 7
0
    protected void grid_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            try
            {
                var commentId    = Convert.ToInt32(((HiddenField)e.Row.FindControl("hfID")).Value);
                var reviewEntity = ReviewService.GetReviewEntity(commentId);
                var entity       = ReviewService.GetReviewEntity(commentId);
                var url          = ReviewService.GetEntityUrl(reviewEntity.ReviewEntityId, reviewEntity.Type);

                var ibPhoto = ((HyperLink)e.Row.FindControl("ibPhoto"));
                if (!string.IsNullOrEmpty(entity.Photo))
                {
                    ibPhoto.ImageUrl    = FoldersHelper.GetImageProductPath(ProductImageType.XSmall, reviewEntity.Photo, false);
                    ibPhoto.Text        = entity.PhotoDescription;
                    ibPhoto.ToolTip     = entity.PhotoDescription;
                    ibPhoto.NavigateUrl = url;
                    ibPhoto.Attributes.Add("abbr", entity.Photo);
                }
                else
                {
                    ibPhoto.Visible = false;
                }
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
                MsgErr("Unable to load product photo");
            }
        }
    }
Ejemplo n.º 8
0
        protected void Resize()
        {
            foreach (var photo in PhotoService.GetNamePhotos(0, PhotoType.Product, true))
            {
                try
                {
                    var originalPath = FoldersHelper.GetImageProductPathAbsolut(ProductImageType.Original, photo);
                    if (!File.Exists(originalPath))
                    {
                        var bigPath = FoldersHelper.GetImageProductPathAbsolut(ProductImageType.Big, photo);
                        if (File.Exists(bigPath))
                        {
                            File.Copy(bigPath, originalPath);
                        }
                    }

                    if (File.Exists(originalPath))
                    {
                        using (var image = ImageFromFile(originalPath))
                        {
                            FileHelpers.SaveProductImageUseCompress(photo, image, true);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Debug.LogError(ex);
                    CommonStatistic.TotalErrorRow++;
                }
                CommonStatistic.RowPosition++;
            }

            CommonStatistic.IsRun = false;
        }
Ejemplo n.º 9
0
    protected string RenderPictureTag(string urlPhoto, string productName, string urlPath)
    {
        string strFormat = string.Empty;

        switch (ViewMode)
        {
        case ProductViewMode.Tiles:
            strFormat = string.Format("<a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" /></a>", urlPath,
                                      FoldersHelper.GetImageProductPath(ProductImageType.Small, urlPhoto, false), productName);
            break;

        case ProductViewMode.List:
            strFormat = string.Format("<a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" /></a>", urlPath,
                                      FoldersHelper.GetImageProductPath(ProductImageType.Small, urlPhoto, false), productName);
            break;

        case ProductViewMode.Table:
            if (urlPhoto.IsNotEmpty())
            {
                strFormat = string.Format("abbr=\"{0}\"",
                                          FoldersHelper.GetImageProductPath(ProductImageType.Small, urlPhoto, false));
            }
            break;
        }
        return(strFormat);
    }
    private PropertyLinkPhoto UpdateValue(PropertyLinkPhoto valueToHtml)
    {
        Product temp;
        string  outputValue = valueToHtml.PropertyName;

        if (outputValue.Contains("(") && outputValue.Contains(")"))
        {
            outputValue = outputValue.Remove(0, outputValue.IndexOf("(") + 1);
            outputValue = outputValue.Remove(outputValue.IndexOf(")"));
            outputValue = outputValue.Replace(" ", "");
            //ArtNo Bosch
            if (outputValue.Length == 10)
            {
                temp = ProductService.GetProduct(outputValue);
                if (temp != null && temp.UrlPath != string.Empty)
                {
                    outputValue = @"<a href=" + UrlService.GetLink(ParamType.Product, temp.UrlPath, temp.ID) + " class=''link-pv-name'' target='_blank'>" + temp.Name + " [" + temp.ArtNo + "] </a>";
                    valueToHtml.PropertyLink = outputValue;
                    //valueToHtml.PhotoLink = temp.Photo;
                    valueToHtml.PhotoLink = FoldersHelper.GetImageProductPath(ProductImageType.Small, temp.Photo, false);
                }
            }
        }
        return(valueToHtml);
    }
Ejemplo n.º 11
0
        protected void btnExport_Click(object sender, EventArgs e)
        {
            var fileName      = "redirects.csv".FileNamePlusDate();
            var fileDirectory = FoldersHelper.GetPathAbsolut(FolderType.PriceTemp);

            if (!Directory.Exists(fileDirectory))
            {
                Directory.CreateDirectory(fileDirectory);
            }

            using (var csvWriter = new CsvHelper.CsvWriter(new StreamWriter(fileDirectory + fileName), new CsvConfiguration()
            {
                Delimiter = ";", SkipEmptyRecords = false
            }))
            {
                foreach (var item in new[] { "RedirectFrom", "RedirectTo", "ProductArtNo" })
                {
                    csvWriter.WriteField(item);
                }
                csvWriter.NextRecord();

                foreach (var redirect in RedirectSeoService.GetRedirectsSeo())
                {
                    csvWriter.WriteField(redirect.RedirectFrom);
                    csvWriter.WriteField(redirect.RedirectTo);
                    csvWriter.WriteField(redirect.ProductArtNo);

                    csvWriter.NextRecord();
                }
            }
            Response.Clear();
            CommonHelper.WriteResponseFile(fileDirectory + fileName, fileName);
            Response.End();
        }
Ejemplo n.º 12
0
        public async Task <OperationDataResult <List <FolderDtoModel> > > Index()
        {
            try
            {
                var core = await _coreHelper.GetCore();

                await using var dbContext = core.DbContextHelper.GetDbContext();
                var language = await _userService.GetCurrentUserLanguage();

                var folderQuery = dbContext.Folders
                                  .Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
                                  .Where(x => x.FolderTranslations.Any(y =>
                                                                       y.LanguageId == language.Id && !string.IsNullOrEmpty(y.Name)));
                var folders = await AddSelectToQueryForList(folderQuery, language.Id)
                              .OrderBy(x => x.Name)
                              .ToListAsync();

                var treeResult = new List <FolderDtoModel>();

                if (folders.Count > 0)
                {
                    treeResult = FoldersHelper.BuildTreeV2(folders);
                    //treeResult = folders.BuildTree().ToList();
                }
                return(new OperationDataResult <List <FolderDtoModel> >(true, treeResult));
            }
            catch (Exception e)
            {
                _logger.LogError(e, e.Message);
                return(new OperationDataResult <List <FolderDtoModel> >(
                           false,
                           _localizationService.GetString("ErrorWhileObtainingFoldersInfo")));
            }
        }
Ejemplo n.º 13
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            if (!fuIcon.HasFile)
            {
                return;
            }
            if (!FileHelpers.CheckFileExtension(fuIcon.FileName, FileHelpers.eAdvantShopFileTypes.Image))
            {
                OnErr(new ErrorEventArgs {
                    Message = Resource.Admin_ErrorMessage_WrongImageExtension
                });
                return;
            }
            PhotoService.DeletePhotos(PaymentMethodID, PhotoType.Payment);
            var tempName = PhotoService.AddPhoto(new Photo(0, PaymentMethodID, PhotoType.Payment)
            {
                OriginName = fuIcon.FileName
            });

            if (string.IsNullOrWhiteSpace(tempName))
            {
                return;
            }
            using (System.Drawing.Image image = System.Drawing.Image.FromStream(fuIcon.FileContent))
            {
                FileHelpers.SaveResizePhotoFile(FoldersHelper.GetPathAbsolut(FolderType.PaymentLogo, tempName), SettingsPictureSize.PaymentIconWidth, SettingsPictureSize.PaymentIconHeight, image);
            }
            imgIcon.ImageUrl = FoldersHelper.GetPath(FolderType.PaymentLogo, tempName, true);
            imgIcon.Visible  = true;
        }
Ejemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SetMeta(new MetaInfo(string.Format("{0} - {1}", SettingsMain.ShopName, Resource.Client_CompareProducts_Header)), string.Empty);
        Logo.ImgSource = FoldersHelper.GetPath(FolderType.Pictures, SettingsMain.LogoImageName, false);

        var compareProducts = ShoppingCartService.CurrentCompare;

        if ((compareProducts == null) || (compareProducts.Count == 0))
        {
            Response.Redirect("default.aspx");
            return;
        }

        var propertyNames = new List <string>();

        foreach (var item in compareProducts)
        {
            propertyNames.AddRange(PropertyService.GetPropertyValuesByProductId(item.EntityId).Select(p => p.Property.Name));
        }

        PropertyNames = new List <string>();
        PropertyNames.AddRange(propertyNames.Distinct());

        ProductItems = new List <ProductItem>();
        foreach (ShoppingCartItem item in compareProducts)
        {
            Product product = ProductService.GetProduct(item.EntityId);
            if (product == null)
            {
                continue;
            }
            ProductItems.Add(new ProductItem(product, PropertyNames));
        }
    }
Ejemplo n.º 15
0
        public new void LoadData()
        {
            txtPlan.Text           = String.Format("{0:## ##0.00}", OrderStatisticsService.SalesPlan);
            txtPlaPribl.Text       = String.Format("{0:## ##0.00}", OrderStatisticsService.ProfitPlan);
            txtCompanyName.Text    = SettingsBank.CompanyName;
            txtCompanyAddress.Text = SettingsBank.Address;
            txtInn.Text            = SettingsBank.INN;
            txtKPP.Text            = SettingsBank.KPP;
            txtRachetniChet.Text   = SettingsBank.RS;
            txtBankName.Text       = SettingsBank.BankName;
            txtKorrecpChet.Text    = SettingsBank.KS;
            txtBik.Text            = SettingsBank.BIK;

            chbCheakProductCount.Checked = SettingsOrderConfirmation.AmountLimitation;
            txtMinOrderPrice.Text        = String.Format("{0:## ##0.00}", SettingsOrderConfirmation.MinimalOrderPrice);
            txtMinPriceGift.Text         = String.Format("{0:## ##0.00}", SettingsOrderConfirmation.MinimalPriceCertificate);
            txtMaxPriceGift.Text         = String.Format("{0:## ##0.00}", SettingsOrderConfirmation.MaximalPriceCertificate);

            if (!string.IsNullOrWhiteSpace(SettingsBank.StampImageName))
            {
                imgPechat.ImageUrl = FoldersHelper.GetPath(FolderType.Pictures, SettingsBank.StampImageName, true);
            }
            else
            {
                imgPechat.Visible = false;
            }
        }
Ejemplo n.º 16
0
    public string RenderHtml()
    {
        if (string.IsNullOrEmpty(ImgSource))
        {
            ImgSource = FoldersHelper.GetPath(FolderType.Pictures, SettingsMain.FaviconImageName, ForAdmin);
        }

        string resStrHtml = string.Empty;

        if (!string.IsNullOrEmpty(ImgSource))
        {
            const string imgTag  = "<img id=\"favicon\" src=\"{0}\" {1} />";
            const string linkTag = "<link rel=\"{0}\" href=\"{1}\"{2} />";

            //Source
            string source = !string.IsNullOrEmpty(ImgSource) ? ImgSource : string.Empty;

            // styleClass
            string styleClass = !string.IsNullOrEmpty(CssClassImage) ? string.Format("class=\"{0}\"", CssClassImage) : string.Empty;

            //Source
            string rel = Request.Browser.Browser == "IE" ? "SHORTCUT ICON" : "shortcut icon";
            // string type = string.Format("type=\"image/{0}\"", GetType(source));

            resStrHtml = GetOnlyImage ? string.Format(imgTag, source, styleClass) : string.Format(linkTag, rel, source, string.Empty);// type);
        }

        return(resStrHtml);
    }
Ejemplo n.º 17
0
        public static string GetPaymentIcon(PaymentType type, string iconName, string name)
        {
            string folderPath = FoldersHelper.GetPath(FolderType.PaymentLogo, string.Empty, false);

            if (!string.IsNullOrWhiteSpace(iconName) && File.Exists(FoldersHelper.GetPathAbsolut(FolderType.PaymentLogo, iconName)))
            {
                return(FoldersHelper.GetPath(FolderType.PaymentLogo, iconName, false));
            }

            if (name.Contains(Resources.Resource.Install_UserContols_PaymentView_CreditCard))
            {
                return(folderPath + "plasticcard.gif");
            }
            if (name.Contains(Resources.Resource.Install_UserContols_PaymentView_ElectronMoney))
            {
                return(folderPath + "emoney.gif");
            }
            if (name.Contains(Resources.Resource.Install_UserContols_PaymentView_Qiwi))
            {
                return(folderPath + "qiwi.gif");
            }
            if (name.Contains(Resources.Resource.Install_UserContols_PaymentView_Euroset))
            {
                return(folderPath + "euroset.gif");
            }
            return(string.Format("{0}{1}_default.gif", folderPath, (int)type));
        }
Ejemplo n.º 18
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (File.Exists(_strFullPath))
        {
            var          f     = new FileInfo(_strFullPath);
            const double size  = 0;
            double       sizeM = (Double)f.Length / 1048576;//1024 * 1024

            string sizeMesage;
            if ((int)sizeM > 0)
            {
                sizeMesage = ((int)sizeM) + " MB";
            }
            else
            {
                double sizeK = (Double)f.Length / 1024;
                if ((int)sizeK > 0)
                {
                    sizeMesage = ((int)sizeK) + " KB";
                }
                else
                {
                    sizeMesage = ((int)size) + " B";
                }
            }

            Link = "<a href='../" + FoldersHelper.GetPath(FolderType.PriceTemp, StrFileName, false) + "' >" + Resource.Admin_ExportOrdersExcel_DownloadFile +
                   "</a><span> " + Resource.Admin_ExportOrdersExcel_FileSize + ": " + sizeMesage + "</span>";
            Link += "<span>" + ", " + AdvantShop.Localization.Culture.ConvertDate(File.GetLastWriteTime(_strFullPath)) + "</span>";
        }
        else
        {
            Link = "<span>" + Resource.Admin_ExportOrdersExcel_NotExistDownloadFile + "</span>";
        }
    }
Ejemplo n.º 19
0
    private int CreateMenuItem()
    {
        ValidateData();

        var mItem = new AdvMenuItem
        {
            MenuItemName     = txtName.Text,
            MenuItemParentID = string.IsNullOrEmpty(hParent.Value) ? 0 : Convert.ToInt32(hParent.Value),
            MenuItemUrlPath  = txtUrl.Text,
            Enabled          = ckbEnabled.Checked,
            Blank            = ckbBlank.Checked,
            SortOrder        = Convert.ToInt32(txtSortOrder.Text),
            MenuItemUrlType  = (EMenuItemUrlType)Convert.ToInt32(rblLinkType.SelectedValue),
            ShowMode         = (EMenuItemShowMode)Convert.ToInt32(ddlShowMode.SelectedValue)
        };

        if (_type == MenuService.EMenuType.Top)
        {
            CacheManager.RemoveByPattern(CacheNames.GetMainMenuCacheObjectName());
            CacheManager.RemoveByPattern(CacheNames.GetMainMenuAuthCacheObjectName());
        }
        else if (_type == MenuService.EMenuType.Bottom)
        {
            var cacheName = CacheNames.GetBottomMenuCacheObjectName();
            if (CacheManager.Contains(cacheName))
            {
                CacheManager.Remove(cacheName);
            }

            var cacheAuthName = CacheNames.GetBottomMenuAuthCacheObjectName();
            if (CacheManager.Contains(cacheAuthName))
            {
                CacheManager.Remove(cacheAuthName);
            }
        }
        mItem.MenuItemID = MenuService.AddMenuItem(mItem, _type);
        _menuItemId      = mItem.MenuItemID;
        if (IconFileUpload.HasFile)
        {
            using (IconFileUpload.FileContent)
            {
                var tempName = PhotoService.AddPhoto(new Photo(0, _menuItemId, PhotoType.MenuIcon)
                {
                    OriginName = IconFileUpload.FileName
                });
                if (!string.IsNullOrWhiteSpace(tempName))
                {
                    IconFileUpload.SaveAs(FoldersHelper.GetPathAbsolut(FolderType.MenuIcons, tempName));
                }
            }
        }
        else
        {
            mItem.MenuItemIcon = string.Empty;
        }

        MenuService.UpdateMenuItem(mItem, _type);

        return(mItem.MenuItemID);
    }
Ejemplo n.º 20
0
    protected void rptReviews_ItemDataBind(object sender, RepeaterItemEventArgs e)
    {
        if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
        {
            try
            {
                var commentId    = Convert.ToInt32(((DataRowView)e.Item.DataItem)["ReviewId"]);
                var reviewEntity = ReviewService.GetReviewEntity(commentId);
                var url          = ReviewService.GetEntityUrl(reviewEntity.ReviewEntityId, reviewEntity.Type);

                var ibPhoto          = ((HyperLink)e.Item.FindControl("ibPhoto"));
                var requestHyperLink = ((HyperLink)e.Item.FindControl("requestHyperLink"));

                if (!string.IsNullOrEmpty(reviewEntity.Photo))
                {
                    ibPhoto.ImageUrl    = FoldersHelper.GetImageProductPath(ProductImageType.Small, reviewEntity.Photo, false);
                    ibPhoto.Text        = reviewEntity.PhotoDescription;
                    ibPhoto.NavigateUrl = url;
                    ibPhoto.Attributes.Add("abbr", FoldersHelper.GetImageProductPath(ProductImageType.Middle, reviewEntity.Photo, false));
                }
                else
                {
                    ibPhoto.Visible = false;
                }

                requestHyperLink.NavigateUrl = url;
                requestHyperLink.Text        = reviewEntity.Name;
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
                MsgErr("Unable to load product photo");
            }
        }
    }
Ejemplo n.º 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        form.Action = Request.RawUrl;
        string type = Request["type"];

        if (type.IsNullOrEmpty())
        {
            type = CommonHelper.GetCookieString("socialtype");
        }

        if (type.IsNotEmpty())
        {
            CommonHelper.SetCookie("socialtype", type);
            lsocialCss.Text = string.Format("<link type=\"text/css\" rel=\"stylesheet\" href=\"social/css/{0}.css\" />", type);
        }

        vk.Visible = type == "vk" && !SettingsGeneral.AbsoluteUrl.Contains("localhost");

        if (SaasDataService.IsSaasEnabled && !SaasDataService.CurrentSaasData.IsWorkingNow)
        {
            Response.Redirect(UrlService.GetAbsoluteLink("/app_offline.html"));
        }

        Logo.ImgSource = FoldersHelper.GetPath(FolderType.Pictures, SettingsMain.LogoImageName, false);
    }
        public void Execute(IJobExecutionContext context)
        {
            try
            {
                ProcessCsv();//Used for update price and amount for all products
                FieldMapping.Clear();

                string _filePath = FoldersHelper.GetPathAbsolut(FolderType.PriceTemp);
                string _fullPath = string.Format("{0}{1}", _filePath, "OstatkiWseCeny.csv");

                LogInvalidData("Start working on Update (Opt). File " + _fullPath + DateTime.Now.ToString());

                if (!File.Exists(_fullPath))
                {
                    return;
                }
                else
                {
                    GC.Collect();
                    ProcessOptPrices(_fullPath);
                    //Generate file for sending to Autospace
                    string autospace_filePath = FoldersHelper.GetPathAbsolut(FolderType.PriceTemp);
                    string autospace_fullPath = string.Format("{0}{1}{2}", autospace_filePath, "OptPrice_InstrumentOpt", ".csv");
                    //Removed by Evgeni. Now price is generetaed by 1C
                    //CsvExport.SaveProductsToCsvAutospace(autospace_fullPath, Encodings.EncodingsEnum.Utf8, Separators.SeparatorsEnum.SemicolonSeparated);
                    LogInvalidData("End working on Update (Opt). File " + _fullPath + DateTime.Now.ToString());
                    //Send file
                    SendMail.SendMailNow("[email protected];[email protected]", "Autospace Instrument-opt.by", "", false, autospace_fullPath);
                }
            }
            catch (Exception ex)
            {
                LogInvalidData("Exception occured at ublic void Execute(IJobExecutionContext context).Message: " + ex.Message + ". DAteTime: " + DateTime.Now.ToString());
            }
        }
Ejemplo n.º 23
0
    public bool SaveData()
    {
        SettingsBank.INN         = txtINN.Text;
        SettingsBank.RS          = txtRS.Text;
        SettingsBank.Director    = txtDirector.Text;
        SettingsBank.Manager     = txtManager.Text;
        SettingsBank.Accountant  = txtHeadCounter.Text;
        SettingsBank.BIK         = txtBIK.Text;
        SettingsBank.BankName    = txtBankName.Text;
        SettingsBank.KPP         = txtKPP.Text;
        SettingsBank.KS          = txtKS.Text;
        SettingsBank.CompanyName = txtCompanyName.Text;
        SettingsBank.Address     = txtAddress.Text;

        if (fuStamp.HasFile)
        {
            FileHelpers.CreateDirectory(FoldersHelper.GetPathAbsolut(FolderType.ImageTemp));
            FileHelpers.DeleteFile(FoldersHelper.GetPathAbsolut(FolderType.Pictures, SettingsBank.StampImageName));
            SettingsBank.StampImageName = fuStamp.FileName;
            fuStamp.SaveAs(FoldersHelper.GetPathAbsolut(FolderType.Pictures, fuStamp.FileName));
        }

        LoadData();
        return(true);
    }
Ejemplo n.º 24
0
 protected string RenderPictureTag(int productId, string strPhoto, string urlpath, string photoDesc)
 {
     return(string.Format("<a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" title=\"{2}\" class=\"pv-photo\" /></a>",
                          UrlService.GetLink(ParamType.Product, urlpath, productId), strPhoto.IsNotEmpty()
             ? FoldersHelper.GetImageProductPath(ProductImageType.Small, strPhoto, false)
             : "images/nophoto_small.jpg",
                          HttpUtility.HtmlEncode(photoDesc)));
 }
Ejemplo n.º 25
0
 protected string RenderPictureTag(string urlPhoto, string productName)
 {
     if (string.IsNullOrEmpty(urlPhoto))
     {
         return("<img src=\"images/nophoto_small.jpg\" alt=\"\" />");
     }
     return(string.Format("<img src=\"{0}\" alt=\"{1}\" />", FoldersHelper.GetImageProductPath(ProductImageType.Small, urlPhoto, false), productName));
 }
Ejemplo n.º 26
0
    public Admin_Export1C()
    {
        //strFilePath = Server.MapPath("~/price_temp/");
        //strFullPath = Server.MapPath("~/price_temp/") + "products.xml";

        _strFilePath = FoldersHelper.GetPathAbsolut(FolderType.PriceTemp);
        _strFullPath = string.Format("{0}{1}", _strFilePath, StrFileName);
    }
Ejemplo n.º 27
0
 protected string GetImageSource()
 {
     if (!string.IsNullOrWhiteSpace(SettingsBank.StampImageName))
     {
         return(FoldersHelper.GetPath(FolderType.Pictures, SettingsBank.StampImageName, true));
     }
     return(string.Empty);
 }
Ejemplo n.º 28
0
        private void SaveReplay()
        {
            var x = (from rep in ScreenHelper.Instance.ListOfReplays where rep.ID == ScreenHelper.Instance.DownloadedGameGuid select rep.Name).First();

            using (var sr = new FileStream(Path.Combine(FoldersHelper.GetReplayPath(), x), FileMode.CreateNew))
            {
                SerializationHelper.Serialize(ScreenHelper.Instance.ToSerialize, sr);
            }
        }
Ejemplo n.º 29
0
        private void SaveNews()
        {
            MsgErr(true); // Clean
            try
            {
                var news = new NewsItem
                {
                    NewsID     = NewsId,
                    AddingDate = SQLDataHelper.GetDateTime(txtDate.Text + " " + txtTime.Text),
                    Title      = txtTitle.Text,
                    //Picture = file,
                    TextToPublication = FCKTextToPublication.Text,
                    TextAnnotation    = CKEditorControlAnnatation.Text,
                    TextToEmail       = string.Empty,//rbNo.Checked ? String.Empty : FCKTextToEmail.Text,
                    NewsCategoryID    = dboNewsCategory.SelectedValue.TryParseInt(),
                    ShowOnMainPage    = chkOnMainPage.Checked,
                    UrlPath           = txtStringID.Text,
                    //MetaId = SQLDataHelper.GetInt(hfMetaId.Text),
                    Meta = new MetaInfo
                    {
                        ObjId           = NewsId,
                        Title           = txtHeadTitle.Text,
                        H1              = txtH1.Text,
                        MetaKeywords    = txtMetaKeys.Text,
                        MetaDescription = txtMetaDescription.Text,
                        Type            = MetaType.News
                    }
                };

                news.UrlPath = txtStringID.Text;
                NewsService.UpdateNews(news);
                if (FileUpload1.HasFile)
                {
                    if (!FileHelpers.CheckFileExtension(FileUpload1.FileName, FileHelpers.eAdvantShopFileTypes.Image))
                    {
                        MsgErr(Resource.Admin_ErrorMessage_WrongImageExtension);
                        return;
                    }
                    PhotoService.DeletePhotos(NewsId, PhotoType.News);

                    var tempName = PhotoService.AddPhoto(new Photo(0, NewsId, PhotoType.News)
                    {
                        OriginName = FileUpload1.FileName
                    });
                    if (!string.IsNullOrWhiteSpace(tempName))
                    {
                        using (var image = Image.FromStream(FileUpload1.FileContent))
                            FileHelpers.SaveResizePhotoFile(FoldersHelper.GetPathAbsolut(FolderType.News, tempName), SettingsPictureSize.NewsImageWidth, SettingsPictureSize.NewsImageHeight, image);
                    }
                }
            }
            catch (Exception ex)
            {
                MsgErr(ex.Message + " SaveNews main");
                Debug.LogError(ex);
            }
        }
    protected string RenderPictureTag(string urlPhoto, string urlPath, string photoDesc)
    {
        string strFormat = string.Empty;

        strFormat = string.Format("<a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" title=\"{2}\" /></a>", urlPath,
                                  FoldersHelper.GetImageProductPath(ProductImageType.Small, urlPhoto, false), HttpUtility.HtmlEncode(photoDesc));

        return(strFormat);
    }