private void GridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     if (gridView1.GetRow(gridView1.FocusedRowHandle) is PostCardSizeResponse postCardSizeResponse)
     {
         SystemSizeApi.UpdateProductSizeToServer(postCardSizeResponse.Id, new SizeRequest
         {
             Name   = postCardSizeResponse.Name,
             Width  = postCardSizeResponse.Width,
             Height = postCardSizeResponse.Height
         }, success => { });
     }
 }
 private void BarButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (gridView1.GetFocusedRow() is PostCardSizeResponse postSize)
     {
         SystemSizeApi.DeleteById(postSize.Id, success =>
         {
             if (gridControl1.DataSource is List <PostCardSizeResponse> postCardSizeResponses)
             {
                 postCardSizeResponses.Remove(postSize);
                 gridControl1.RefreshDataSource();
             }
         }, message => { XtraMessageBox.Show(message); });
     }
 }
Пример #3
0
 public void ReloadSizeList()
 {
     SystemSizeApi.GetSizeInfoFromServer("productSize", response =>
     {
         productSizeList.Items.Clear();
         response.ForEach(k => productSizeList.Items.Add(new PostSize
         {
             Name   = k.Name,
             Width  = k.Width,
             Height = k.Height
         }));
         productSizeList.Refresh();
     });
 }
        private void BarButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            barButtonItem1.Enabled = false;
            SystemSizeApi.InsertProductSizeToServer("productSize", new SizeRequest
            {
                Height = 100,
                Width  = 148,
                Name   = "默认尺寸"
            }, result =>
            {
                if (gridControl1.DataSource is List <PostCardSizeResponse> postCardSizeResponses)
                {
                    postCardSizeResponses.Add(result);
                    gridControl1.RefreshDataSource();
                }

                barButtonItem1.Enabled = true;
            }, failure => { barButtonItem1.Enabled = true; });
        }
Пример #5
0
 public EnvelopeSettingControl()
 {
     InitializeComponent();
     SystemSizeApi.GetSizeInfoFromServer("productSize", response =>
     {
         response.ForEach(k => productSizeList.Items.Add(new PostSize
         {
             Name   = k.Name,
             Width  = k.Width,
             Height = k.Height
         }));
         productSizeList.Refresh();
     });
     SystemBackStyleApi.GetAllBackStyleFromServer(success =>
                                                  success.ForEach(backStyle => backStyleList.Items.Add(new BackStyleInfo
     {
         FileId = backStyle.FileId,
         Name   = backStyle.Name
     })));
 }
        private void SimpleButton1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textEdit1.Text))
            {
                XtraMessageBox.Show("请输入尺寸名称!");
                return;
            }

            var width  = (int)spinEdit1.Value;
            var height = (int)spinEdit2.Value;

            SystemSizeApi.InsertProductSizeToServer("productSize", new SizeRequest
            {
                Height = height,
                Width  = width,
                Name   = textEdit1.Text
            }, success =>
            {
                XtraMessageBox.Show("尺寸插入成功!");
                DialogResult = DialogResult.OK;
            });
        }
 public SizeManageForm()
 {
     InitializeComponent();
     SystemSizeApi.GetSizeInfoFromServer("productSize", postSizeList => { gridControl1.DataSource = postSizeList; });
 }