| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_PC_0105.cs
- * 2.功能描述:查看覆历
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 庄天威 2014/10/06 1.00 新建
- *******************************************************************************/
- using System;
- using System.Data;
- using System.Text;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Basics.BaseControls;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.Client.DataModels;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- namespace Dongke.IBOSS.PRD.Client.PCModule
- {
- /// <summary>
- /// 查看覆历
- /// </summary>
- public partial class F_PC_0105 : FormBase
- {
- #region 成员常量
- private static F_PC_0105 _instance; // 单例模式使用
- //范围权限
- private string _purview;
- #endregion
- #region 构造函数
- public F_PC_0105()
- {
- InitializeComponent();
- this.Text = FormTitles.F_PC_0105;
- this.gbxCondition.Text = Constant.LABEL_QUERY_CONDITIONS;
- this.btnSearch.Text = ButtonText.BTN_SEARCH;
- this.btnClearCondition.Text = ButtonText.BTN_CLEARCONDITION;
- }
- #endregion
- #region 单例模式
- /// <summary>
- /// 单例模式,防止重复创建窗体
- /// </summary>
- public static F_PC_0105 Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new F_PC_0105();
- }
- return _instance;
- }
- }
- #endregion
- #region 事件处理
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSearch_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.dkGrouting.GroutingLineID == null)
- {
- MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "成型线"), this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.dkGrouting.Focus();
- return;
- }
- DateTime? TimeStart = null;
- DateTime? TimeEnd = null;
- if (this.cbTime.Checked == true)
- {
- TimeStart = Convert.ToDateTime(this.txtDateStart.Text);
- TimeEnd = Convert.ToDateTime(this.txtDateEnd.Text).AddHours(23).AddMinutes(59).AddSeconds(59);
- }
- DataSet dsMouldRecord = (DataSet)PCModuleProxy.Service.GetMouldRecordByMainId(this.dkGrouting.GroutingLineID, null, TimeStart, TimeEnd);
- DataSet dsMouldHistory = (DataSet)PCModuleProxy.Service.GetMouldHistoryByMainId(this.dkGrouting.GroutingLineID, null, TimeStart, TimeEnd);
- if (dsMouldRecord != null)
- {
- this.dgvMouldRecord.AutoGenerateColumns = false;
- this.dgvMouldRecord.DataSource = dsMouldRecord.Tables[0];
- }
- if (dsMouldHistory != null)
- {
- this.dgvMouldHistory.AutoGenerateColumns = false;
- this.dgvMouldHistory.DataSource = dsMouldHistory.Tables[0];
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 清空条件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnClearCondition_Click(object sender, EventArgs e)
- {
- this.dkGrouting.GroutingLineID = null;
- this.dkGrouting.Text = "";
- this.cbTime.Checked = false;
- this.dgvMouldHistory.DataSource = null;
- this.dgvMouldRecord.DataSource = null;
- }
- /// <summary>
- /// 窗体加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PC_0105_Load(object sender, EventArgs e)
- {
- try
- {
- getPurview();
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- #endregion
- #region 私有方法
- /// <summary>
- /// 获取成型线权限
- /// </summary>
- private void getPurview()
- {
- try
- {
- StringBuilder sbPurview = new StringBuilder();
- DataSet dsPurview = SystemModuleProxy.Service.GetUserPurview(5, LogInUserInfo.CurrentUser.UserID);
- if (dsPurview != null)
- {
- foreach (DataRow dr in dsPurview.Tables[0].Rows)
- {
- sbPurview.Append(dr[0].ToString() + ",");
- }
- if (sbPurview.Length != Constant.INT_IS_ZERO)
- {
- this._purview = sbPurview.ToString().Substring(0, sbPurview.Length - 1);
- }
- }
- this.dkGrouting.Purview = _purview;
- this.dkGrouting.IsEnablePurview = true;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- }
- }
|