/// <summary> /// 创建一个资源 /// </summary> /// <param name="resourceName"></param> /// <param name="resourceType"></param> /// <param name="resourcePath"></param> private void CreateResourceQuery(string resourceName, string resourceType, string resourcePath) { if (GetDataByResourcePath(resourcePath) == null) { ResrcTableAdapter.Insert(resourceName, resourceType, resourcePath); ResrcTableAdapter.Update(MoonDataset.Resources); MoonDataset.Resources.AcceptChanges(); } }
/// <summary> /// 删除一个资源 /// </summary> /// <param name="resourceId"></param> private void DeleteResourceQuery(int resourceId) { ResrcTableAdapter.Delete(resourceId); ResrcTableAdapter.Update(MoonDataset.Resources); MoonDataset.Resources.AcceptChanges(); }