| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.YdmPipeManage;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.YdmPipeReport
- {
- public partial class FrmSingleReview : FrmBase
- {
- public FrmSingleReview()
- {
- InitializeComponent();
- }
- private void FrmSingleReview_Load(object sender, EventArgs e)
- {
- DateTime now = DateTime.Now;
- DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
- DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
- StartTime.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- EndTime.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- DoQuery();
- break;
- case "ReviewBy":
- DoReviewBy();
- break;
- case "AuditBy":
- DoAuditBy();
- break;
- case "Export"://导出
- DoExport();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- private void DoQuery()
- {
- if (!CheckQuery()) return;
- string stratTime = "1999-01-01 00:00:00";
- string endTime = "2999-12-31 23:59:59";
- string orderNo = "";
- string orderNoReal = "";
- string orderStrats = "";
- if (chkDate.Checked)
- {
- stratTime = StartTime.Value.ToString();
- endTime = EndTime.Value.ToString();
- }
- if (chkOrder.Checked)
- {
- orderNo = cmbOrder.Text.Trim();
- }
- if (chkOrderNo.Checked)
- {
- orderNoReal = cmbOrderNo.Text.Trim();
- }
- if (chkOrderstatus.Checked)
- {
- orderStrats = Txtorderstatus.Value.ToString();
- }
- DataTable dt=new DataTable();
- dt = ServerHelper.GetData("com.steering.pss.ydm.Report.FrmSingleReview.getDoQueryRev", new object[] { stratTime, endTime, orderNo, orderNoReal, orderStrats }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable3, true);
- if (dt.Rows.Count <= 0)
- {
- dt = new DataTable();
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- }
- }
- /// <summary>
- /// 评审通过
- /// </summary>
- private void DoReviewBy()
- {
- UltraGridRow row = ultraGrid2.ActiveRow;
- if (row == null) return;
- ultraGrid2.UpdateData();
- int count = 0;
- ArrayList list = new ArrayList();
- string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- foreach (UltraGridRow ugr in ultraGrid2.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Text) == true)
- {
- count += 1;
- ArrayList list1 = new ArrayList();
- list1.Add(ugr.Cells["REVIEW_NO"].Value.ToString());
- list1.Add("X");
- list1.Add(this.UserInfo.GetUserName());
- list1.Add(time);
- list.Add(list1);
- }
- }
- if (count == 0)
- {
- MessageUtil.ShowTips("请选择评审单主信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否评审通过?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.pss.ydm.Report.FrmSingleReview";
- ccp.MethodName = "doReviewBy";
- ccp.ServerParams = new object[] { list };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("评审通过!"))
- {
- DoQuery();
- }
- }
- }
- /// <summary>
- /// 评审不通过
- /// </summary>
- private void DoAuditBy()
- {
- UltraGridRow row = ultraGrid2.ActiveRow;
- if (row == null) return;
- ultraGrid2.UpdateData();
- int count = 0;
- ArrayList list = new ArrayList();
- string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- foreach (UltraGridRow ugr in ultraGrid2.Rows)
- {
- if (Convert.ToBoolean(ugr.Cells["CHK"].Text) == true)
- {
- count += 1;
- ArrayList list1 = new ArrayList();
- list1.Add(ugr.Cells["REVIEW_NO"].Value.ToString());
- list1.Add("X");
- list1.Add(this.UserInfo.GetUserName());
- list1.Add(time);
- list.Add(list1);
- }
- }
- if (count == 0)
- {
- MessageUtil.ShowTips("请选择评审单主信息!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否评审不通过?") == DialogResult.No)
- {
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- try
- {
- this.Cursor = Cursors.WaitCursor; //控制鼠标的样式为等待
- if (Constant.WaitingForm == null)
- {
- Constant.WaitingForm = new WaitingForm();
- }
- Constant.WaitingForm.ShowToUser = true;
- Constant.WaitingForm.Show();
- Constant.WaitingForm.Update();
- ccp.ServerName = "com.steering.pss.ydm.Report.FrmSingleReview";
- ccp.MethodName = "doAuditBy";
- ccp.ServerParams = new object[] { list };
- ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- catch (Exception ex)
- {
- this.Cursor = Cursors.Default;
- Constant.WaitingForm.ShowToUser = false;
- Constant.WaitingForm.Close();
- Constant.WaitingForm = null;
- }
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- if (ccp.ReturnInfo.Equals("评审不通过成功!"))
- {
- DoQuery();
- }
- }
- }
- ///查询时验证必填项
- private bool CheckQuery()
- {
- if (DataTimeUtil.JudgeTime(DateTime.Parse(StartTime.Value.ToString()), DateTime.Parse(EndTime.Value.ToString())) == 0)
- {
- MessageUtil.ShowTips("开始时间不能大于结束时间!");
- return false;
- }
- if (chkOrder.Checked && string.IsNullOrEmpty(cmbOrder.Text.Trim()))
- {
- MessageBox.Show("请输入评审单号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return false;
- }
- if (chkOrderstatus.Checked && string.IsNullOrEmpty(Txtorderstatus.Text.Trim()))
- {
- MessageBox.Show("请选择评审状态!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return false;
- }
- return true;
- }
- private void ultraGrid2_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow urg = ultraGrid2.ActiveRow;
- DataTable dt;
- if (urg == null) return;
- dt = ServerHelper.GetData("com.steering.pss.ydm.Report.FrmSingleReview.getDoQueryOrderRev", new object[] { urg.Cells["REVIEW_NO"].Value.ToString() }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- }
- private void DoExport()
- {
- GridHelper.ulGridToExcel(ultraGrid2, "合同注销评审主信息");
- }
- private void chkDate_CheckedChanged(object sender, EventArgs e)
- {
- if (chkDate.Checked) { StartTime.Enabled = true; EndTime.Enabled = true; } else { StartTime.Enabled = false; EndTime.Enabled = false; }
- if (chkOrder.Checked) { cmbOrder.Enabled = true; } else { cmbOrder.Enabled = false; }
- if (chkOrderstatus.Checked) { Txtorderstatus.Enabled = true; } else { Txtorderstatus.Enabled = false; }
- if (chkOrderNo.Checked) { cmbOrderNo.Enabled = true; } else { cmbOrderNo.Enabled = false; }
- }
- }
- }
|