Exemple #1
0
 public static CardboardProfile CreateNew(PLMPackLibDb db, string code, string name, float thickness)
 {
     // is already exists ?
     if (Exists(db, code))
         throw new Exception(string.Format("Cardboard profile with code = {0} already exists", code));
     // build new cardboard profile
     CardboardProfile cardboardProfile = new CardboardProfile();
     cardboardProfile.Code = code;
     cardboardProfile.Name = name;
     cardboardProfile.Thickness = thickness;
     db.CardboardProfiles.Add(cardboardProfile);
     db.SaveChanges();
     return cardboardProfile;
 }
Exemple #2
0
 public static CardboardFormat CreateNew(PLMPackLibDb db, string name, string description, float length, float width)
 {
     // is already existing ?
     if (Exists(db, name))
         throw new Exception(string.Format("CardboardFormat with name = {0} already exists", name));
     // build new cardboard format
     CardboardFormat cardboardFormat = new CardboardFormat();
     cardboardFormat.Name = name;
     cardboardFormat.Description = description;
     cardboardFormat.Length = length;
     cardboardFormat.Width = width;
     db.CardboardFormats.Add(cardboardFormat);
     db.SaveChanges();
     return cardboardFormat;
 }
        public static CardboardProfile CreateNew(PLMPackLibDb db, string code, string name, float thickness)
        {
            // is already exists ?
            if (Exists(db, code))
            {
                throw new Exception(string.Format("Cardboard profile with code = {0} already exists", code));
            }
            // build new cardboard profile
            CardboardProfile cardboardProfile = new CardboardProfile();

            cardboardProfile.Code      = code;
            cardboardProfile.Name      = name;
            cardboardProfile.Thickness = thickness;
            db.CardboardProfiles.Add(cardboardProfile);
            db.SaveChanges();
            return(cardboardProfile);
        }
        public static CardboardFormat CreateNew(PLMPackLibDb db, string name, string description, float length, float width)
        {
            // is already existing ?
            if (Exists(db, name))
            {
                throw new Exception(string.Format("CardboardFormat with name = {0} already exists", name));
            }
            // build new cardboard format
            CardboardFormat cardboardFormat = new CardboardFormat();

            cardboardFormat.Name        = name;
            cardboardFormat.Description = description;
            cardboardFormat.Length      = length;
            cardboardFormat.Width       = width;
            db.CardboardFormats.Add(cardboardFormat);
            db.SaveChanges();
            return(cardboardFormat);
        }
Exemple #5
0
 public void Delete(PLMPackLibDb db)
 {
     db.CardboardProfiles.Remove(this);
     db.SaveChanges();
 }
 public void Delete(PLMPackLibDb db)
 {
     db.CardboardProfiles.Remove(this);
     db.SaveChanges();
 }