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_JIS_Limits : F_Base { public F_JIS_Limits() { this.type = "JIS_Limits"; this.name = "基础资料_校验清单"; this.entity = new Entity_t_JIS_Limits(); this.entityView = new Entity_v_JIS_Limits(); } public override void GetView(DataGridView dgv) { base.GetView(dgv); dgv.Columns["PartsFamily"].HeaderText = "零件类"; dgv.Columns["supplyGroup"].HeaderText = "供应组"; dgv.Columns["partNumber"].HeaderText = "零件号"; dgv.Columns["Name"].HeaderText = "零件名称"; } public override void Checking(DataRow drData, bool isNew) { } public override void InputData(DataSet dsData, LocalDBService db) { Entity_t_JIS_Limits t_Input = new Entity_t_JIS_Limits(db); DataRow drInput = null; foreach (DataRow drData in dsData.Tables[0].Rows) { drInput = t_Input.Table.NewRow(); drInput["PartsFamily"] = drData["零件类"].ToString().Trim(); drInput["supplyGroup"] = drData["供应组"].ToString().Trim(); drInput["partNumber"] = drData["零件号"].ToString().Trim(); if (new Entity_t_PartsFamily(db).GetData("", "Code='" + drInput["PartsFamily"].ToString() + "'", "id asc").Tables[0].Rows.Count == 0) throw new Exception("PartsFamily " + drInput["PartsFamily"].ToString() + " 在系统中不存在"); if (new Entity_t_SupplyGroup(db).GetData("", "Code='" + drInput["supplyGroup"].ToString() + "'", "id asc").Tables[0].Rows.Count == 0) throw new Exception("supplyGroup " + drInput["supplyGroup"].ToString() + " 在系统中不存在"); if (new Entity_t_Product(db).GetData("", "Code='" + drInput["partNumber"].ToString() + "'", "id asc").Tables[0].Rows.Count == 0) throw new Exception("partNumber " + drInput["partNumber"].ToString() + " 在系统中不存在"); //Checking(drInput, true); t_Input.Add(drInput); } } } }