| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_PM_1402.cs
- * 2.功能描述:在产产品更多条件
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 宋扬 2014/10/24 1.00 新建
- *******************************************************************************/
- using System;
- using System.Data;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Basics.BaseControls;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.WCF.Proxys.PMModuleService;
- namespace Dongke.IBOSS.PRD.Client.PMModule
- {
- /// <summary>
- /// 在产产品更多条件
- /// </summary>
- public partial class F_PM_1402 : FormBase
- {
- # region 成员变量
- //在产产品实体
- private SearchInProductionEntity _searchInProductionEntity = new SearchInProductionEntity();
- // 窗体的单例模式
- private static F_PM_1402 _instance;
- #endregion
- #region 属性
- /// <summary>
- /// 当前员工实体
- /// </summary>
- public SearchInProductionEntity searchInProductionEntity
- {
- get { return _searchInProductionEntity; }
- set { _searchInProductionEntity = value; }
- }
- #endregion
- #region 构造函数
- public F_PM_1402()
- {
- InitializeComponent();
- SetFromTitleInfo();
- }
- #endregion
- #region 单例模式
- /// <summary>
- /// 单例模式,防止重复创建窗体
- /// </summary>
- public static F_PM_1402 Instance
- {
- get
- {
- if (_instance == null || _instance.IsDisposed)
- {
- _instance = new F_PM_1402();
- }
- return _instance;
- }
- }
- #endregion
- #region 事件处理
- /// <summary>
- /// 确定按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnOK_Click(object sender, EventArgs e)
- {
- try
- {
- SearchInProductionData();
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// 窗体关闭事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PM_1402_FormClosed(object sender, FormClosedEventArgs e)
- {
- _instance = null;
- }
- /// <summary>
- /// 关闭按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnCancel_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- ///注浆日期 选中框变更事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void cBoxGroutingDate_CheckedChanged(object sender, EventArgs e)
- {
- if (this.cBoxGroutingDate.Checked)
- {
- this.dtPGroutingDateStart.Enabled = true;
- this.dtPGroutingDateEnd.Enabled = true;
- }
- else
- {
- this.dtPGroutingDateStart.Enabled = false;
- this.dtPGroutingDateEnd.Enabled = true;
- }
- }
- /// <summary>
- ///更新日期 选中框变更事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void cBoxUpdateTime_CheckedChanged(object sender, EventArgs e)
- {
- if (this.cBoxUpdateTime.Checked)
- {
- this.dtpUpdateTimeStart.Enabled = true;
- this.dtpUpdateTimeEnd.Enabled = true;
- }
- else
- {
- this.dtpUpdateTimeStart.Enabled = false;
- this.dtpUpdateTimeEnd.Enabled = false;
- }
- }
- #endregion
- #region 私有方法
- /// <summary>
- /// 设置窗体按钮的文本信息
- /// </summary>
- private void SetFromTitleInfo()
- {
- this.Text = FormTitles.F_PM_1402;
- this.btnOK.Text = ButtonText.BTN_OK;
- this.btnCancel.Text = ButtonText.BTN_CANCEL;
- #region 绑定工序模型
- DataTable newdtb = new DataTable();
- newdtb.Columns.Add("Id", typeof(int));
- newdtb.Columns.Add("ProcedureModel", typeof(string));
- for (int i = 1; i <= 2; i++)
- {
- DataRow newRow = newdtb.NewRow();
- newRow["Id"] = i;
- if (i == 1)
- {
- newRow["ProcedureModel"] = "计件模型";
- }
- else
- {
- newRow["ProcedureModel"] = "检验模型";
- }
- newdtb.Rows.Add(newRow);
- }
- this.dropProcedureModel.DisplayMember = "ProcedureModel";
- this.dropProcedureModel.ValueMember = "Id";
- this.dropProcedureModel.DataSource = newdtb;
- #endregion
- }
- /// <summary>
- /// 搜索条件
- /// </summary>
- private void SearchInProductionData()
- {
- #region 条件赋值
- this.searchInProductionEntity.GroutingLineName = this.txtGroutingLineName.Text.Trim();
- this.searchInProductionEntity.GroutingLineCode = this.txtGroutingLineCode.Text.Trim();
- this.searchInProductionEntity.GMouldTypeName = this.txtGMouldTypeName.Text.Trim();
- this.searchInProductionEntity.ReworkProcedureName = this.txtReworkProcedureName.Text.Trim();
- this.searchInProductionEntity.ModelTypeName = this.txtModelType.Text.Trim();
- this.searchInProductionEntity.GoodsLevelName = this.txtgoodsLevelName.Text.Trim();
- this.searchInProductionEntity.GoodsLevelTypeName = this.txtgoodsLevelTypeName.Text.Trim();
- this.searchInProductionEntity.GroutingMouldCode = this.txtGroutingMouldCode.Text.Trim();
- this.searchInProductionEntity.Remarks = this.txtRemarks.Text.Trim();
- if (this.cBoxGroutingDate.Checked)
- {
- string groutingDateStart = this.dtPGroutingDateStart.Value.ToString("yyyy-MM-dd") + " 0:0:0";
- this.searchInProductionEntity.GroutingDateStart = Convert.ToDateTime(groutingDateStart);
- string groutingDateEnd = this.dtPGroutingDateEnd.Value.ToString("yyyy-MM-dd") + " 0:0:0";
- this.searchInProductionEntity.GroutingDateEnd = Convert.ToDateTime(groutingDateEnd);
- }
- this.searchInProductionEntity.UpdateUserName = this.txtUpdateUserName.Text.Trim();
- this.searchInProductionEntity.CreateUserName = this.txtCreateUserName.Text.Trim();
- if (this.cBoxUpdateTime.Checked)
- {
- string updateTimeStart = this.dtpUpdateTimeStart.Value.ToString("yyyy-MM-dd") + " 0:0:0";
- this.searchInProductionEntity.UpdateTimeStart = Convert.ToDateTime(updateTimeStart);
- string updateTimeEnd = this.dtpUpdateTimeEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59";
- this.searchInProductionEntity.UpdateTimeEnd = Convert.ToDateTime(updateTimeEnd);
- }
- #region 是否公坯
- object[] objPublicBody = this.statusIsPublicBody.SelectedValues;
- string publicBody = "";
- for (int i = 0; i < objPublicBody.Length; i++)
- {
- publicBody += objPublicBody[i] + ",";
- }
- publicBody = publicBody.TrimEnd(',');
- this.searchInProductionEntity.IsPublicBody = publicBody;
- #endregion
- #region 是否重烧
- object[] objIsReFire = this.statusIsReFire.SelectedValues;
- string reFire = "";
- for (int i = 0; i < objIsReFire.Length; i++)
- {
- reFire += objIsReFire[i] + ",";
- }
- reFire = reFire.TrimEnd(',');
- this.searchInProductionEntity.IsReFire = reFire;
- #endregion
- #region 能否多次注浆
- object[] objCanManyTimes = this.statusCanManyTimes.SelectedValues;
- string canManyTimes = string.Empty;
- for (int i = 0; i < objCanManyTimes.Length; i++)
- {
- canManyTimes += objCanManyTimes[i] + ",";
- }
- canManyTimes = canManyTimes.TrimEnd(',');
- this.searchInProductionEntity.CanManyTimes = canManyTimes;
- #endregion
- this.searchInProductionEntity.ProcedureModel = this.dropProcedureModel.SelectedValue.ToString();
- #endregion
- }
- #endregion
- }
- }
|