Пример #1
0
        private void gcDict_Click(object sender, EventArgs e)
        {
            var selectedRow = gridView1.GetFocusedRow() as ClientVersionEntity;

            if (selectedRow == null)
            {
                return;
            }
            var edit = new ClientVersionEdit();

            edit.clientVersion = selectedRow;
            edit.Text          = "版本修改";
            if (edit.ShowDialog() == DialogResult.OK)
            {
                MessageBoxUtils.Hint("修改成功!", MainForm);
                DoWorkAsync(500, (o) =>
                {
                    Thread.Sleep(2700);
                    return(null);
                }, null, (r) =>
                {
                    cmd.ShowOpaqueLayer(255, true);
                    SearchData(true, pageControl1.CurrentPage, pageControl1.PageSize);
                });
            }
        }
Пример #2
0
 private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     if (e.Column.Caption == "操作")
     {
         var selectedRow = gridView1.GetFocusedRow() as ClientVersionEntity;
         if (selectedRow == null)
         {
             return;
         }
         if (MessageBoxUtils.Show("确定要删除吗?", MessageBoxButtons.OKCancel,
                                  MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MainForm) == DialogResult.OK)
         {
             cmd.ShowOpaqueLayer(225, true);
             var param = "?id=" + selectedRow.id;
             var url   = AppContext.AppConfig.serverUrl + "sys/clientVersion/delete" + param;
             DoWorkAsync(500, (o) =>
             {
                 var data = HttpClass.httpPost(url);
                 return(data);
             }, null, (r) =>
             {
                 var objT = JObject.Parse(r.ToString());
                 if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                 {
                     SearchData(false, pageControl1.CurrentPage, pageControl1.PageSize);
                     MessageBoxUtils.Hint("删除成功!", MainForm);
                 }
                 else
                 {
                     MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                          MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                 }
             });
         }
     }
     else
     {
         var selectedRow = gridView1.GetFocusedRow() as ClientVersionEntity;
         if (selectedRow == null)
         {
             return;
         }
         var edit = new ClientVersionEdit();
         edit.clientVersion = selectedRow;
         edit.Text          = "版本修改";
         if (edit.ShowDialog() == DialogResult.OK)
         {
             MessageBoxUtils.Hint("修改成功!", MainForm);
             DoWorkAsync(500, (o) =>
             {
                 Thread.Sleep(2700);
                 return(null);
             }, null, (r) =>
             {
                 cmd.ShowOpaqueLayer(255, true);
                 SearchData(true, pageControl1.CurrentPage, pageControl1.PageSize);
             });
         }
     }
 }
Пример #3
0
        private void skinButton2_Click(object sender, EventArgs e)
        {
            var edit = new ClientVersionEdit();

            if (edit.ShowDialog() == DialogResult.OK)
            {
                MessageBoxUtils.Hint("保存成功!");
                SearchData(true, 1);
            }
        }
Пример #4
0
        private void skinButton2_Click(object sender, EventArgs e)
        {
            var edit = new ClientVersionEdit();

            if (edit.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(300);
                cmd.ShowOpaqueLayer(255, true);
                SearchData(true, 1, pageControl1.PageSize);
                MessageBoxUtils.Hint("保存成功!", MainForm);
            }
        }