public void RemoveCardboardFormat(DCCardboadFormat cbFormat) { PLMPackEntities db = new PLMPackEntities(); CardboardFormat cf = CardboardFormat.GetById(db, cbFormat.ID); cf.Delete(db); }
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); }
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 }); }