| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- /*******************************************************************************
- * Copyright(c) 2019 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_PP_0203.cs
- * 2.功能描述:月计划产品产量新建
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 徐伟 2019/09/05 1.00 新建
- *******************************************************************************/
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Reflection;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.Client.Controls;
- using Dongke.IBOSS.PRD.Client.DataModels;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- namespace Dongke.IBOSS.PRD.Client.PPModule
- {
- /// <summary>
- /// 月计划窗体
- /// </summary>
- public partial class F_PP_0203 : DKDockPanelBase
- {
- #region 单例模式 防止窗体被重复创建
- private static F_PP_0203 _instance = null;
- public static F_PP_0203 Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new F_PP_0203();
- }
- return _instance;
- }
- }
- private void F_PP_0203_FormClosed(object sender, FormClosedEventArgs e)
- {
- _instance = null;
- }
- #endregion
- #region 构造函数
- /// <summary>
- /// 月计划窗体
- /// </summary>
- public F_PP_0203()
- {
- InitializeComponent();
- //this.Text = "月计划";
- }
- #endregion
- //月计划传入的Key和冗余数据
- public int planId = 0;
- public int planYearNo = DateTime.Now.Year;
- public int planMonthNo = DateTime.Now.Month;
- public DateTime planStartDate = DateTime.Now;
- public DateTime planEndDate = DateTime.Now;
- //产品产量id,0:插入操作,>0更新操作
- public int planGoodsId = 0;
- /// <summary>
- /// 画面加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PP_0203_Load(object sender, System.EventArgs e)
- {
- try
- {
- // 加载权限
- FormPermissionManager.FormPermissionControl(this.Name, this,
- LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
- LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- private void BtnCancel_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void BtnSave_Click(object sender, EventArgs e)
- {
- PlanMonthUpdate();
- this.Close();
- }
- //更新操作
- private void PlanMonthUpdate()
- {
- //月计划 插入
- ClientRequestEntity cre = new ClientRequestEntity();
- //用户填写的数据
- cre.Properties["GOODSID"] = Convert.ToInt32(goodsCode.SelectedValue);
- cre.Properties["PLANQUANTITY"] = Convert.ToInt32(planQuantity.Value);
- cre.Properties["REMARKS"] = planRemarks.Text;
- //自动填写的数据
- cre.Properties["UPDATETIME"] = DateTime.Now;
- cre.Properties["UPDATEUSERID"] = LogInUserInfo.CurrentUser.CurrentUserEntity.UserID;
- ServiceResultEntity result;
- if (planGoodsId == 0)
- {
- //新建专属的列
- cre.Properties["PLANID"] = planId;
- cre.Properties["YEARNO"] = planYearNo;
- cre.Properties["MONTHNO"] = planMonthNo;
- cre.Properties["STARTDATE"] = planStartDate;
- cre.Properties["ENDDATE"] = planEndDate;
- cre.Properties["ACCOUNTID"] = LogInUserInfo.CurrentUser.CurrentUserEntity.AccountID;
- cre.Properties["CREATETIME"] = DateTime.Now;
- cre.Properties["CREATEUSERID"] = LogInUserInfo.CurrentUser.CurrentUserEntity.UserID;
- result = PPModuleProxy.Service.PlanMonthGoodsInsert(cre);
- }
- else
- {
- //更新时主键要指定值
- cre.Properties["PLANGOODSID"] = planGoodsId;
- result = PPModuleProxy.Service.PlanMonthGoodsUpdate(cre);
- //更新时生成新版本
- }
- }
- }
- }
|