/*******************************************************************************
* Copyright(c) 2016 DongkeSoft All rights reserved. / Confidential
* 类的信息:
* 1.程序名称:F_SAP_HEGII_011201.cs
* 2.功能描述:手动同步
* 编辑履历:
* 作者 日期 版本 修改内容
* 陈晓野 2018/11/16 1.00 新建
*******************************************************************************/
using System;
using System.Reflection;
using System.Windows.Forms;
using Dongke.IBOSS.PRD.Basics.BaseControls;
using Dongke.IBOSS.PRD.Client.CommonModule;
using Dongke.IBOSS.PRD.WCF.DataModels;
using Dongke.IBOSS.PRD.WCF.Proxys;
namespace Dongke.IBOSS.PRD.Client.SAPDataModule
{
public partial class F_SAP_HEGII_011201 : FormBase
{
public F_SAP_HEGII_011201()
{
InitializeComponent();
this.dtpSyncDate.Value = DateTime.Now.Date;
}
///
/// 同步
///
///
///
private void btnSave_Click(object sender, EventArgs e)
{
try
{
string syncDate = this.dtpSyncDate.Value.ToString("yyyy-MM-dd");
DialogResult dr = MessageBox.Show("是否同步【" + syncDate + "】的数据。",
this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
if (dr != DialogResult.Yes)
{
return;
}
ClientRequestEntity cre = new ClientRequestEntity();
cre.NameSpace = "Hegii";
cre.Name = "SyncZhongTaiData";
cre.Properties["SyncDate"] = syncDate;
ServiceResultEntity sre = (ServiceResultEntity)DoAsync(() =>
{
return SAPDataModuleProxy.Service.DoRequest(cre);
});
if (sre.OtherStatus > 0)
{
DKMessageBox.ShowDialog(this, DKMessageCode.I_CMN_S_002);
this.DialogResult = DialogResult.OK;
Close();
}
else
{
DKMessageBox.ShowDialog(this, DKMessageCode.W_CMN_S_004, sre.Message);
}
}
catch (Exception ex)
{
// 对异常进行共通处理
ExceptionManager.HandleEventException(this.ToString(),
MethodBase.GetCurrentMethod().Name, this.Text, ex);
}
}
///
/// 取消
///
///
///
private void btnCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}