| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.PnCost.Models;
- 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.PnCost
- {
- public partial class frmBasePl : FrmBase
- {
- #region 定义变量
- public frmBasePl()
- {
- InitializeComponent();
- }
- private DataTable dtgang;
- #endregion
- #region 方法
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "doSing":
- doSing();
- break;
- case "doSave":
- doSave();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 配料
- /// </summary>
- private void doSing()
- {
- this.ucHj1.setHj(this.ucCf1.TqnqD01Entity());
- }
- /// <summary>
- /// 保存
- /// </summary>
- private void doSave()
- {
- try
- {
- TqnqD01Entity cfentity = ucCf1.TqnqD01Entity();
- TqnqD01Entity hjentity = ucHj1.TqnqD01Entity();
- if (hjentity.OutFeigang.Equals("") || hjentity.OutFeigang == null) return;
- if (hjentity.OutTieshui.Equals("") || hjentity.OutTieshui == null) return;
- hjentity.RecCreator = this.UserInfo.GetUserName().ToString();
- ArrayList parm = new ArrayList();
- parm.Add(JSONFormat.Format(cfentity));
- parm.Add(JSONFormat.Format(hjentity));
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.mes.cost.FrmTqnqd01";
- ccp.MethodName = "doSave";
- ccp.ServerParams = new object[] { parm };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- MessageUtil.ShowTips("操作成功");
- }
- }
- catch
- {
- return;
- }
-
- }
- /// 查询方法
- /// <summary>
- /// 查询方法
- /// </summary>
- private void Query()
- {
- //#region 条件验证
- ////钢种
- //string strPei = "";
- //if (ultraCheckEditor3.Checked)//钢种是否选择
- //{
- // if (ultraTextEditor1.Text == "")//钢种是否输入
- // {
- // MessageUtil.ShowWarning("请输入钢种!");
- // return;
- // }
- // else
- // {
- // strPei = ultraTextEditor1.Text.Trim();//钢种
- // }
- //}
- //#endregion
- //List<ComBaseGradeEntity> data = EntityHelper.GetData<ComBaseGradeEntity>(
- // "com.steering.pss.pncost.base.ComBaseGrade.query", new object[] { strPei }, ob);
- //comBaseGradeEntityBindingSource.DataSource = data;
- //for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- //{
- // ultraGrid1.Rows[i].Cells["xuanze"].Value = false;
- // ultraGrid1.Rows[i].Cells["BATCHINGCODE"].Appearance.BackColor = Color.LightGoldenrodYellow;
- //}
- //ultraGrid1.UpdateData();
- }
- /// 保存方法
- /// <summary>
- /// 保存方法
- /// </summary>
- private void Save()
- {
- //string stringnew = "";
- //string xuanze = "false";
- //try
- //{
- // #region 验证信息
- // ultraGrid1.UpdateData();
- // for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- // {
- // if (ultraGrid1.Rows[i].Cells["xuanze"].Value.ToString() == "True")
- // {
- // xuanze = "true";
- // break;
- // }
- // }
- // if (xuanze == "false")
- // {
- // MessageUtil.ShowWarning("请选择你要保存的记录!");
- // return;
- // }
- // if (MessageUtil.ShowYesNoAndQuestion("是否确认保存?") == System.Windows.Forms.DialogResult.No)
- // {
- // return;
- // }
- // #endregion
- // for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- // {
- // if (ultraGrid1.Rows[i].Cells["xuanze"].Value.ToString() == "True")
- // {
- // stringnew = ultraGrid1.ActiveRow.Cells["GRADECODE"].Value.ToString2();
- // ComBaseGradeEntity parm = new ComBaseGradeEntity();
- // parm.Gradecode = ultraGrid1.Rows[i].Cells["GRADECODE"].Value.ToString();
- // parm.Gradename = ultraGrid1.Rows[i].Cells["GRADENAME"].Value.ToString();
- // parm.BatchingCode = ultraGrid1.Rows[i].Cells["BATCHINGCODE"].Value.ToString();
- // string JsonStr = JSONFormat.Format(parm);
- // ServerHelper.SetData("com.steering.pss.pncost.base.ComBaseGrade.save", new object[] { JsonStr }, ob);
- // }
- // }
- //}
- //catch (Exception ex)
- //{
- // MessageUtil.ShowError("保存失败!'" + ex.Message + "'");
- // return;
- //}
- //MessageUtil.ShowTips("保存成功!");
- //Query();
- //for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- //{
- // if (ultraGrid1.Rows[i].Cells["GRADECODE"].Value.ToString() == stringnew)
- // {
- // ultraGrid1.Rows[i].Activate();
- // }
- //}
- }
- #endregion
- #region 事件
- /// 钢种选择事件
- /// <summary>
- /// 钢种选择事件
- /// </summary>
- private void ultraCheckEditor3_CheckedChanged(object sender, EventArgs e)
- {
- // ultraTextEditor1.Enabled = this.ultraCheckEditor3.Checked;
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- // ultraGrid1.UpdateData();
- }
- #endregion
- private void frmBasePl_Load(object sender, EventArgs e)
- {
- ucCf1.SetBase(this.ob);
- ucHj1.SetBase(this.ob);
- }
- }
- }
|