public static void DeleteObjectFactoryBusinessItem(string id, EventHandler <DataPortalResult <ObjectFactoryBusinessItem> > completed) { DataPortal <ObjectFactoryBusinessItem> dp = new DataPortal <ObjectFactoryBusinessItem>(); dp.DeleteCompleted += completed; dp.BeginDelete(new SingleCriteria <ObjectFactoryBusinessItem, string>(id)); }
public static void DeleteBusinessItem(string id, EventHandler <DataPortalResult <BusinessItem> > completed) { DataPortal <BusinessItem> dp = new DataPortal <BusinessItem>(); dp.DeleteCompleted += completed; dp.BeginDelete(id); }
public void IAuthorizeDataPortal_Implementation_DoesNotAllow_Delete() { var context = GetContext(); //setup for the test SetAppSettingValueCmd .ExecuteCommand( "CslaAuthorizationProvider", "Csla.Testing.Business.DataPortal.DontAuthorizeDataPortalStub, Csla.Testing.Business", (o, e) => { //actual test var dp = new DataPortal <TestBO>(); dp.DeleteCompleted += ((sender, e1) => { context.Assert.IsNotNull(e1.Error); //TODO: perhaps check to assure that exception type is Csla.Security.SecurityException //context.Assert.IsTrue(((Csla.DataPortalException)(e1.Error)).ErrorInfo.InnerError.ExceptionTypeName=="Csla.Security.SecurityException"); context.Assert.Success(); }); dp.BeginDelete(new SingleCriteria <TestBO, int>(1)); }); context.Complete(); }
public static void Delete(SingleCriteria <int> id, EventHandler <DataPortalResult <BaseItemInfo> > completed) { DataPortal <BaseItemInfo> dp = new DataPortal <BaseItemInfo>(); dp.DeleteCompleted += completed; dp.BeginDelete(id); }
private void OnDelete(object sender, MouseButtonEventArgs e) { var deletes = appSettingList.Where(p => p.Checked).ToList(); if (deletes.Count == 0) { MessageBox.Show("请先选择要删除的参数!"); } else { if (MessageBox.Show("是否确定删除所选择的参数?", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { EAS.Controls.Window.ShowLoading("正在删除参数..."); int index = 0; foreach (AppSetting item in deletes) { DataPortal <AppSetting> dp = new DataPortal <AppSetting>(); dp.BeginDelete(item).Completed += (s, e2) => { InvokeTask task = s as InvokeTask; if (task.Error != null) { EAS.Controls.Window.HideLoading(); MessageBox.Show("删除参数时发生错误:" + task.Error.Message, "错误", MessageBoxButton.OK); return; } else { index++; if (index == deletes.Count) { foreach (AppSetting pItem in deletes) { this.appSettingList.Remove(pItem); } this.dataList.ItemsSource = null; this.dataList.ItemsSource = this.appSettingList; EAS.Controls.Window.HideLoading(); } } }; } } } }
public void Delete_PrimitiveCriteria() { var context = GetContext(); object userState = "state"; DataPortal <PrimitiveCriteriaSingle> dp = new DataPortal <PrimitiveCriteriaSingle>(); dp.DeleteCompleted += (o1, e1) => { context.Assert.IsNull(e1.Error); context.Assert.AreEqual(dp.GlobalContext["PrimitiveCriteriaSingle"].ToString(), "Deleted"); context.Assert.Success(); }; dp.BeginDelete(5); context.Complete(); }
public void TestDeleteRemoteProxyWithoutUserState() { Csla.DataPortal.ProxyTypeName = typeof(SynchronizedWcfProxy).AssemblyQualifiedName; Csla.ApplicationContext.GlobalContext.Clear(); UnitTestContext context = GetContext(); DataPortal.BeginFetch <Customer>(new SingleCriteria <Customer, int>(2), (o, e) => { Customer actual = e.Object; DataPortal.BeginDelete <Customer>(new SingleCriteria <Customer, int>(actual.Id), (o1, e1) => { context.Assert.IsNull(e.Error); context.Assert.IsNull(e.UserState); context.Assert.Success(); }); }); context.Complete(); }
public void IAuthorizeDataPortal_Implementation_Allows_Delete() { var context = GetContext(); //setup for the test SetAppSettingValueCmd .ExecuteCommand( "CslaAuthorizationProvider", "Csla.Testing.Business.DataPortal.AuthorizeDataPortalStub, Csla.Testing.Business", (o, e) => { //actual test var dp = new DataPortal <TestBO>(); dp.DeleteCompleted += ((sender, e1) => { context.Assert.IsNull(e1.Error); context.Assert.Success(); }); dp.BeginDelete(1); }); context.Complete(); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="DocTypeEditDyna"/> object, based on given parameters. /// </summary> /// <param name="docTypeID">The DocTypeID of the DocTypeEditDyna to delete.</param> /// <param name="callback">The completion callback method.</param> internal static void DeleteDocTypeEditDyna(int docTypeID, EventHandler <DataPortalResult <DocTypeEditDyna> > callback) { DataPortal.BeginDelete <DocTypeEditDyna>(docTypeID, callback); }
public static void DeleteProject(int id, EventHandler <DataPortalResult <ProjectEdit> > callback) { DataPortal.BeginDelete <ProjectEdit>(id, callback); }
public void BeginDelete(object criteria) { DataPortal.BeginDelete(criteria, DeleteCompleted); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="ProductTypeEdit"/> object, based on given parameters. /// </summary> /// <param name="productTypeId">The ProductTypeId of the ProductTypeEdit to delete.</param> /// <param name="callback">The completion callback method.</param> public static void DeleteProductTypeEdit(int productTypeId, EventHandler <DataPortalResult <ProductTypeEdit> > callback) { DataPortal.BeginDelete <ProductTypeEdit>(productTypeId, callback); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="InvoiceEdit"/> object, based on given parameters. /// </summary> /// <param name="invoiceId">The InvoiceId of the InvoiceEdit to delete.</param> /// <param name="callback">The completion callback method.</param> public static void DeleteInvoiceEdit(Guid invoiceId, EventHandler <DataPortalResult <InvoiceEdit> > callback) { DataPortal.BeginDelete <InvoiceEdit>(invoiceId, callback); }
public void BeginDelete(object criteria, object userState) { DataPortal.BeginDelete(criteria, DeleteCompleted, userState); }
public void IAuthorizeDataPortal_Implementation_Allows_Delete() { var context = GetContext(); //setup for the test SetAppSettingValueCmd .ExecuteCommand( "CslaAuthorizationProvider", "Csla.Testing.Business.DataPortal.AuthorizeDataPortalStub, Csla.Testing.Business", (o, e) => { //actual test var dp = new DataPortal<TestBO>(); dp.DeleteCompleted += ((sender, e1) => { context.Assert.IsNull(e1.Error); context.Assert.Success(); }); dp.BeginDelete(new SingleCriteria<TestBO,int>(1)); }); context.Complete(); }
public void IAuthorizeDataPortal_Implementation_DoesNotAllow_Delete() { var context = GetContext(); //setup for the test SetAppSettingValueCmd .ExecuteCommand( "CslaAuthorizationProvider", "Csla.Testing.Business.DataPortal.DontAuthorizeDataPortalStub, Csla.Testing.Business", (o, e) => { //actual test var dp = new DataPortal<TestBO>(); dp.DeleteCompleted += ((sender, e1) => { context.Assert.IsNotNull(e1.Error); //TODO: perhaps check to assure that exception type is Csla.Security.SecurityException //context.Assert.IsTrue(((Csla.DataPortalException)(e1.Error)).ErrorInfo.InnerError.ExceptionTypeName=="Csla.Security.SecurityException"); context.Assert.Success(); }); dp.BeginDelete(new SingleCriteria<TestBO, int>(1)); }); context.Complete(); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="DocType"/> object, based on given parameters. /// </summary> /// <param name="docTypeID">The DocTypeID of the DocType to delete.</param> /// <param name="callback">The completion callback method.</param> public static void DeleteDocType(int docTypeID, EventHandler <DataPortalResult <DocType> > callback) { DataPortal.BeginDelete <DocType>(docTypeID, callback); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="DocClass"/> object, based on given parameters. /// </summary> /// <param name="docClassID">The DocClassID of the DocClass to delete.</param> /// <param name="callback">The completion callback method.</param> public static void DeleteDocClass(int docClassID, EventHandler <DataPortalResult <DocClass> > callback) { DataPortal.BeginDelete <DocClass>(docClassID, callback); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="DocClassEdit"/> object, based on given parameters. /// </summary> /// <param name="docClassID">The DocClassID of the DocClassEdit to delete.</param> /// <param name="callback">The completion callback method.</param> internal static void DeleteDocClassEdit(int docClassID, EventHandler <DataPortalResult <DocClassEdit> > callback) { DataPortal.BeginDelete <DocClassEdit>(docClassID, callback); }
public void Delete_PrimitiveCriteria() { var context = GetContext(); object userState = "state"; DataPortal<PrimitiveCriteriaSingle> dp = new DataPortal<PrimitiveCriteriaSingle>(); dp.DeleteCompleted += (o1, e1) => { context.Assert.IsNull(e1.Error); context.Assert.AreEqual(dp.GlobalContext["PrimitiveCriteriaSingle"].ToString(), "Deleted"); context.Assert.Success(); }; dp.BeginDelete(5); context.Complete(); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="Role"/> object, based on given parameters. /// </summary> /// <param name="roleID">The RoleID of the Role to delete.</param> /// <param name="callback">The completion callback method.</param> public static void DeleteRole(int roleID, EventHandler <DataPortalResult <Role> > callback) { DataPortal.BeginDelete <Role>(roleID, callback); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="User"/> object, based on given parameters. /// </summary> /// <param name="userID">The UserID of the User to delete.</param> /// <param name="callback">The completion callback method.</param> public static void DeleteUser(int userID, EventHandler <DataPortalResult <User> > callback) { DataPortal.BeginDelete <User>(userID, callback); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="Folder"/> object, based on given parameters. /// </summary> /// <param name="folderID">The FolderID of the Folder to delete.</param> /// <param name="callback">The completion callback method.</param> public static void DeleteFolder(int folderID, EventHandler <DataPortalResult <Folder> > callback) { DataPortal.BeginDelete <Folder>(folderID, callback); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="CustomerEdit"/> object, based on given parameters. /// </summary> /// <param name="customerId">The CustomerId of the CustomerEdit to delete.</param> /// <param name="callback">The completion callback method.</param> public static void DeleteCustomerEdit(string customerId, EventHandler <DataPortalResult <CustomerEdit> > callback) { DataPortal.BeginDelete <CustomerEdit>(customerId, callback); }
/// <summary> /// Factory method. Asynchronously deletes a <see cref="CircTypeTagEditDyna"/> object, based on given parameters. /// </summary> /// <param name="circTypeID">The CircTypeID of the CircTypeTagEditDyna to delete.</param> /// <param name="callback">The completion callback method.</param> internal static void DeleteCircTypeTagEditDyna(int circTypeID, EventHandler <DataPortalResult <CircTypeTagEditDyna> > callback) { DataPortal.BeginDelete <CircTypeTagEditDyna>(circTypeID, callback); }