예제 #1
0
        /// <summary>
        /// 删除图片的处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ColorPic_Disposed(object sender, EventArgs e)
        {
            TitleImage pic = sender as TitleImage;

            CostumePhotos.Remove(pic.Tag as EmCostumePhoto);
            AddRemovePhotos(pic.Tag as EmCostumePhoto);
        }
예제 #2
0
 private void TitleImageMoveDown(TitleImageOfCostume sender, EventArgs e)
 {
     if (sender != null && sender.Tag != null &&
         sender.Tag is EmCostumePhoto)
     {
         EmCostumePhoto moved = sender.Tag as EmCostumePhoto;
         int            index = CostumePhotos.IndexOf(moved);
         if (index < CostumePhotos.Count - 1)
         {
             CostumePhotos.Remove(moved);
             CostumePhotos.Insert(index + 1, moved);
         }
     }
 }
예제 #3
0
        private void BaseButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                item = GetEntity();

                if (!Validate(item))
                {
                    return;
                }
                if (GlobalUtil.EngineUnconnectioned(this))
                {
                    return;
                }

                RemoveDisposedCostumePhoto();
                UploadCostumePhoto();
                SetProgressInfo("正在保存商品信息……");
                UpdateDisplayIndex();
                if (firstImgUrl != string.Empty)
                {
                    item.EmThumbnail = firstImgUrl;
                }
                InsertCostumeResult result = GlobalCache.ServerProxy.InsertCostume(item);

                if (result == InsertCostumeResult.Error)
                {
                    GlobalMessageBox.Show("内部错误!");
                    return;
                }
                else if (result == InsertCostumeResult.Exist)
                {
                    GlobalMessageBox.Show("该商品已存在!");
                    return;
                }
                else
                {
                    //   UploadCostumePhoto(item);

                    GlobalCache.CostumeList_OnChange(item);


                    ///最后一次保存的尺码组和选择的列


                    //begin 724 商品档案:新增商品后,窗口不要关闭
                    //  this.Hide();
                    //    this.Close();
                    SetProgressVisible(false);
                    ClearNew();
                    if (CostumePhotos != null && CostumePhotos.Count > 0)
                    {
                        CostumePhotos.Clear();
                    }
                    this.titleImageControlWidth1.Clear();
                    GlobalMessageBox.Show("添加成功!");
                    this.skinTextBox_ID.Focus();
                    //end 724 商品档案:新增商品后,窗口不要关闭
                    Costume_Newed?.Invoke(item);
                }
                config.Costume = item;
                config.Save(CONFIG_PATH);
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }