using System.Collections.Generic; using System.Linq; namespace BLL { public class AttachUrl2DetailService { public static List GetDetailListByItemId(string AttachUrlItemId, string type) { return (from x in Funs.DB.PHTGL_AttachUrl2Detail where x.AttachUrlItemId == AttachUrlItemId && x.DetailType == type select x).ToList(); } /// /// 添加签证台班价格 /// /// public static void AddAttachUrl2Detail(Model.PHTGL_AttachUrl2Detail detail) { Model.PHTGL_AttachUrl2Detail newDetail = new Model.PHTGL_AttachUrl2Detail(); newDetail.AttachUrlDetaild = detail.AttachUrlDetaild; newDetail.AttachUrlItemId = detail.AttachUrlItemId; newDetail.DetailType = detail.DetailType; newDetail.Specifications = detail.Specifications; newDetail.MachineTeamPrice = detail.MachineTeamPrice; newDetail.Remark = detail.Remark; Funs.DB.PHTGL_AttachUrl2Detail.InsertOnSubmit(newDetail); Funs.DB.SubmitChanges(); } public static void DeleteAttachUrl2DetailByItemId(string itemId, string type) { var detail = (from x in Funs.DB.PHTGL_AttachUrl2Detail where x.AttachUrlItemId == itemId && x.DetailType == type select x).ToList(); if (detail != null) { Funs.DB.PHTGL_AttachUrl2Detail.DeleteAllOnSubmit(detail); Funs.DB.SubmitChanges(); } } } }