using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL
{
   public static class PersonSteelService
    {
        /// 
        /// 添加
        /// 
        /// 
       public static void AddDInspectionPersonItem(Model.Comprehensive_InspectionPersonSteel InspectionPersonItem)
        {
            Model.SGGLDB db = Funs.DB;
            Model.Comprehensive_InspectionPersonSteel newInspectionPersonItem = new Model.Comprehensive_InspectionPersonSteel();
            newInspectionPersonItem.InspectionPersonId = InspectionPersonItem.InspectionPersonId;
            newInspectionPersonItem.InspectionPersonSteelId = InspectionPersonItem.InspectionPersonSteelId;
            newInspectionPersonItem.SteelId = InspectionPersonItem.SteelId;
            newInspectionPersonItem.SizesMax = InspectionPersonItem.SizesMax;
            newInspectionPersonItem.SizesMin = InspectionPersonItem.SizesMin;
            newInspectionPersonItem.ThicknessMax = InspectionPersonItem.ThicknessMax;
            newInspectionPersonItem.ThicknessMin = InspectionPersonItem.ThicknessMin;
            newInspectionPersonItem.IsChecked = InspectionPersonItem.IsChecked;
            db.Comprehensive_InspectionPersonSteel.InsertOnSubmit(newInspectionPersonItem);
            db.SubmitChanges();
        }
           /// 
        /// 根据主键删除资料接收登记
        /// 
        /// 
       public static void DelPersonItem(string InspectionPersonId)
        {
            Model.SGGLDB db = Funs.DB;
            List InspectionPerson = (from x in db.Comprehensive_InspectionPersonSteel where x.InspectionPersonId == InspectionPersonId select x).ToList();
            if (InspectionPerson != null)
            {
                db.Comprehensive_InspectionPersonSteel.DeleteAllOnSubmit(InspectionPerson);
                db.SubmitChanges();
            }
        }
       /// 
       /// 获取对象
       /// 
       /// 
       /// 
       public static Model.Comprehensive_InspectionPersonSteel getInspectionPersonSteelBySteelId(string SteelId, string InspectionPersonId)
       {
           return (from x in Funs.DB.Comprehensive_InspectionPersonSteel where x.SteelId == SteelId && x.InspectionPersonId==InspectionPersonId select x).FirstOrDefault();
       }
    }
}