public static IS_ItemColorVM SetSubData(IS_ItemColor model) { var data = IS_ItemColorVM.MToVM(model); data.Category = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(model.CategoryID)); data.Images = ImageLinkStorageVM.MsToVMs(ImageLinkStorageService.GetByOIDAPI(model.ID, model.API)); return(data); }
public static bool Insert(Guid id, string color, string desc, Guid oid, Guid aid, Guid cid) { try { using (var context = new CentralProcessContext()) { var data = IS_ItemColorVM.set(id, color, desc, oid, aid, cid); context.IS_ItemColorDB.Add(data); context.SaveChanges(); return(true); } } catch { return(false); } }