北京安通林JIS系统
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.

141 lines
4.6 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Stone.Common;
using Stone.WinBiz.BasicData;
namespace Stone.WinModule.BasicData
{
public partial class frmLocationDetail : Stone.WinModule.BasicData.frmBaseMainDetail
{
public frmLocationDetail()
{
InitializeComponent();
DataTable dtPartType = new DataTable();
dtPartType.Columns.Add("Name");
DataRow drPartType = dtPartType.NewRow();
drPartType["Name"] = "ǰ��";
dtPartType.Rows.Add(drPartType);
drPartType = dtPartType.NewRow();
drPartType["Name"] = "����";
dtPartType.Rows.Add(drPartType);
this.txtPartType.DataSource = dtPartType;
this.txtPartType.ValueMember = "Name";
this.txtPartType.DisplayMember = "Name";
DataTable dtLocationType = new DataTable();
dtLocationType.Columns.Add("Name");
DataRow drLocationType = dtLocationType.NewRow();
drLocationType["Name"] = "����";
dtLocationType.Rows.Add(drLocationType);
drLocationType = dtLocationType.NewRow();
drLocationType["Name"] = "����";
dtLocationType.Rows.Add(drLocationType);
this.txtLocationType.DataSource = dtLocationType;
this.txtLocationType.DisplayMember = "Name";
this.txtLocationType.ValueMember = "Name";
DataTable dtEnabled = new DataTable();
dtEnabled.Columns.Add("Name");
DataRow drEnabled = dtEnabled.NewRow();
drEnabled["Name"] = "����";
dtEnabled.Rows.Add(drEnabled);
drEnabled = dtEnabled.NewRow();
drEnabled["Name"] = "����";
dtEnabled.Rows.Add(drEnabled);
this.txtEnabled.DataSource = dtEnabled;
this.txtEnabled.ValueMember = "Name";
this.txtEnabled.DisplayMember = "Name";
DataTable dtAssyType = new DataTable();
dtAssyType.Columns.Add("Name");
DataRow drAssyType = dtAssyType.NewRow();
drAssyType["Name"] = "��װ";
dtAssyType.Rows.Add(drAssyType);
drAssyType = dtAssyType.NewRow();
drAssyType["Name"] = "��װ";
dtAssyType.Rows.Add(drAssyType);
this.txtAssyType.DataSource = dtAssyType;
this.txtAssyType.ValueMember = "Name";
this.txtAssyType.DisplayMember = "Name";
}
private void frmLocationDetail_Load(object sender, EventArgs e)
{
}
public override bool GetData()
{
if (!MyValidator.IsEmpty(this.txtCode, "")) return false;
if (!MyValidator.IsEmpty(this.txtName, "")) return false;
base.GetData();
drData["Code"] = MyStrings.GetString(this.txtCode.Text.Trim());
drData["Name"] = MyStrings.GetString(this.txtName.Text.Trim());
drData["LightAddress"] = this.txtLightAddress.Text.Trim();
drData["PartType"] = this.txtPartType.SelectedValue.ToString();
drData["COM"] = this.txtCOM.Text.Trim();
drData["LocationType"] = this.txtLocationType.SelectedValue.ToString();
drData["Enabled"] = this.txtEnabled.SelectedValue.ToString();
drData["AssyType"] = this.txtAssyType.SelectedValue.ToString();
drData["PreAssyType"] = this.chkPreAssyType.Checked;
return true;
}
public override bool SetData()
{
//this.txtCode.ReadOnly = true;
if (base.SetData())
{
this.txtCode.Text = drData["Code"].ToString();
this.txtName.Text = drData["Name"].ToString();
this.txtLightAddress.Text = drData["LightAddress"].ToString();
this.txtPartType.SelectedValue = drData["PartType"].ToString();
this.txtCOM.Text = drData["COM"].ToString();
this.txtLocationType.SelectedValue = drData["LocationType"].ToString();
this.txtEnabled.SelectedValue = drData["Enabled"].ToString();
this.txtAssyType.SelectedValue = drData["AssyType"].ToString();
this.chkPreAssyType.Checked = Convert.ToBoolean(drData["PreAssyType"]);
}
return false;
}
public override void Clear()
{
base.Clear();
this.txtCode.Text = "";
this.txtName.Text = "";
this.txtCode.Focus();
}
}
}