123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm
- {
- public partial class ProcessExtensionSetSuperSmallForm : LYFZ.Software.UI.CameraControlBook.SuperSmallForm.ProcessExtensionSetSuperSmallForm
- {
- public ProcessExtensionSetSuperSmallForm()
- {
- }
-
-
-
- public string StrNumber = "";
-
-
-
- public string StrViceNumber = "";
-
-
-
-
-
-
-
-
-
- public string StrType = "";
- public bool IsSaveed = false;
- LYFZ.Model.Model_ErpOrderProcessMonitor modelpm = null;
- LYFZ.BLL.BLL_ErpOrderProcessMonitor ordpmbll = new BLL.BLL_ErpOrderProcessMonitor();
-
-
-
-
-
- protected override void ProcessExtensionSetSuperSmallForm_Shown(object sender, EventArgs e)
- {
- this.Text = this.StrType;
- List<LYFZ.Model.Model_ErpOrderProcessMonitor> mlist = ordpmbll.GetModelList("Ordpm_Number = '" + this.StrNumber + "' and Ordpm_ViceNumber = '" + this.StrViceNumber + "' and Ordpm_ProcessType = '" + this.StrType + "'");
- if (mlist.Count <= 0)
- { return; }
- modelpm = mlist[0];
- if (modelpm.ID <= 0)
- { return; }
- this.txtODays.Text = modelpm.Ordpm_ProcessDays.ToString().Trim();
- this.txtODate.Text = modelpm.Ordpm_ProcessDate.ToString("yyyy-MM-dd");
- this.txtORemark.Text = modelpm.Ordpm_ProcessRemark.Trim();
- this.Height = 610;
- }
-
-
-
-
-
- protected override void txtDays_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
-
-
-
-
-
- protected override void txtDays_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- { GetDateDays(); }
- }
- void GetDateDays()
- {
- DateTime StrTime = SDateTime.Now;
- DateTime strDateTime = StrTime.AddDays(Convert.ToInt32(this.txtDays.Text)).AddSeconds(-1);
- this.txtDate.Text = strDateTime.ToString("yyyy-MM-dd");
- this.txtDate.Tag = strDateTime;
- }
-
-
-
-
-
- protected override void txtDays_Leave(object sender, EventArgs e)
- {
- if (this.txtDays.Text.Trim() != "")
- { GetDateDays(); }
- else { this.txtDate.Text = ""; }
- }
-
-
-
-
-
- protected override void btnOk_Click(object sender, EventArgs e)
- {
- if (this.txtDays.Text.Trim() == "")
- { MessageBoxCustom.Show("延期天数不能为空!"); return; }
- if (this.txtRemark.Text.Trim() == "")
- { MessageBoxCustom.Show("延期原因不能为空!"); return; }
- DateTime strTime = SDateTime.Now;
- string strUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- if (modelpm != null)
- {
- modelpm.Ordpm_ProcessLOG = modelpm.Ordpm_ProcessLOG + "Ordpm_ProcessDays:≡" + modelpm.Ordpm_ProcessDays + "§Ordpm_ProcessDays≡" + modelpm.Ordpm_ProcessDays + "§Ordpm_ProcessDate≡" + modelpm.Ordpm_ProcessDate + "§Ordpm_ProcessRemark≡" + modelpm.Ordpm_ProcessRemark + "§Ordpm_UpdateDateTime≡" + modelpm.Ordpm_UpdateDateTime + "§Ordpm_UpdateName≡" + modelpm.Ordpm_UpdateName + "‖";
- modelpm.Ordpm_ProcessDays = Convert.ToInt32(this.txtDays.Text);
- modelpm.Ordpm_ProcessDate = Convert.ToDateTime(this.txtDate.Tag.ToString());
- modelpm.Ordpm_ProcessRemark = modelpm.Ordpm_ProcessRemark + "\r\n" + this.txtRemark.Text.Trim();
- modelpm.Ordpm_UpdateDateTime = strTime;
- modelpm.Ordpm_UpdateName = strUserID;
- if (!ordpmbll.Update(modelpm))
- { MessageBoxCustom.Show("保存失败"); return; }
- }
- else
- {
- modelpm = new Model.Model_ErpOrderProcessMonitor();
- modelpm.Ordpm_Number = this.StrNumber;
- modelpm.Ordpm_ViceNumber = this.StrViceNumber;
- modelpm.Ordpm_ProcessType = this.StrType;
- modelpm.Ordpm_ProcessDays = Convert.ToInt32(this.txtDays.Text);
- modelpm.Ordpm_ProcessDate = Convert.ToDateTime(this.txtDate.Tag.ToString());
- modelpm.Ordpm_ProcessRemark = this.txtRemark.Text.Trim();
- modelpm.Ordpm_ProcessLOG = "";
- modelpm.Ordpm_CreateDateTime = strTime;
- modelpm.Ordpm_CreateName = strUserID;
- modelpm.Ordpm_UpdateDateTime = strTime;
- modelpm.Ordpm_UpdateName = strUserID;
- if (!ordpmbll.Add(modelpm))
- { MessageBoxCustom.Show("保存失败"); return; }
- }
- this.IsSaveed = true;
- MessageBoxCustom.Show("保存成功!");
- this.Close();
- }
-
-
-
-
-
- protected override void btnCancel_Click(object sender, EventArgs e)
- { this.Close(); }
- }
- }
|