protected void btnSave_Click(object sender, EventArgs e)
    {
        if (!SaveData())
        {
            return;
        }

        if (ResizePhotoStatistic.IsRun == false)
        {
            ResizePhotoStatistic.Init();
            ResizePhotoStatistic.IsRun = true;
            linkCancel.Visible         = true;
            OutDiv.Visible             = true;
            btnSave.Visible            = false;
            try
            {
                //todo rewrite
                ResizePhotoStatistic.Count = PhotoService.GetCountPhotos(0, PhotoType.Product);

                var tr = new Thread(Resize);
                ResizePhotoStatistic.ThreadImport = tr;
                tr.Start();
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
                lError.Text    = ex.Message;
                lError.Visible = true;
            }
        }
    }
 protected void linkCancel_Click(object sender, EventArgs e)
 {
     if (!ResizePhotoStatistic.ThreadImport.IsAlive)
     {
         return;
     }
     ResizePhotoStatistic.ThreadImport.Abort();
     ResizePhotoStatistic.Init();
 }