FrmPurTitle.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;using Pur.Entity;
  10. using Pur.Entity.configureEntity;
  11. using Infragistics.Win;
  12. using Infragistics.Win.UltraWinGrid;
  13. using Core.Mes.Client.Comm.Control;
  14. using Core.Mes.Client.Comm;
  15. using com.hnshituo.pur.vo;
  16. using Pur.Entity;
  17. namespace Pur.configure
  18. {
  19. public partial class FrmPurTitle : FrmPmsBase
  20. {
  21. public FrmPurTitle()
  22. {
  23. InitializeComponent();
  24. }
  25. //菜单按钮事件
  26. public override void ToolBar_Click(object sender, string ToolbarKey)
  27. {
  28. switch (ToolbarKey)
  29. {
  30. case "Query":
  31. GetPUR_TITLE();
  32. break;
  33. case "Add":
  34. AddPUR_TITLE();
  35. break;
  36. case "Update":
  37. UpdPUR_TITLE();
  38. break;
  39. case "Delete":
  40. DelPUR_TITLE();
  41. break;
  42. }
  43. }
  44. private void DelPUR_TITLE()
  45. {
  46. Title Ti = new Title();
  47. Ti.Id = txt_id.Text;
  48. Ti.Validflag = "0";
  49. Ti.DeleteName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
  50. Ti.DeleteUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
  51. Ti.DeleteTime = DateTime.Now;
  52. CoreResult rt = this.execute<CoreResult>("com.hnshituo.pur.configure.service.TitleService", "doUpdate", new object[] { Ti });
  53. if (rt.Resultcode != 0)
  54. {
  55. Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("删除失败!" + rt.Resultmsg);
  56. return;
  57. }
  58. Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("删除成功!");
  59. GetPUR_TITLE();
  60. }
  61. private void UpdPUR_TITLE()
  62. {
  63. Title Ti = new Title();
  64. Ti.UpdateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
  65. Ti.UpdateTime = DateTime.Now;
  66. Ti.UpdateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
  67. Ti.OrgId = txt_OrgId.Text;
  68. Ti.OrgName = txt_OrgName.Text;
  69. Ti.Remark = txt_Remark.Text;
  70. Ti.TitleAddr = txt_TitleAddr.Text;
  71. Ti.TitleBankAccount = txt_TitleBankAccount.Text;
  72. Ti.TitleBankName = txt_TitleBankName.Text;
  73. Ti.TitleContactFax = txt_TitleContactFax.Text;
  74. Ti.TitleContactTel = txt_TitleContactTel.Text;
  75. Ti.TitleLinkMan = txt_TitleLinkMan.Text;
  76. Ti.TitleName = txt_TitleName.Text;
  77. Ti.TitlePostal = txt_TitlePostal.Text;
  78. Ti.TitleTaxId = txt_TitleTaxId.Text;
  79. Ti.Id = txt_id.Text;
  80. CoreResult rt = this.execute<CoreResult>("com.hnshituo.pur.configure.service.TitleService", "doUpdate", new object[] { Ti });
  81. if (rt.Resultcode != 0)
  82. {
  83. Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("修改失败!" + rt.Resultmsg);
  84. return;
  85. }
  86. Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("修改成功!");
  87. GetPUR_TITLE();
  88. }
  89. private void AddPUR_TITLE()
  90. {
  91. Title Ti = new Title();
  92. Ti.CreateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
  93. Ti.CreateTime = DateTime.Now;
  94. Ti.CreateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
  95. Ti.OrgId = txt_OrgId.Text;
  96. Ti.OrgName = txt_OrgName.Text;
  97. Ti.Remark = txt_Remark.Text;
  98. Ti.TitleAddr = txt_TitleAddr.Text;
  99. Ti.TitleBankAccount = txt_TitleBankAccount.Text;
  100. Ti.TitleBankName = txt_TitleBankName.Text;
  101. Ti.TitleContactFax = txt_TitleContactFax.Text;
  102. Ti.TitleContactTel = txt_TitleContactTel.Text;
  103. Ti.TitleLinkMan = txt_TitleLinkMan.Text;
  104. Ti.TitleName = txt_TitleName.Text;
  105. Ti.TitlePostal = txt_TitlePostal.Text;
  106. Ti.TitleTaxId = txt_TitleTaxId.Text;
  107. Ti.Validflag = "1";
  108. // Ti.Id = txt_id.Text;
  109. CoreResult rt = this.execute<CoreResult>("com.hnshituo.pur.configure.service.TitleService", "insert_Title", new object[] { Ti });
  110. if (rt.Resultcode != 0)
  111. {
  112. Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("新增失败!"+rt.Resultmsg);
  113. return;
  114. }
  115. Core.Mes.Client.Comm.Tool.MessageUtil.ShowTips("新增成功!");
  116. GetPUR_TITLE();
  117. }
  118. /// <summary>
  119. /// 查询
  120. /// </summary>
  121. private void GetPUR_TITLE()
  122. {
  123. Title Ti = new Title();
  124. Ti.Validflag = "1";
  125. Ti.Id = COPID.Text;
  126. Ti.TitleName = COPName.Text;
  127. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.configure.service.TitleService", "find", new object[] { Ti, 0, 0 });
  128. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  129. GridHelper.RefreshAndAutoSize(ultraGrid1);
  130. }
  131. //private void txt_OrgId_MouseClick(object sender, MouseEventArgs e)
  132. //{
  133. // frmdepartment fdt = new frmdepartment(ob);
  134. // fdt.StartPosition = FormStartPosition.Manual;
  135. // fdt.Location = new Point(Cursor.Position.X, Cursor.Position.Y - fdt.Height);
  136. // fdt.ShowDialog();
  137. // if (fdt.BuyerUnitDesc == null)
  138. // return;
  139. // txt_OrgName.Text = fdt.BuyerUnitDesc;
  140. // txt_OrgId.Text = fdt.BuyerUnitCode;
  141. //}
  142. /// <summary>
  143. /// 点击行事件
  144. /// </summary>
  145. /// <param name="sender"></param>
  146. /// <param name="e"></param>
  147. private void ultraGrid1_ClickCell(object sender, ClickCellEventArgs e)
  148. {
  149. UltraGridRow uge = ultraGrid1.ActiveRow;
  150. Title Ti = this.execute<Title>("com.hnshituo.pur.configure.service.TitleService", "findById", new object[] { uge.Cells["id"].Value.ToString() });
  151. txt_OrgId.Text = Ti.OrgId;
  152. txt_OrgName.Text = Ti.OrgName;
  153. txt_Remark.Text = Ti.Remark;
  154. txt_TitleAddr.Text = Ti.TitleAddr;
  155. txt_TitleBankAccount.Text = Ti.TitleBankAccount;
  156. txt_TitleBankName.Text = Ti.TitleBankName;
  157. txt_TitleContactFax.Text = Ti.TitleContactFax;
  158. txt_TitleContactTel.Text = Ti.TitleContactTel;
  159. txt_TitleLinkMan.Text = Ti.TitleLinkMan;
  160. txt_TitleName.Text = Ti.TitleName;
  161. txt_TitlePostal.Text = Ti.TitlePostal;
  162. txt_TitleTaxId.Text = Ti.TitleTaxId;
  163. txt_id.Text = Ti.Id;
  164. }
  165. private void FrmPurTitle_Load(object sender, EventArgs e)
  166. {
  167. GetPUR_TITLE();
  168. }
  169. /// <summary>
  170. /// 机构弹窗
  171. /// </summary>
  172. /// <param name="sender"></param>
  173. /// <param name="e"></param>
  174. private void txt_OrgId_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  175. {
  176. frmdepartment fdt = new frmdepartment(ob);
  177. fdt.StartPosition = FormStartPosition.Manual;
  178. fdt.Location = new Point(Cursor.Position.X, Cursor.Position.Y - fdt.Height);
  179. fdt.ShowDialog();
  180. if (fdt.BuyerUnitDesc == null)
  181. return;
  182. txt_OrgName.Text = fdt.BuyerUnitDesc;
  183. txt_OrgId.Text = fdt.BuyerUnitCode;
  184. }
  185. private void ultraGroupBox1_Click(object sender, EventArgs e)
  186. {
  187. }
  188. }
  189. }