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.
233 lines
7.2 KiB
233 lines
7.2 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;
|
|
using Stone.Entity;
|
|
|
|
namespace Stone.WinModule.BasicData
|
|
{
|
|
public partial class frmProductDetail : Stone.WinModule.BasicData.frmBaseMainDetail
|
|
{
|
|
public frmProductDetail()
|
|
{
|
|
InitializeComponent();
|
|
try
|
|
{
|
|
Entity_t_ProductType t_ProductType = new Entity_t_ProductType();
|
|
this.txtTypeCode.DataSource = t_ProductType.GetData().Tables[0];
|
|
this.txtTypeCode.DisplayMember = "Name";
|
|
this.txtTypeCode.ValueMember = "Code";
|
|
|
|
|
|
DataTable dtAssyType = new DataTable();
|
|
dtAssyType.Columns.Add("Name");
|
|
|
|
DataRow drAssyType;
|
|
|
|
drAssyType = dtAssyType.NewRow();
|
|
drAssyType["Name"] = "";
|
|
dtAssyType.Rows.Add(drAssyType);
|
|
|
|
drAssyType = dtAssyType.NewRow();
|
|
drAssyType["Name"] = "ÄÚ×°";
|
|
dtAssyType.Rows.Add(drAssyType);
|
|
|
|
drAssyType = dtAssyType.NewRow();
|
|
drAssyType["Name"] = "Íâ×°";
|
|
dtAssyType.Rows.Add(drAssyType);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void frmProductDetail_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
#region »ù´¡×ÊÁÏÑ¡Ôñ
|
|
private void txtUnitCode_OnSelectClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
frmUnit frm = new frmUnit();
|
|
frm.m_Base = new F_Unit();
|
|
frm.init();
|
|
|
|
if (frm.ShowSelect(this.txtUnitCode.Text) == DialogResult.OK)
|
|
{
|
|
this.txtUnitCode.Text = frm.SelectValue;
|
|
this.txtUnitCode.Focus();
|
|
this.txtUnitCode.SelectAll();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
|
}
|
|
}
|
|
|
|
private void txtColorCode_OnSelectClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
frmColor frm = new frmColor();
|
|
frm.m_Base = new F_Color();
|
|
frm.init();
|
|
|
|
if (frm.ShowSelect(this.txtColorCode.Text) == DialogResult.OK)
|
|
{
|
|
this.txtColorCode.Text = frm.SelectValue;
|
|
this.txtColorCode.Focus();
|
|
this.txtColorCode.SelectAll();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
|
}
|
|
}
|
|
|
|
private void txtCarModelCode_OnSelectClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
frmCarModel frm = new frmCarModel();
|
|
frm.m_Base = new F_CarModel();
|
|
frm.init();
|
|
|
|
if (frm.ShowSelect(this.txtCarModelCode.Text) == DialogResult.OK)
|
|
{
|
|
this.txtCarModelCode.Text = frm.SelectValue;
|
|
this.txtCarModelCode.Focus();
|
|
this.txtCarModelCode.SelectAll();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
|
}
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
public override bool GetData()
|
|
{
|
|
if (this.txtTypeCode.SelectedValue == null)
|
|
{
|
|
MyMessageBox.ShowErrorMessage("ÇëÑ¡Ôñ´æ»õ·ÖÀà!");
|
|
return false;
|
|
}
|
|
|
|
|
|
if (!MyValidator.IsEmpty(this.txtCode, "´æ»õ´úÂë")) return false;
|
|
if (!MyValidator.IsEmpty(this.txtName, "´æ»õÃû³Æ")) return false;
|
|
if (!MyValidator.IsEmpty(this.txtUnitCode, "µ¥Î»")) return false;
|
|
if (!MyValidator.IsEmpty(this.txtCarModelCode, "³µÐÍ")) return false;
|
|
if (!MyValidator.IsEmpty(this.txtColorCode, "ÑÕÉ«")) return false;
|
|
|
|
|
|
base.GetData();
|
|
|
|
drData["TypeCode"] = this.txtTypeCode.SelectedValue.ToString();
|
|
drData["Code"] = MyStrings.GetString(this.txtCode.Text.Trim());
|
|
drData["Name"] = MyStrings.GetString(this.txtName.Text.Trim());
|
|
drData["Model"] = MyStrings.GetString(this.txtModel.Text.Trim());
|
|
drData["UnitCode"] = MyStrings.GetString(this.txtUnitCode.Text.Trim());
|
|
drData["CarModelCode"] = MyStrings.GetString(this.txtCarModelCode.Text.Trim());
|
|
drData["ColorCode"] = MyStrings.GetString(this.txtColorCode.Text.Trim());
|
|
drData["Deploy"] = MyStrings.GetString(this.txtDeploy.Text.Trim());
|
|
drData["LocationCode"] = this.txtLocationCode.Text.Trim();
|
|
drData["Exclude"] = this.txtExclude.Text.Trim();
|
|
drData["TubeSensor"] = this.txtTubeSensor.Text.Trim();
|
|
|
|
return true;
|
|
}
|
|
|
|
public override bool SetData()
|
|
{
|
|
|
|
if (base.SetData())
|
|
{
|
|
this.txtTypeCode.SelectedValue = drData["TypeCode"].ToString();
|
|
this.txtCode.Text = drData["Code"].ToString();
|
|
this.txtName.Text = drData["Name"].ToString();
|
|
this.txtModel.Text = drData["Model"].ToString();
|
|
this.txtUnitCode.Text = drData["UnitCode"].ToString();
|
|
this.txtCarModelCode.Text = drData["CarModelCode"].ToString();
|
|
this.txtColorCode.Text = drData["ColorCode"].ToString();
|
|
this.txtDeploy.Text = drData["Deploy"].ToString();
|
|
this.txtLocationCode.Text = drData["LocationCode"].ToString();
|
|
this.txtExclude.Text = drData["Exclude"].ToString();
|
|
this.txtTubeSensor.Text = drData["TubeSensor"].ToString();
|
|
|
|
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public override void Clear()
|
|
{
|
|
base.Clear();
|
|
this.txtCode.Text = "";
|
|
this.txtName.Text = "";
|
|
this.txtModel.Text = "";
|
|
this.txtUnitCode.Text = "";
|
|
this.txtCarModelCode.Text = "";
|
|
this.txtColorCode.Text = "";
|
|
|
|
|
|
|
|
this.txtCode.Focus();
|
|
}
|
|
|
|
private void txtStockAreaCode_OnSelectClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void txtLocationCode_OnSelectClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
frmLocation frm = new frmLocation();
|
|
frm.m_Base = new Stone.WinBiz.BasicData.F_Location();
|
|
frm.init();
|
|
if (frm.ShowSelect("") == DialogResult.OK)
|
|
{
|
|
this.txtLocationCode.Text = frm.SelectValue;
|
|
}
|
|
frm.Dispose();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|