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.
52 lines
1.6 KiB
52 lines
1.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using System.Data;
|
|
using Stone.Entity;
|
|
using Gm_WMS.DataAccess.DataService;
|
|
|
|
namespace Stone.WinBiz.BasicData
|
|
{
|
|
public class F_Station : F_Base
|
|
{
|
|
public F_Station()
|
|
{
|
|
this.type = "Station";
|
|
this.name = "基础资料_装配工位";
|
|
this.entity = new Entity_t_AssyStation();
|
|
}
|
|
|
|
public override void GetView(DataGridView dgv)
|
|
{
|
|
base.GetView(dgv);
|
|
|
|
dgv.Columns["Code"].HeaderText = "代码";
|
|
dgv.Columns["Name"].HeaderText = "名称";
|
|
dgv.Columns["Sort"].HeaderText = "顺序";
|
|
}
|
|
|
|
public override void InputData(DataSet dsData, LocalDBService db)
|
|
{
|
|
Entity_t_AssyStation t_Input = new Entity_t_AssyStation(db);
|
|
DataRow drInput = null;
|
|
|
|
foreach (DataRow drData in dsData.Tables[0].Rows)
|
|
{
|
|
drInput = t_Input.Table.NewRow();
|
|
drInput["Code"] = drData["代码"].ToString().Trim();
|
|
drInput["Name"] = drData["名称"].ToString().Trim();
|
|
drInput["Sort"] = drData["顺序"].ToString().Trim();
|
|
|
|
if (drInput["Code"].ToString().Trim() == "")
|
|
throw new Exception("代码不能为空!");
|
|
|
|
if (t_Input.GetData("", "Code='" + drInput["Code"].ToString() + "'", "id asc").Tables[0].Rows.Count > 0)
|
|
throw new Exception("代码 " + drInput["Code"].ToString() + " 已经存在!");
|
|
|
|
t_Input.Add(drInput);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|