Пример #1
0
        public void RemoveCardboardFormat(DCCardboadFormat cbFormat)
        {
            PLMPackEntities db = new PLMPackEntities();
            CardboardFormat cf = CardboardFormat.GetById(db, cbFormat.ID);

            cf.Delete(db);
        }
Пример #2
0
        public DCCardboadFormat UpdateCardboardFormat(DCCardboadFormat cbFormat)
        {
            PLMPackEntities db = new PLMPackEntities();
            CardboardFormat cf = CardboardFormat.GetById(db, cbFormat.ID);

            cf.Name        = cbFormat.Name;
            cf.Description = cbFormat.Description;
            cf.Length      = cbFormat.Length;
            cf.Width       = cbFormat.Width;
            db.SaveChanges();
            return(cbFormat);
        }
Пример #3
0
        public DCCardboadFormat GetCardboardFormatByID(int id)
        {
            PLMPackEntities db   = new PLMPackEntities();
            AspNetUser      user = AspNetUser.GetByUserName(db, UserName);
            CardboardFormat cf   = CardboardFormat.GetById(db, id);

            return(new DCCardboadFormat()
            {
                ID = cf.Id,
                Name = cf.Name,
                Description = cf.Description,
                Length = cf.Length,
                Width = cf.Width
            });
        }