frmBasePl.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. using Core.Mes.Client.Comm.Format;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.PnCost.Models;
  5. using CoreFS.CA06;
  6. using Infragistics.Win.UltraWinGrid;
  7. using System;
  8. using System.Collections;
  9. using System.Collections.Generic;
  10. using System.ComponentModel;
  11. using System.Data;
  12. using System.Drawing;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Windows.Forms;
  16. namespace Core.StlMes.Client.PnCost
  17. {
  18. public partial class frmBasePl : FrmBase
  19. {
  20. #region 定义变量
  21. public frmBasePl()
  22. {
  23. InitializeComponent();
  24. }
  25. private DataTable dtgang;
  26. #endregion
  27. #region 方法
  28. public override void ToolBar_Click(object sender, string ToolbarKey)
  29. {
  30. base.ToolBar_Click(sender, ToolbarKey);
  31. switch (ToolbarKey)
  32. {
  33. case "doSing":
  34. doSing();
  35. break;
  36. case "doSave":
  37. doSave();
  38. break;
  39. case "Close":
  40. this.Close();
  41. break;
  42. }
  43. }
  44. /// <summary>
  45. /// 配料
  46. /// </summary>
  47. private void doSing()
  48. {
  49. this.ucHj1.setHj(this.ucCf1.TqnqD01Entity());
  50. }
  51. /// <summary>
  52. /// 保存
  53. /// </summary>
  54. private void doSave()
  55. {
  56. try
  57. {
  58. TqnqD01Entity cfentity = ucCf1.TqnqD01Entity();
  59. TqnqD01Entity hjentity = ucHj1.TqnqD01Entity();
  60. if (hjentity.OutFeigang.Equals("") || hjentity.OutFeigang == null) return;
  61. if (hjentity.OutTieshui.Equals("") || hjentity.OutTieshui == null) return;
  62. hjentity.RecCreator = this.UserInfo.GetUserName().ToString();
  63. ArrayList parm = new ArrayList();
  64. parm.Add(JSONFormat.Format(cfentity));
  65. parm.Add(JSONFormat.Format(hjentity));
  66. CoreClientParam ccp = new CoreClientParam();
  67. ccp.ServerName = "com.steering.mes.cost.FrmTqnqd01";
  68. ccp.MethodName = "doSave";
  69. ccp.ServerParams = new object[] { parm };
  70. ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  71. if (ccp.ReturnCode != -1)
  72. {
  73. MessageUtil.ShowTips("操作成功");
  74. }
  75. }
  76. catch
  77. {
  78. return;
  79. }
  80. }
  81. /// 查询方法
  82. /// <summary>
  83. /// 查询方法
  84. /// </summary>
  85. private void Query()
  86. {
  87. //#region 条件验证
  88. ////钢种
  89. //string strPei = "";
  90. //if (ultraCheckEditor3.Checked)//钢种是否选择
  91. //{
  92. // if (ultraTextEditor1.Text == "")//钢种是否输入
  93. // {
  94. // MessageUtil.ShowWarning("请输入钢种!");
  95. // return;
  96. // }
  97. // else
  98. // {
  99. // strPei = ultraTextEditor1.Text.Trim();//钢种
  100. // }
  101. //}
  102. //#endregion
  103. //List<ComBaseGradeEntity> data = EntityHelper.GetData<ComBaseGradeEntity>(
  104. // "com.steering.pss.pncost.base.ComBaseGrade.query", new object[] { strPei }, ob);
  105. //comBaseGradeEntityBindingSource.DataSource = data;
  106. //for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  107. //{
  108. // ultraGrid1.Rows[i].Cells["xuanze"].Value = false;
  109. // ultraGrid1.Rows[i].Cells["BATCHINGCODE"].Appearance.BackColor = Color.LightGoldenrodYellow;
  110. //}
  111. //ultraGrid1.UpdateData();
  112. }
  113. /// 保存方法
  114. /// <summary>
  115. /// 保存方法
  116. /// </summary>
  117. private void Save()
  118. {
  119. //string stringnew = "";
  120. //string xuanze = "false";
  121. //try
  122. //{
  123. // #region 验证信息
  124. // ultraGrid1.UpdateData();
  125. // for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  126. // {
  127. // if (ultraGrid1.Rows[i].Cells["xuanze"].Value.ToString() == "True")
  128. // {
  129. // xuanze = "true";
  130. // break;
  131. // }
  132. // }
  133. // if (xuanze == "false")
  134. // {
  135. // MessageUtil.ShowWarning("请选择你要保存的记录!");
  136. // return;
  137. // }
  138. // if (MessageUtil.ShowYesNoAndQuestion("是否确认保存?") == System.Windows.Forms.DialogResult.No)
  139. // {
  140. // return;
  141. // }
  142. // #endregion
  143. // for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  144. // {
  145. // if (ultraGrid1.Rows[i].Cells["xuanze"].Value.ToString() == "True")
  146. // {
  147. // stringnew = ultraGrid1.ActiveRow.Cells["GRADECODE"].Value.ToString2();
  148. // ComBaseGradeEntity parm = new ComBaseGradeEntity();
  149. // parm.Gradecode = ultraGrid1.Rows[i].Cells["GRADECODE"].Value.ToString();
  150. // parm.Gradename = ultraGrid1.Rows[i].Cells["GRADENAME"].Value.ToString();
  151. // parm.BatchingCode = ultraGrid1.Rows[i].Cells["BATCHINGCODE"].Value.ToString();
  152. // string JsonStr = JSONFormat.Format(parm);
  153. // ServerHelper.SetData("com.steering.pss.pncost.base.ComBaseGrade.save", new object[] { JsonStr }, ob);
  154. // }
  155. // }
  156. //}
  157. //catch (Exception ex)
  158. //{
  159. // MessageUtil.ShowError("保存失败!'" + ex.Message + "'");
  160. // return;
  161. //}
  162. //MessageUtil.ShowTips("保存成功!");
  163. //Query();
  164. //for (int i = 0; i < ultraGrid1.Rows.Count; i++)
  165. //{
  166. // if (ultraGrid1.Rows[i].Cells["GRADECODE"].Value.ToString() == stringnew)
  167. // {
  168. // ultraGrid1.Rows[i].Activate();
  169. // }
  170. //}
  171. }
  172. #endregion
  173. #region 事件
  174. /// 钢种选择事件
  175. /// <summary>
  176. /// 钢种选择事件
  177. /// </summary>
  178. private void ultraCheckEditor3_CheckedChanged(object sender, EventArgs e)
  179. {
  180. // ultraTextEditor1.Enabled = this.ultraCheckEditor3.Checked;
  181. }
  182. private void ultraGrid1_CellChange(object sender, CellEventArgs e)
  183. {
  184. // ultraGrid1.UpdateData();
  185. }
  186. #endregion
  187. private void frmBasePl_Load(object sender, EventArgs e)
  188. {
  189. ucCf1.SetBase(this.ob);
  190. ucHj1.SetBase(this.ob);
  191. }
  192. }
  193. }