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.
140 lines
4.6 KiB
140 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();
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|