/// <summary> /// 增加一条数据 /// </summary> public decimal Add(Maticsoft.Model.EquipmentInfo model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Maticsoft.Model.EquipmentInfo model) { return(dal.Update(model)); }
/// <summary> /// 获得数据列表 /// </summary> public List <Maticsoft.Model.EquipmentInfo> DataTableToList(DataTable dt) { List <Maticsoft.Model.EquipmentInfo> modelList = new List <Maticsoft.Model.EquipmentInfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Maticsoft.Model.EquipmentInfo model; for (int n = 0; n < rowsCount; n++) { model = new Maticsoft.Model.EquipmentInfo(); if (dt.Rows[n]["Eqp_ID"] != null && dt.Rows[n]["Eqp_ID"].ToString() != "") { model.Eqp_ID = decimal.Parse(dt.Rows[n]["Eqp_ID"].ToString()); } if (dt.Rows[n]["AssetType"] != null && dt.Rows[n]["AssetType"].ToString() != "") { model.AssetType = dt.Rows[n]["AssetType"].ToString(); } if (dt.Rows[n]["Department"] != null && dt.Rows[n]["Department"].ToString() != "") { model.Department = dt.Rows[n]["Department"].ToString(); } if (dt.Rows[n]["InstallationSite"] != null && dt.Rows[n]["InstallationSite"].ToString() != "") { model.InstallationSite = dt.Rows[n]["InstallationSite"].ToString(); } if (dt.Rows[n]["AddMode"] != null && dt.Rows[n]["AddMode"].ToString() != "") { model.AddMode = dt.Rows[n]["AddMode"].ToString(); } if (dt.Rows[n]["VerifyDate"] != null && dt.Rows[n]["VerifyDate"].ToString() != "") { model.VerifyDate = DateTime.Parse(dt.Rows[n]["VerifyDate"].ToString()); } if (dt.Rows[n]["VerifyInterval"] != null && dt.Rows[n]["VerifyInterval"].ToString() != "") { model.VerifyInterval = dt.Rows[n]["VerifyInterval"].ToString(); } if (dt.Rows[n]["MaintenanceDate"] != null && dt.Rows[n]["MaintenanceDate"].ToString() != "") { model.MaintenanceDate = DateTime.Parse(dt.Rows[n]["MaintenanceDate"].ToString()); } if (dt.Rows[n]["MaintenanceInterval"] != null && dt.Rows[n]["MaintenanceInterval"].ToString() != "") { model.MaintenanceInterval = dt.Rows[n]["MaintenanceInterval"].ToString(); } if (dt.Rows[n]["LoginDate"] != null && dt.Rows[n]["LoginDate"].ToString() != "") { model.LoginDate = DateTime.Parse(dt.Rows[n]["LoginDate"].ToString()); } if (dt.Rows[n]["UsefulLife"] != null && dt.Rows[n]["UsefulLife"].ToString() != "") { model.UsefulLife = dt.Rows[n]["UsefulLife"].ToString(); } if (dt.Rows[n]["DeliveryUser"] != null && dt.Rows[n]["DeliveryUser"].ToString() != "") { model.DeliveryUser = dt.Rows[n]["DeliveryUser"].ToString(); } if (dt.Rows[n]["CheckUser"] != null && dt.Rows[n]["CheckUser"].ToString() != "") { model.CheckUser = dt.Rows[n]["CheckUser"].ToString(); } if (dt.Rows[n]["CareUser"] != null && dt.Rows[n]["CareUser"].ToString() != "") { model.CareUser = dt.Rows[n]["CareUser"].ToString(); } if (dt.Rows[n]["AssetNum"] != null && dt.Rows[n]["AssetNum"].ToString() != "") { model.AssetNum = dt.Rows[n]["AssetNum"].ToString(); } if (dt.Rows[n]["AssetName"] != null && dt.Rows[n]["AssetName"].ToString() != "") { model.AssetName = dt.Rows[n]["AssetName"].ToString(); } if (dt.Rows[n]["AliasName"] != null && dt.Rows[n]["AliasName"].ToString() != "") { model.AliasName = dt.Rows[n]["AliasName"].ToString(); } if (dt.Rows[n]["MakeNum"] != null && dt.Rows[n]["MakeNum"].ToString() != "") { model.MakeNum = dt.Rows[n]["MakeNum"].ToString(); } if (dt.Rows[n]["EquipentModel"] != null && dt.Rows[n]["EquipentModel"].ToString() != "") { model.EquipentModel = dt.Rows[n]["EquipentModel"].ToString(); } if (dt.Rows[n]["Specification"] != null && dt.Rows[n]["Specification"].ToString() != "") { model.Specification = dt.Rows[n]["Specification"].ToString(); } if (dt.Rows[n]["FunctionDescription"] != null && dt.Rows[n]["FunctionDescription"].ToString() != "") { model.FunctionDescription = dt.Rows[n]["FunctionDescription"].ToString(); } if (dt.Rows[n]["Supplier"] != null && dt.Rows[n]["Supplier"].ToString() != "") { model.Supplier = dt.Rows[n]["Supplier"].ToString(); } if (dt.Rows[n]["ManufacturingDate"] != null && dt.Rows[n]["ManufacturingDate"].ToString() != "") { model.ManufacturingDate = DateTime.Parse(dt.Rows[n]["ManufacturingDate"].ToString()); } if (dt.Rows[n]["OfficialWedsite"] != null && dt.Rows[n]["OfficialWedsite"].ToString() != "") { model.OfficialWedsite = dt.Rows[n]["OfficialWedsite"].ToString(); } if (dt.Rows[n]["SupplierTel"] != null && dt.Rows[n]["SupplierTel"].ToString() != "") { model.SupplierTel = dt.Rows[n]["SupplierTel"].ToString(); } if (dt.Rows[n]["AferSaleTel"] != null && dt.Rows[n]["AferSaleTel"].ToString() != "") { model.AferSaleTel = dt.Rows[n]["AferSaleTel"].ToString(); } if (dt.Rows[n]["State"] != null && dt.Rows[n]["State"].ToString() != "") { model.State = dt.Rows[n]["State"].ToString(); } if (dt.Rows[n]["Count"] != null && dt.Rows[n]["Count"].ToString() != "") { model.Count = dt.Rows[n]["Count"].ToString(); } if (dt.Rows[n]["Unit"] != null && dt.Rows[n]["Unit"].ToString() != "") { model.Unit = dt.Rows[n]["Unit"].ToString(); } if (dt.Rows[n]["Efficiency"] != null && dt.Rows[n]["Efficiency"].ToString() != "") { model.Efficiency = dt.Rows[n]["Efficiency"].ToString(); } if (dt.Rows[n]["EquipentOEE"] != null && dt.Rows[n]["EquipentOEE"].ToString() != "") { model.EquipentOEE = dt.Rows[n]["EquipentOEE"].ToString(); } if (dt.Rows[n]["PhotoPatch"] != null && dt.Rows[n]["PhotoPatch"].ToString() != "") { model.PhotoPatch = dt.Rows[n]["PhotoPatch"].ToString(); } if (dt.Rows[n]["SafetySpecification"] != null && dt.Rows[n]["SafetySpecification"].ToString() != "") { model.SafetySpecification = dt.Rows[n]["SafetySpecification"].ToString(); } if (dt.Rows[n]["OI"] != null && dt.Rows[n]["OI"].ToString() != "") { model.OI = dt.Rows[n]["OI"].ToString(); } if (dt.Rows[n]["ChechSheet"] != null && dt.Rows[n]["ChechSheet"].ToString() != "") { model.ChechSheet = dt.Rows[n]["ChechSheet"].ToString(); } modelList.Add(model); } } return(modelList); }