public static ShopManagementVM SetSubData(ShopManagement model, bool isSetItem) { var data = ShopManagementVM.MToVM(model); data.ProfileImage = ImageLinkStorageVM.MToVM(ImageLinkStorageService.GetByID(model.ProfileImage, model.ID, model.API)); data.Items = isSetItem ? IS_ItemService.SetSubDatas(IS_ItemService.GetByOID(model.ID, model.API), model.API) : new List <IS_ItemVM>(); return(data); }
public static bool Insert(Guid id, string name, string desc, Guid oid, Guid aid, Guid pi, Guid cid) { try { using (var context = new CentralProcessContext()) { var data = ShopManagementVM.set(id, name, desc, oid, aid, pi, cid); context.ShopManagementDB.Add(data); context.SaveChanges(); return(true); } } catch { return(false); } }