| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- /*******************************************************************************
- * Copyright(c) 2020 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_MST_0303.cs
- * 2.功能描述:窑炉更新财年
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 付斌 2020/06/24 1.00 新建
- *******************************************************************************/
- using System;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- using Dongke.WinForm.Controls;
- namespace Dongke.IBOSS.PRD.Client.SystemModule
- {
- /// <summary>
- /// 组织机构新建/编辑界面
- /// </summary>
- public partial class F_MST_0303 : FormDialog
- {
- #region 构造函数
- /// <summary>
- /// 构造函数
- /// </summary>
- public F_MST_0303()
- {
- InitializeComponent();
- // 标题
- Text = FormTitles.F_MST_0303;
- // 按钮
- btnSave.Text = ButtonText.BTN_SAVE;
- btnCancel.Text = ButtonText.BTN_CLOSE;
- }
- #endregion
- #region 属性
- /// <summary>
- /// 上一个页面传过来的财年数据
- /// </summary>
- public int SK_Date { set; get; }
- #endregion
- #region 事件
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_MST_0303_Load(object sender, EventArgs e)
- {
- try
- {
- if (SK_Date == 0)
- {
- dtpSKDate.Value = DateTime.Now.Date;
- }
- else
- {
- dtpSKDate.Value = new DateTime(SK_Date + 1, 1, 1);
- }
- dtpSKDate.Focus();
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, Text, ex);
- }
- }
- /// <summary>
- /// 保存按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSave_Click(object sender, EventArgs e)
- {
- try
- {
- #region 校验
- if (dtpSKDate.Value.Year <= SK_Date)
- {
- MessageBox.Show(string.Format(Messages.MSG_CMN_W007, "输入值小于或等于当前系统的财年数"), Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- DialogResult drs = MessageBox.Show("修改财年后窑炉烧成号将重置,是否继续操作?",
- Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
- if (drs == DialogResult.No)
- {
- return;
- }
- #endregion
- #region 操作
- // 异步处理
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "F_MST_0303";
- cre.Name = "SaveSKDate";
- cre.Properties["SKDate"] = dtpSKDate.Value.Year;
- ServiceResultEntity sre = null;
- DoAsync(() => { return SystemModuleProxy.Service.DoRequest(cre); }, out sre);
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- if (sre.OtherStatus > 0)
- {
- MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "更新财年", "保存"), Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- DialogResult = DialogResult.OK;
- Close();
- }
- else if (sre.OtherStatus < 0 && !string.IsNullOrEmpty(sre.Message))
- {
- MessageBox.Show(string.Format(Messages.MSG_CMN_W007, sre.Message), Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "更新财年", "保存"), Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- else
- {
- MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "更新财年", "保存"), Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- #endregion
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, Text, ex);
- }
- }
- /// <summary>
- /// 关闭按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnClose_Click(object sender, EventArgs e)
- {
- Close();
- }
- #endregion
- }
- }
|