华恒Mes鼎捷代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.7 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using DevExpress.XtraEditors;
  9. using System.Data.SqlClient;
  10. using ICSSoft.Frame.Data.BLL;
  11. using ICSSoft.Base.Language.Tool;
  12. using ICSSoft.Base.UserControl.MessageControl;
  13. using ICSSoft.Base.Report.Filter;
  14. using ICSSoft.Base.Config.DBHelper;
  15. using ICSSoft.Base.UserControl.FormControl;
  16. using ICSSoft.Base.ReferForm.AppReferForm;
  17. using ICSSoft.Base.Lable.PrintTool;
  18. using ICSSoft.Base.Config.AppConfig;
  19. using ICSSoft.Base.Report.GridReport;
  20. using ICSSoft.Frame.APP.Entity;
  21. using ICSSoft.Frame.APP;
  22. namespace ICSSoft.Frame.APP
  23. {
  24. public partial class FormICSERPVendor : DevExpress.XtraEditors.XtraForm
  25. {
  26. FormICSEQPSTPUIModelNew EQPSTPUIModel;
  27. int flag;
  28. string eqpstpid;
  29. public string vencode;
  30. public FormICSERPVendor()
  31. {
  32. InitializeComponent();
  33. init();
  34. flag = 0;
  35. eqpstpid = AppConfig.GetGuid();
  36. }
  37. public FormICSERPVendor(string id)
  38. {
  39. InitializeComponent();
  40. init();
  41. flag = 1;
  42. eqpstpid = id;
  43. }
  44. private void btnOK_Click(object sender, EventArgs e)
  45. {
  46. try
  47. {
  48. if (Vendorcode.Text == "") {
  49. ICSBaseSimpleCode.AppshowMessageBox("请先选择供应商编码!");
  50. return;
  51. }
  52. this.vencode = Vendorcode.Text;
  53. this.DialogResult = DialogResult.OK;
  54. }
  55. catch (Exception ex) {
  56. MessageBox.Show(ex.Message);
  57. }
  58. }
  59. #region 关闭
  60. private void btnCancle_Click(object sender, EventArgs e)
  61. {
  62. this.Close();
  63. this.DialogResult = DialogResult.Cancel;
  64. }
  65. private void btnClose_Click(object sender, EventArgs e)
  66. {
  67. this.Close();
  68. this.DialogResult = DialogResult.Cancel;
  69. }
  70. #endregion
  71. private void gluItemCode_EditValueChanged(object sender, EventArgs e)
  72. {
  73. var o = Vendorcode.Properties.GetRowByKeyValue(Vendorcode.EditValue);
  74. if (o is DataRowView)
  75. {
  76. DataRowView RowView = o as DataRowView;
  77. vendorname.Text = RowView.Row["供应商名称"].ToString();
  78. }
  79. }
  80. #region 初始化查询条件
  81. private void init()
  82. {
  83. #region 存货编码
  84. string sql = "select distinct cVenCode as 供应商编码,cVenName as 供应商名称 from Vendor";
  85. DataTable dt = DBHelper.ExecuteDataset(AppConfig.GetDataBaseConnectStringByKey("[DB.ERP]"), CommandType.Text, sql).Tables[0];
  86. Vendorcode.Properties.ValueMember = "供应商编码";
  87. Vendorcode.Properties.DisplayMember = "供应商编码";
  88. Vendorcode.Properties.DataSource = dt;
  89. Vendorcode.Properties.NullText = "";//空时的值
  90. Vendorcode.Properties.ImmediatePopup = true;//输入值是否马上弹出窗体
  91. Vendorcode.Properties.ValidateOnEnterKey = true;//回车确认
  92. Vendorcode.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;//要使用户可以输入,这里须设为Standard
  93. Vendorcode.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; //可用Ctrl + Delete清空选择內容
  94. //自适应宽度
  95. Vendorcode.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
  96. #endregion
  97. }
  98. #endregion
  99. }
  100. }