Example #1
0
        //删除
        public static int DeleteProcessEquipmentByName(string _name)
        {
            using (HullShellContainer hs = new HullShellContainer())
            {
                ProcessingEquipment pe = hs.ProcessingEquipmentSet.Where(p => p.EquipMentName == _name).FirstOrDefault();
                hs.DeleteObject(pe);

                return(hs.SaveChanges());
            }
        }
Example #2
0
        public static int DeleteProcessEquipmentById(int Id)
        {
            using (HullShellContainer hs = new HullShellContainer())
            {
                ProcessingEquipment pe = hs.ProcessingEquipmentSet.Where(p => p.Id == Id).FirstOrDefault();
                hs.DeleteObject(pe);

                return(hs.SaveChanges());
            }
        }
Example #3
0
        public static int ModifyProcessEquipmentById(ProcessEquipmentCls pec)
        {
            using (HullShellContainer hs = new HullShellContainer())
            {
                ProcessingEquipment pe = hs.ProcessingEquipmentSet.Where(p => p.Id == pec.Id).FirstOrDefault();

                pe.EquipMentName       = pec.ProcessEquipmentName;
                pe.PressureHeadLength  = pec.PressureHeadLength;
                pe.DriveMode           = pec.DirverMode;
                pe.HeadNumberOfUpDie   = pec.UpDieHeadNumber;
                pe.HeadNumberOfDownDie = pec.DownDieHeadNumber;

                return(hs.SaveChanges());
            }
        }
Example #4
0
        //查询
        public static ProcessEquipmentCls QueryProcessEquipmentByName(string _name)
        {
            using (HullShellContainer hs = new HullShellContainer())
            {
                ProcessingEquipment pe = hs.ProcessingEquipmentSet.Where(p => p.EquipMentName == _name).FirstOrDefault();

                ProcessEquipmentCls pec = new ProcessEquipmentCls();

                pec.Id = pe.Id;
                pec.ProcessEquipmentName = pe.EquipMentName;
                pec.PressureHeadLength   = pe.PressureHeadLength;
                pec.DirverMode           = pe.DriveMode;
                pec.DownDieHeadNumber    = pe.HeadNumberOfDownDie;
                pec.UpDieHeadNumber      = pe.HeadNumberOfUpDie;

                return(pec);
            }
        }
Example #5
0
        //增加
        public static int AddProcessEquipment(ProcessEquipmentCls pec)
        {
            using (HullShellContainer hs = new HullShellContainer())
            {
                ProcessingEquipment pe = new ProcessingEquipment
                {
                    EquipMentName       = pec.ProcessEquipmentName,
                    PressureHeadLength  = pec.PressureHeadLength,
                    DriveMode           = pec.DirverMode,
                    HeadNumberOfDownDie = pec.DownDieHeadNumber,
                    HeadNumberOfUpDie   = pec.UpDieHeadNumber
                };

                hs.AddToProcessingEquipmentSet(pe);

                return(hs.SaveChanges());
            }
        }