/// <summary> /// 根据关键字段的值获取记录 /// </summary> /// <param name="Id">关键字段的值</param> /// <returns>符合查询条件的记录</returns> //[WebMethod(Description = "按Id查找TmsToolsType")] public TmsToolsType GetTmsToolsTypeById(string Id) { using (ITmsToolsTypeBLL TmsToolsTypeBLL = BLLContainer.Resolve <ITmsToolsTypeBLL>()) { TmsToolsType model = TmsToolsTypeBLL.GetFirstOrDefault(Id); return(model); } }
/// <summary> /// 按照关键字段删除 /// </summary> /// <param name="Id">关键字段</param> /// <returns>是否成功</returns> //[WebMethod(Description = "删除TmsToolsType")] public bool DelTmsToolsType(string Id) { using (ITmsToolsTypeBLL TmsToolsTypeBLL = BLLContainer.Resolve <ITmsToolsTypeBLL>()) { try { TmsToolsType item = TmsToolsTypeBLL.GetFirstOrDefault(Id); return(TmsToolsTypeBLL.Delete(item)); } catch { return(false); } } }
/// <summary> /// 按照关键字段删除 /// </summary> /// <param name="Ids">关键字段数组</param> /// <returns>是否成功</returns> //[WebMethod(Description = "删除(多个)TmsToolsType")] public bool DelTmsToolsTypes(string[] Ids) { using (ITmsToolsTypeBLL TmsToolsTypeBLL = BLLContainer.Resolve <ITmsToolsTypeBLL>()) { try { List <TmsToolsType> entitys = new List <TmsToolsType>(); foreach (string id in Ids) { TmsToolsType item = TmsToolsTypeBLL.GetFirstOrDefault(id); entitys.Add(item); } return(TmsToolsTypeBLL.Delete(entitys)); } catch { return(false); } } }