1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- 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 CameraControlNotesSuperSmallForm : LYFZ.Software.UI.CameraControlBook.SuperSmallForm.CameraControlNotesSuperSmallForm
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- LYFZ.BLL.BLL_ErpOrderRemarkRecord orrbll = new BLL.BLL_ErpOrderRemarkRecord();
- public CameraControlNotesSuperSmallForm()
- {
- this.Shown += CameraControlNotesSuperSmallForm_Shown;
- this.FormClosing += CameraControlNotesSuperSmallForm_FormClosing;
- }
- /// <summary>
- /// 每月的日期,如果2016-11-09
- /// </summary>
- public string StrDateValue = "";
- /// <summary>
- /// 分店编号
- /// </summary>
- public string StrStoreName = "";
- /// <summary>
- /// 是否保存
- /// </summary>
- public bool IsSaveed = false;
- /// <summary>
- /// 保存后是否有内容
- /// </summary>
- public int intCurrentLength = 0;
- /// <summary>
- /// 员工编号
- /// </summary>
- string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
- LYFZ.Model.Model_ErpOrderRemarkRecord model = null;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void CameraControlNotesSuperSmallForm_Shown(object sender, EventArgs e)
- {
- string StrWhere = "Ordrr_OrdNumber = '" + this.StrStoreName + "' And Ordrr_ModuleName = '每日便签' " + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Ordrr_CreateDatetime", StrDateValue, StrDateValue);
- DataTable dt = orbll.GetView_Custom("tb_ErpOrderRemarkRecord", StrWhere: StrWhere, ShowColumnName: "*").Tables[0];
- if (dt.Rows.Count > 0)
- {
- this.txtTextNotes.Text = dt.Rows[0]["Ordrr_Remark"].ToString().Trim();
- model = orrbll.DataRowToModel(dt.Rows[0]);
- }
- else
- { model = new Model.Model_ErpOrderRemarkRecord(); }
- }
- /// <summary>
- /// 关闭窗体之前
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void CameraControlNotesSuperSmallForm_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (model.Ordrr_Remark == null || !model.Ordrr_Remark.Trim().Equals(this.txtTextNotes.Text.Trim()))
- {
- model.Ordrr_Remark = this.txtTextNotes.Text.Trim();
- model.Ordrr_ViceNumber = "";
- if (model.ID <= 0)
- {
- model.Ordrr_Number = "ORR" + LYFZ.BLL.BLL_ErpCustomer.GetClientNumber();
- model.Ordrr_OrdNumber = StrStoreName;
- model.Ordrr_ModuleName = "每日便签";
- model.Ordrr_CreateDatetime = Convert.ToDateTime(this.StrDateValue);
- model.Ordrr_CreateName = StrUserID;
- orrbll.Add(model);
- }
- else
- {
- model.Ordrr_CreateName = StrUserID;
- orrbll.Update(model);
- }
- intCurrentLength = model.Ordrr_Remark.Trim().Length;
- this.IsSaveed = true;
- }
- }
- }
- }
|