| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- 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 System.Collections;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using Infragistics.Win;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- namespace Core.LZMes.Client.QCM
- {
- public partial class QCM0208 : FrmBase
- {
- public QCM0208()
- {
- InitializeComponent();
- }
- private void QCM0208_Load(object sender, EventArgs e)
- {
- dateTimePicker1.Value = DateTime.Now.Date.AddDays(-1);
- dateTimePicker2.Value = DateTime.Now.Date.AddDays(1);
- ValueList v = new ValueList();
- v.ValueListItems.Add("0", "未发送");
- v.ValueListItems.Add("2", "已接收");
- v.ValueListItems.Add("3", "已完成");
- v.ValueListItems.Add("7", "确认接收");
- this.ultraGrid1.DisplayLayout.Bands[0].Columns["STATUS"].ValueList = v.Clone();
- this.ultraGrid2.DisplayLayout.Bands[0].Columns["STATUS"].ValueList = v.Clone();
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- this.DoQuery();
- break;
- case "InExport":
- break;
- }
- }
- #region 查询按钮
- private void button1_Click(object sender, EventArgs e)
- {
- this.DoQuery();
- }
- #endregion
- #region 查询
- private void DoQuery()
- {
- try
- {
- String STARTTIME = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
- String ENDTIME = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
- String BATCH_NO = this.textBox1.Text.Trim();
- String SPECIMEN_NO = this.textBox2.Text.Trim();
- if (this.checkBox2.Checked)
- {
- STARTTIME = "";
- ENDTIME = "";
- }
- else
- {
- BATCH_NO = "";
- }
- if (this.checkBox1.Checked)
- {
- STARTTIME = "";
- ENDTIME = "";
- }
- else
- {
- SPECIMEN_NO = "";
- }
- Hashtable ht = new Hashtable();
- ht.Add("STARTTIME", STARTTIME);//
- ht.Add("ENDTIME", ENDTIME);//
- ht.Add("BATCH_NO", BATCH_NO);//
- ht.Add("SPECIMEN_NO", SPECIMEN_NO);//
- CoreClientParam ccp = new CoreClientParam();
- this.dataSet1.Clear();
- ccp.ServerName = "QCM.JHY01.JHY0102.QuerryJhyQtly";
- ccp.MethodName = "getZHBLRA";
- ccp.SourceDataTable = this.dataSet1.Tables[0];
- ccp.ServerParams = new object[] { ht };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- ClsControlPack.RefreshAndAutoSize(ultraGrid1);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("查询异常!", "警告");
- }
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- int num = this.ultraGrid1.Rows.Count();
- if (num >= 1)
- {
- String SPECIMEN_NO = this.ultraGrid1.ActiveRow.Cells["SPECIMEN_NO"].Value.ToString();
- Hashtable ht = new Hashtable();
- ht.Add("SPECIMEN_NO", SPECIMEN_NO);
- CoreClientParam ccp = new CoreClientParam();
- this.dataSet2.Clear();
- ccp.ServerName = "QCM.JHY01.JHY0102.QuerryJhyQtly";
- ccp.MethodName = "getZHBLRAITEM";
- ccp.SourceDataTable = this.dataSet2.Tables[0];
- ccp.ServerParams = new object[] { ht };
- this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal);
- ClsControlPack.RefreshAndAutoSize(ultraGrid2);
- }
- else
- {
- this.dataSet1.Clear();
- this.dataSet2.Clear();
- }
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("查询异常!", "警告");
- }
- }
- #endregion
- #region 修改
- private void button2_Click(object sender, EventArgs e)
- {
- try
- {
- int num = 0;
- String SPECIMEN_NO_CK = "";
- //判断勾选了几个轧批
- foreach (UltraGridRow ugr in this.ultraGrid2.Rows)
- {
- if (ugr.Cells["CHECK"].Value.ToString().ToLower() == "true")
- {
- String BATCH_NO = ugr.Cells["BATCH_NO"].Value.ToString();
- String STATUS = ugr.Cells["STATUS"].Value.ToString();
- if (!"0".Equals(STATUS))
- {
- this.alert("轧批[" + BATCH_NO +"]已下发委托不能修改为这个轧批,请先撤销委托再操作或换成其它未下发的轧批!");
- return;
- }
- num = num + 1;
- SPECIMEN_NO_CK = ugr.Cells["SPECIMEN_NO"].Value.ToString();
- }
- }
- if (num != 1)
- {
- this.alert("加做冲击只能勾选一个轧批做为送样的LRA,不可勾选多条数据请核实数据!");
- return;
- }
- String SPECIMEN_NO = this.ultraGrid1.ActiveRow.Cells["SPECIMEN_NO"].Value.ToString();
- Hashtable ht = new Hashtable();
- ht.Add("SPECIMEN_NO", SPECIMEN_NO);
- ht.Add("SPECIMEN_NO_CK", SPECIMEN_NO_CK);
- ht.Add("USER_ID", this.UserInfo.GetUserID());
- ht.Add("USER_NAME", this.UserInfo.GetUserName());
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "QCM.JHY01.JHY0102.UpdateInfo";
- ccp.MethodName = "UPZHBLRA";
- ccp.ServerParams = new object[] { ht };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.None);
- }
-
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- MessageBox.Show("查询异常!", "警告");
- }
- }
- #endregion
- private void checkBox2_Click(object sender, EventArgs e)
- {
- if (this.checkBox2.Checked)
- {
- this.dateTimePicker1.Enabled = false;
- this.dateTimePicker2.Enabled = false;
- this.textBox1.Enabled = true;
- }
- else
- {
- if (!this.checkBox1.Checked && !this.checkBox2.Checked )
- {
- this.dateTimePicker1.Enabled = true;
- this.dateTimePicker2.Enabled = true;
- }
- this.textBox1.Enabled = false;
- }
- }
- private void checkBox1_Click(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked)
- {
- this.dateTimePicker1.Enabled = false;
- this.dateTimePicker2.Enabled = false;
- this.textBox2.Enabled = true;
- }
- else
- {
- if (!this.checkBox1.Checked && !this.checkBox2.Checked)
- {
- this.dateTimePicker1.Enabled = true;
- this.dateTimePicker2.Enabled = true;
- }
- this.textBox2.Enabled = false;
- }
- }
-
- }
- }
|