| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.YdmPipeManage.Entity;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinEditors;
- 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.YdmPipeManage
- {
- public partial class FrmUpdateMemo : FrmBase
- {
- public FrmUpdateMemo()
- {
- InitializeComponent();
- }
- private void FrmUpdateMemo_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);//当月最后一天
- this.cmbDate.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- this.cmbEndDate.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- EntityHelper.ShowGridCaption<QcmZbsInfoEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQueryJudge();
- break;
- case "Update":
- updateMemo();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 查询质保书数据
- /// </summary>
- private void doQueryJudge()
- {
- string startTim = "";
- string endTim = "";
- string orderNo = "";
- if (this.chkOrderNo.Checked && this.txtOrderNo.Text.Trim() != "")
- {
- orderNo = this.txtOrderNo.Text.Trim();
- }
- if (this.chkDate.Checked)
- {
- if (DateTime.Parse(cmbDate.Value.ToString()) > DateTime.Parse(this.cmbEndDate.Value.ToString()))
- {
- MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- return;
- }
- else
- {
- startTim = this.cmbDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
- endTim = this.cmbEndDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- }
- ArrayList list = new ArrayList();
- list.Add(orderNo);
- List<QcmZbsInfoEntity> listSource = EntityHelper.GetData<QcmZbsInfoEntity>(
- "com.steering.pss.ydm.pipemanage.FrmUpdateMemo.doQueryZbs", new object[] { list, startTim, endTim }, this.ob);
- qcmZbsInfoEntityBindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 修改备注
- /// </summary>
- private void updateMemo()
- {
- this.ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要修改的信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow row in checkMagRows)
- {
- QcmZbsInfoEntity ydmTity = (QcmZbsInfoEntity)row.ListObject;
- string ydmEntity = JSONFormat.Format(ydmTity);
- parmList.Add(ydmEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmUpdateMemo";
- ccp.MethodName = "updateMemo";
- ccp.ServerParams = new object[] { parmList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("修改成功!"))
- {
- doQueryJudge();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private void chkDate_CheckedChanged(object sender, EventArgs e)
- {
- this.cmbDate.Enabled = this.cmbEndDate.Enabled = this.chkDate.Checked;
- }
- private void chkOrderNo_CheckedChanged(object sender, EventArgs e)
- {
- this.txtOrderNo.Enabled = this.chkOrderNo.Checked;
- }
- private void txtMemo_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraTextEditor textEditor = (UltraTextEditor)sender;
- PopupTextBox popupText = new PopupTextBox(textEditor.Text, 4000);
- if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- textEditor.Text = popupText.TextInfo.Trim();
- }
- this.ultraGrid1.ActiveCell.Value = textEditor.Text;
- this.ultraGrid1.ActiveRow.Update();
- }
- }
- }
|