using Stone.Common; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Stone.WinModule.BasicData { public partial class frmModunoABaseDetail : Stone.WinModule.BasicData.frmBaseMainDetail { public frmModunoABaseDetail() { InitializeComponent(); DataTable dtCharacter = new DataTable(); dtCharacter.Columns.Add("Name"); DataRow drCharacter = dtCharacter.NewRow(); drCharacter["Name"] = "门板"; dtCharacter.Rows.Add(drCharacter); drCharacter = dtCharacter.NewRow(); drCharacter["Name"] = "地毯"; dtCharacter.Rows.Add(drCharacter); this.txtCharacter.DataSource = dtCharacter; this.txtCharacter.ValueMember = "Name"; this.txtCharacter.DisplayMember = "Name"; } private void frmModunoABaseDetail_Load(object sender, EventArgs e) { } public override bool GetData() { if (!MyValidator.IsEmpty(this.txtModuno, "")) return false; if (!MyValidator.IsEmpty(this.txtCartype, "")) return false; if (!MyValidator.IsEmpty(this.txtFL, "")) return false; if (!MyValidator.IsNumeric(this.txtFL, "")) return false; if (!MyValidator.IsEmpty(this.txtFR, "")) return false; if (!MyValidator.IsNumeric(this.txtFR, "")) return false; if (!MyValidator.IsEmpty(this.txtRL, "")) return false; if (!MyValidator.IsNumeric(this.txtRL, "")) return false; if (!MyValidator.IsEmpty(this.txtRR, "")) return false; if (!MyValidator.IsNumeric(this.txtRR, "")) return false; if(this.txtCharacter.SelectedValue == null) { this.txtCharacter.Focus(); throw new Exception("请选择门板还是地毯"); } base.GetData(); drData["Moduno"] = MyStrings.GetString(this.txtModuno.Text.Trim()); drData["Cartype"] = MyStrings.GetString(this.txtCartype.Text.Trim()); drData["FL"] = MyStrings.GetString(this.txtFL.Text.Trim()); drData["FR"] = MyStrings.GetString(this.txtFR.Text.Trim()); drData["RL"] = MyStrings.GetString(this.txtRL.Text.Trim()); drData["RR"] = MyStrings.GetString(this.txtRR.Text.Trim()); drData["Character"] = MyStrings.GetString(this.txtCharacter.SelectedValue.ToString()); drData["Qlevel"] = MyStrings.GetString(this.txtQlevel.Text.Trim()); drData["Description"] = MyStrings.GetString(this.txtDescription.Text.Trim()); drData["Voided"] = this.txtVoided.Checked; drData["sysdtm"] = MyDateTime.GetServerDateTime(); drData["Prodno"] = MyStrings.GetString(this.txtProdno.Text.Trim()); return true; } public override bool SetData() { if (base.SetData()) { this.txtModuno.Text = drData["Moduno"].ToString(); this.txtCartype.Text = drData["Cartype"].ToString(); this.txtFL.Text = drData["FL"].ToString(); this.txtFR.Text = drData["FR"].ToString(); this.txtRL.Text = drData["RL"].ToString(); this.txtRR.Text = drData["RR"].ToString(); this.txtCharacter.SelectedValue = drData["Character"].ToString(); this.txtQlevel.Text = drData["Qlevel"].ToString(); this.txtDescription.Text = drData["Description"].ToString(); this.txtVoided.Checked = Convert.ToBoolean(drData["Voided"]); this.txtProdno.Text = drData["Prodno"].ToString(); } return false; } public override void Clear() { base.Clear(); this.txtModuno.Text = ""; this.txtCartype.Text = ""; this.txtFL.Text = ""; this.txtFR.Text = ""; this.txtRL.Text = ""; this.txtRR.Text = ""; this.txtCharacter.SelectedValue = ""; this.txtQlevel.Text = ""; this.txtDescription.Text = ""; this.txtVoided.Checked = false; this.txtProdno.Text = ""; this.txtModuno.Focus(); } } }