| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- 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;
- using CoreFS.CA06;
- using System.Collections;
- using Core.Mes.Client.Comm.Tool;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- namespace Core.StlMes.Client.Lims.Data.PipeAndOutdec
- {
- public partial class FrmMakeCheck : FrmBase
- {
- private string arrId;//数据权限
- public FrmMakeCheck()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- private void FrmMakeCheck_Load(object sender, EventArgs e)
- {
- RegStartTime.Value = DateTime.Parse(DateTime.Today.ToString("yyyy-MM-dd"));
- arrId = UserInfo.GetDeptid();
-
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQueryData();
- break;
- case "Check":
- autoCheck();
- break;
- case "HandCheck":
- handCheck();
- break;
- case "Export":
- ExportData();
- break;
- case "Print":
- DoPrint();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 手动抽查
- /// </summary>
- private void handCheck()
- {
- string strRegStart = this.RegStartTime.Value.ToString("yyyy-MM-dd");
- string userName = this.UserInfo.GetUserName();
- string checkNo = this.ultraGrid2.ActiveRow.Cells["CHECK_NO"].Value.ToString();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmMakeCheck";
- ccp.MethodName = "handCheck";
- ccp.ServerParams = new object[] { strRegStart, arrId, userName ,checkNo};
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("手动抽查成功!"))
- {
- doQueryData();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 打印
- /// </summary>
- private void DoPrint()
- {
- string url = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPipeMakeCheck.cpt&op=view&DEPT_ID=" + arrId;
- FrmExcel fre = new FrmExcel(this.ob, url);
- fre.AutoSize = true;
- fre.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fre.WindowState = FormWindowState.Maximized;
- fre.Show();
- }
- /// <summary>
- /// 自动抽查
- /// </summary>
- private void autoCheck()
- {
- string strRegStart = this.RegStartTime.Value.ToString("yyyy-MM-dd");
- string userName = this.UserInfo.GetUserName();
- string checkCount = ""; //需要抽查的报告份数
- DataTable dt2 = Core.Mes.Client.Comm.Server.ServerHelper.GetData("com.steering.lims.data.pipe.FrmMakeCheck.doQueryCheckCount", new Object[] { strRegStart, arrId }, this.ob);
- checkCount = dt2.Rows[0]["checkCount"].ToString3();
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.lims.data.pipe.FrmMakeCheck";
- ccp.MethodName = "autoCheck";
- ccp.ServerParams = new object[] { strRegStart, arrId, userName, checkCount };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("自动抽查成功!"))
- {
- doQueryData();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
-
- /// <summary>
- /// 查询
- /// </summary>
- private void doQueryData()
- {
- this.dataTable1.Clear();
- string strRegStart = this.RegStartTime.Value.ToString("yyyy-MM-dd");
- string sumCount = ""; //发出的报告份数
- string checkCount = ""; //需要抽查的报告份数
- DataTable dt = ServerHelper.GetData("com.steering.lims.data.pipe.FrmMakeCheck.doQueryData", new Object[] { strRegStart,arrId }, this.ob);
- GridHelper.CopyDataToDatatable(dt, this.dataTable1, true);
- GridHelper.RefreshAndAutoSize(this.ultraGrid1);
- DataTable dt2 = ServerHelper.GetData("com.steering.lims.data.pipe.FrmMakeCheck.doQueryAuditData", new Object[] { strRegStart, arrId }, this.ob);
- GridHelper.CopyDataToDatatable(dt2, this.dataTable2, true);
- GridHelper.RefreshAndAutoSize(this.ultraGrid2);
- DataTable dt3 = ServerHelper.GetData("com.steering.lims.data.pipe.FrmMakeCheck.doQueryCheckCount", new Object[] { strRegStart, arrId }, this.ob);
- sumCount = dt3.Rows[0]["sumCount"].ToString3();
- checkCount = dt3.Rows[0]["checkCount"].ToString3();
- this.ultraLabel1.Text = strRegStart + "共发出报告" + sumCount + "份,共需抽检报告:" + checkCount + "份.";
- ultraLabel1.ForeColor = Color.Red;
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void ExportData()
- {
- GridHelper.ulGridToExcel(ultraGrid1, "检验周期抽查");
- }
- }
- }
|