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.
|
|
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using DevExpress.XtraEditors; using System.Data.SqlClient; using ICSSoft.Frame.Data.BLL; using ICSSoft.Base.Language.Tool; using ICSSoft.Base.UserControl.MessageControl; using ICSSoft.Base.Report.Filter; using ICSSoft.Base.Config.DBHelper; using ICSSoft.Base.UserControl.FormControl; using ICSSoft.Base.ReferForm.AppReferForm; using ICSSoft.Base.Lable.PrintTool; using ICSSoft.Base.Config.AppConfig; using ICSSoft.Base.Report.GridReport; using ICSSoft.Frame.APP.Entity; using ICSSoft.Frame.APP; using ICSSoft.Frame.Data.Entity; using System.Configuration;
namespace ICSSoft.Frame.APP { public partial class FormICSVenDorChoose: DevExpress.XtraEditors.XtraForm { public string Vencode; public string VenName; string VenView= ConfigurationManager.AppSettings["VendorView"]; string EntId = ConfigurationManager.AppSettings["WorkHourEntId"]; string CompanyId = ConfigurationManager.AppSettings["WorkHourCompanyId"]; public FormICSVenDorChoose() { InitializeComponent(); init(); }
private void btnOK_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtVendorCode.Text)) { ICSBaseSimpleCode.AppshowMessageBox("请选择供应商!"); return; } this.Vencode = txtVendorCode.EditValue.ToString(); this.VenName = txtVendorName.Text.ToString();
this.DialogResult = DialogResult.OK; this.Close();
} catch (Exception ex) { MessageBox.Show(ex.Message); } } #region 关闭
private void btnCancle_Click(object sender, EventArgs e) { this.Close(); this.DialogResult = DialogResult.Cancel; }
private void btnClose_Click(object sender, EventArgs e) { this.Close(); this.DialogResult = DialogResult.Cancel; } #endregion
private void gluItemCode_EditValueChanged(object sender, EventArgs e) { var o = txtVendorCode.Properties.GetRowByKeyValue(txtVendorCode.EditValue); if (o is DataRowView) { DataRowView RowView = o as DataRowView; txtVendorName.Text = RowView.Row["供应商名称"].ToString(); }
} #region 初始化查询条件
private void init() { #region 供应商
string sql = "select 交易对象编号 as 供应商编码,交易对象全名 as 供应商名称 from OPENQUERY(ORADJ,'select * from erp_mes_pmaauc_v WHERE 企业编号=''{0}'' AND 营运据点=''{1}''')"; sql = string.Format(sql,EntId,CompanyId); DataTable dt = DBHelper.ExecuteDataset(AppConfig.AppConnectString.ToString(), CommandType.Text, sql).Tables[0]; txtVendorCode.Properties.ValueMember = "供应商编码"; txtVendorCode.Properties.DisplayMember = "供应商编码"; txtVendorCode.Properties.DataSource = dt; txtVendorCode.Properties.NullText = "";//空时的值
txtVendorCode.Properties.ImmediatePopup = true;//输入值是否马上弹出窗体
txtVendorCode.Properties.ValidateOnEnterKey = true;//回车确认
txtVendorCode.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;//要使用户可以输入,这里须设为Standard
txtVendorCode.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True; //可用Ctrl + Delete清空选择內容
//自适应宽度
txtVendorCode.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup; #endregion
} #endregion
} }
|