/// <summary> /// 增加一条数据 /// </summary> public decimal Add(Maticsoft.Model.FixtureInfo model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Maticsoft.Model.FixtureInfo model) { return(dal.Update(model)); }
/// <summary> /// 获得数据列表 /// </summary> public List <Maticsoft.Model.FixtureInfo> DataTableToList(DataTable dt) { List <Maticsoft.Model.FixtureInfo> modelList = new List <Maticsoft.Model.FixtureInfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Maticsoft.Model.FixtureInfo model; for (int n = 0; n < rowsCount; n++) { model = new Maticsoft.Model.FixtureInfo(); if (dt.Rows[n]["FAY_ID"] != null && dt.Rows[n]["FAY_ID"].ToString() != "") { model.FAY_ID = decimal.Parse(dt.Rows[n]["FAY_ID"].ToString()); } if (dt.Rows[n]["Assembly_BarCode"] != null && dt.Rows[n]["Assembly_BarCode"].ToString() != "") { model.Assembly_BarCode = dt.Rows[n]["Assembly_BarCode"].ToString(); } if (dt.Rows[n]["Assembly_Name"] != null && dt.Rows[n]["Assembly_Name"].ToString() != "") { model.Assembly_Name = dt.Rows[n]["Assembly_Name"].ToString(); } if (dt.Rows[n]["BarCode"] != null && dt.Rows[n]["BarCode"].ToString() != "") { model.BarCode = dt.Rows[n]["BarCode"].ToString(); } if (dt.Rows[n]["Name"] != null && dt.Rows[n]["Name"].ToString() != "") { model.Name = dt.Rows[n]["Name"].ToString(); } if (dt.Rows[n]["Alias"] != null && dt.Rows[n]["Alias"].ToString() != "") { model.Alias = dt.Rows[n]["Alias"].ToString(); } if (dt.Rows[n]["Makedev"] != null && dt.Rows[n]["Makedev"].ToString() != "") { model.Makedev = dt.Rows[n]["Makedev"].ToString(); } if (dt.Rows[n]["Model"] != null && dt.Rows[n]["Model"].ToString() != "") { model.Model = dt.Rows[n]["Model"].ToString(); } if (dt.Rows[n]["FunctionRemarks"] != null && dt.Rows[n]["FunctionRemarks"].ToString() != "") { model.FunctionRemarks = dt.Rows[n]["FunctionRemarks"].ToString(); } if (dt.Rows[n]["SafeCount"] != null && dt.Rows[n]["SafeCount"].ToString() != "") { model.SafeCount = dt.Rows[n]["SafeCount"].ToString(); } if (dt.Rows[n]["Unit"] != null && dt.Rows[n]["Unit"].ToString() != "") { model.Unit = dt.Rows[n]["Unit"].ToString(); } if (dt.Rows[n]["Versions"] != null && dt.Rows[n]["Versions"].ToString() != "") { model.Versions = dt.Rows[n]["Versions"].ToString(); } if (dt.Rows[n]["Up_ID"] != null && dt.Rows[n]["Up_ID"].ToString() != "") { model.Up_ID = dt.Rows[n]["Up_ID"].ToString(); } if (dt.Rows[n]["DrawingPatch"] != null && dt.Rows[n]["DrawingPatch"].ToString() != "") { model.DrawingPatch = dt.Rows[n]["DrawingPatch"].ToString(); } if (dt.Rows[n]["Pic_ID"] != null && dt.Rows[n]["Pic_ID"].ToString() != "") { model.Pic_ID = dt.Rows[n]["Pic_ID"].ToString(); } if (dt.Rows[n]["Correlation_ID"] != null && dt.Rows[n]["Correlation_ID"].ToString() != "") { model.Correlation_ID = dt.Rows[n]["Correlation_ID"].ToString(); } if (dt.Rows[n]["Remarks"] != null && dt.Rows[n]["Remarks"].ToString() != "") { model.Remarks = dt.Rows[n]["Remarks"].ToString(); } modelList.Add(model); } } return(modelList); }