F_SAP_HEGII_011301.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*******************************************************************************
  2. * Copyright(c) 2016 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_SAP_HEGII_011301.cs
  5. * 2.功能描述:手动同步
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2018/11/16 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Reflection;
  12. using System.Windows.Forms;
  13. using Dongke.IBOSS.PRD.Basics.BaseControls;
  14. using Dongke.IBOSS.PRD.Client.CommonModule;
  15. using Dongke.IBOSS.PRD.WCF.DataModels;
  16. using Dongke.IBOSS.PRD.WCF.Proxys;
  17. namespace Dongke.IBOSS.PRD.Client.SAPDataModule
  18. {
  19. public partial class F_SAP_HEGII_011301 : FormBase
  20. {
  21. public F_SAP_HEGII_011301()
  22. {
  23. InitializeComponent();
  24. this.dtpSyncDate.Value = DateTime.Now.Date;
  25. }
  26. /// <summary>
  27. /// 同步
  28. /// </summary>
  29. /// <param name="sender"></param>
  30. /// <param name="e"></param>
  31. private void btnSave_Click(object sender, EventArgs e)
  32. {
  33. try
  34. {
  35. string syncDate = this.dtpSyncDate.Value.ToString("yyyy-MM-dd");
  36. DialogResult dr = MessageBox.Show("是否同步【" + syncDate + "】的数据。",
  37. this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
  38. if (dr != DialogResult.Yes)
  39. {
  40. return;
  41. }
  42. ClientRequestEntity cre = new ClientRequestEntity();
  43. cre.NameSpace = "Hegii";
  44. cre.Name = "SyncKunChuanData";
  45. cre.Properties["SyncDate"] = syncDate;
  46. ServiceResultEntity sre = (ServiceResultEntity)DoAsync(() =>
  47. {
  48. return SAPDataModuleProxy.Service.DoRequest(cre);
  49. });
  50. if (sre.OtherStatus > 0)
  51. {
  52. DKMessageBox.ShowDialog(this, DKMessageCode.I_CMN_S_002);
  53. this.DialogResult = DialogResult.OK;
  54. Close();
  55. }
  56. else
  57. {
  58. DKMessageBox.ShowDialog(this, DKMessageCode.W_CMN_S_004, sre.Message);
  59. }
  60. }
  61. catch (Exception ex)
  62. {
  63. // 对异常进行共通处理
  64. ExceptionManager.HandleEventException(this.ToString(),
  65. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  66. }
  67. }
  68. /// <summary>
  69. /// 取消
  70. /// </summary>
  71. /// <param name="sender"></param>
  72. /// <param name="e"></param>
  73. private void btnCancel_Click(object sender, EventArgs e)
  74. {
  75. this.DialogResult = DialogResult.Cancel;
  76. this.Close();
  77. }
  78. }
  79. }