protected void childListControl_InstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { if (e.InstanceType == ChildListType.SubjectFieldInfo.ToString()) { SubjectFieldInfoDto currentField = e.Instance as SubjectFieldInfoDto; IFacadeUpdateResult <SubjectData> result = DeleteSubjectField(CurrentSubject.Id, currentField.SubjectFieldId); e.IsSuccessful = result.IsSuccessful; if (result.IsSuccessful) { // Refresh data in session RetrieveSubjectFieldInfos(); } else { ProcUpdateResult(result.ValidationResult, result.Exception); } } else if (e.InstanceType == ChildListType.SubjectChildList.ToString()) { IFacadeUpdateResult <SubjectData> result = DeleteSubjectChildList(CurrentSubject.Id, e.Instance.Id); e.IsSuccessful = result.IsSuccessful; if (result.IsSuccessful) { // Refresh data in session RetrieveSubject(); } else { ProcUpdateResult(result.ValidationResult, result.Exception); } } }
protected void ucListManager_InstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { if (InstanceRowDeleting != null) { InstanceRowDeleting(this, e); } }
protected void ucIDetail_ChildListInstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { switch ((InstanceTypes)Enum.Parse(typeof(InstanceTypes), e.InstanceType)) { case InstanceTypes.Post: PostFacade facade = new PostFacade(uow); IFacadeUpdateResult <PostData> result = facade.DeletePost(e.Instance.Id); e.IsSuccessful = result.IsSuccessful; if (result.IsSuccessful) { // Refresh data in session CurrentInstance.Posts = facade.RetrievePostsByTopic(CurrentInstance.Id, new PostConverter()); } else { // Deal with Update result ProcUpdateResult(result.ValidationResult, result.Exception); } break; } } }
protected void ucIDetail_ChildListInstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { switch ((InstanceTypes)Enum.Parse(typeof(InstanceTypes), e.InstanceType)) { case InstanceTypes.TransactionItem: TransactionFacade facade = new TransactionFacade(uow); IFacadeUpdateResult <TransactionData> result = facade.DeleteTransactionItem(CurrentInstance.Id, e.Instance.Id); e.IsSuccessful = result.IsSuccessful; if (result.IsSuccessful) { // Refresh whole list TransactionDto savedCurrentInstance = result.ToDto(new TransactionConverter()); CurrentInstance.TransactionItems = savedCurrentInstance.TransactionItems; } else { // Deal with Update result ProcUpdateResult(result.ValidationResult, result.Exception); } break; } } }
private void childListControl_InstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { if (ChildListInstanceRowDeleting != null) { ChildListInstanceRowDeleting(this, e); } }
private void DeleteRow(BaseDto instance) { InstanceRowDeletingEventArgs arg = new InstanceRowDeletingEventArgs(instance, InstanceType); if (InstanceRowDeleting != null) { InstanceRowDeleting(this, arg); } }
protected void ucIDetail_ChildListInstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { switch ((InstanceTypes)Enum.Parse(typeof(InstanceTypes), e.InstanceType)) { case InstanceTypes.Contact: ContactFacade facade = new ContactFacade(uow); IFacadeUpdateResult <ContactData> result = facade.DeleteContact(e.Instance.Id); e.IsSuccessful = result.IsSuccessful; if (result.IsSuccessful) { // Refresh data in session CurrentInstance.Contacts = facade.RetrieveContactsByCustomer(CurrentInstance.Id, new ContactConverter()); } else { // Deal with Update result ProcUpdateResult(result.ValidationResult, result.Exception); } break; case InstanceTypes.ScheduleEvent: ScheduleEventFacade facade2 = new ScheduleEventFacade(uow); // Delete data IFacadeUpdateResult <ScheduleEventData> result2 = facade2.DeleteScheduleEvent(e.Instance.Id); e.IsSuccessful = result2.IsSuccessful; if (result2.IsSuccessful) { // Refresh data in session CurrentInstance.ScheduleEvents = facade2.RetrieveScheduleEventsByCustomer(CurrentInstance.Id, new ScheduleEventConverter()); } else { ProcUpdateResult(result2.ValidationResult, result2.Exception); } break; case InstanceTypes.ShipTo: ShipToFacade facade3 = new ShipToFacade(uow); // Delete data IFacadeUpdateResult <ShipToData> result3 = facade3.DeleteShipTo(e.Instance.Id); e.IsSuccessful = result3.IsSuccessful; if (result3.IsSuccessful) { // Refresh data in session CurrentInstance.ShipTos = facade3.RetrieveShipTosByCustomer(CurrentInstance.Id, new ShipToConverter()); } else { ProcUpdateResult(result3.ValidationResult, result3.Exception); } break; } } }
protected void childListControl_InstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { if (e.InstanceType == ChildListType.EntityItem.ToString()) { IFacadeUpdateResult <DEntityData> result = DeleteDEntityItem(CurrentDEntity.Id, e.Instance.Id); e.IsSuccessful = result.IsSuccessful; if (result.IsSuccessful) { // Refresh data in session RetrieveData(); } else { ProcUpdateResult(result.ValidationResult, result.Exception); } } }
protected void ucIDetail_ChildListInstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { DomainFacade facade = new DomainFacade(uow); switch ((InstanceTypes)Enum.Parse(typeof(InstanceTypes), e.InstanceType)) { case InstanceTypes.DomainMainMenu: IFacadeUpdateResult <DomainData> result = facade.DeleteDomainMainMenu(CurrentInstance.Id, e.Instance.Id); e.IsSuccessful = result.IsSuccessful; if (result.IsSuccessful) { // Refresh whole list DomainDto savedParentInstance = result.ToDto(new DomainConverter()); CurrentInstance.DomainMainMenus = savedParentInstance.DomainMainMenus; } else { // Deal with Update result ProcUpdateResult(result.ValidationResult, result.Exception); } break; case InstanceTypes.DomainSetupMenu: IFacadeUpdateResult <DomainData> result2 = facade.DeleteDomainSetupMenu(CurrentInstance.Id, e.Instance.Id); e.IsSuccessful = result2.IsSuccessful; if (result2.IsSuccessful) { // Refresh whole list DomainDto savedParentInstance = result2.ToDto(new DomainConverter()); CurrentInstance.DomainSetupMenus = savedParentInstance.DomainSetupMenus; } else { // Deal with Update result ProcUpdateResult(result2.ValidationResult, result2.Exception); } break; } } }
protected void ucIList_InstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { DocumentFacade facade = new DocumentFacade(uow); IFacadeUpdateResult <DocumentData> result = facade.DeleteDocument(e.Instance.Id); e.IsSuccessful = result.IsSuccessful; if (result.IsSuccessful) { // Refresh whole list RetrieveInstances(facade); } else { // Deal with Update result ProcUpdateResult(result.ValidationResult, result.Exception); } } }
protected void ucIList_InstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { CatalogFacade facade = new CatalogFacade(uow); IFacadeUpdateResult <CatalogData> result = facade.DeleteCatalog(e.Instance.Id); e.IsSuccessful = result.IsSuccessful; if (result.IsSuccessful) { // Refresh whole list CurrentInstances = facade.RetrieveAllCatalog(new CatalogConverter()); } else { // Deal with Update result ProcUpdateResult(result.ValidationResult, result.Exception); } } }
protected void ucIDetail_ChildListInstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { }
protected void ucIDetail_ChildListInstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { switch ((InstanceTypes)Enum.Parse(typeof(InstanceTypes), e.InstanceType)) { case InstanceTypes.ContactContactMethod: ContactFacade facade = new ContactFacade(uow); IFacadeUpdateResult <ContactData> result = facade.DeleteContactContactMethod(CurrentInstance.Id, e.Instance.Id); e.IsSuccessful = result.IsSuccessful; if (result.IsSuccessful) { // Refresh whole list ContactDto savedCurrentInstance = result.ToDto(new ContactConverter()); CurrentInstance.ContactContactMethods = savedCurrentInstance.ContactContactMethods; // Note: Can't refresh CurrentInstance this way, it will ruin other child list data //ucIDetail.CurrentInstance = savedCurrentInstance; } else { // Deal with Update result ProcUpdateResult(result.ValidationResult, result.Exception); } break; case InstanceTypes.ScheduleEvent: ScheduleEventFacade facade2 = new ScheduleEventFacade(uow); // Delete data IFacadeUpdateResult <ScheduleEventData> result2 = facade2.DeleteScheduleEvent(e.Instance.Id); e.IsSuccessful = result2.IsSuccessful; if (result2.IsSuccessful) { // Refresh data in session CurrentInstance.ScheduleEvents = facade2.RetrieveScheduleEventsByContact(CurrentInstance.Id, new ScheduleEventConverter()); } else { // Deal with Update result ProcUpdateResult(result2.ValidationResult, result2.Exception); } break; case InstanceTypes.Activity: ActivityFacade facade3 = new ActivityFacade(uow); // Delete data IFacadeUpdateResult <ActivityData> result3 = facade3.DeleteActivity(e.Instance.Id); e.IsSuccessful = result3.IsSuccessful; if (result3.IsSuccessful) { // Refresh data in session CurrentInstance.Activitys = facade3.RetrieveActivitysByContact(CurrentInstance.Id, new ActivityConverter()); } else { // Deal with Update result ProcUpdateResult(result3.ValidationResult, result3.Exception); } break; case InstanceTypes.Transaction: TransactionFacade facade4 = new TransactionFacade(uow); // Delete data IFacadeUpdateResult <TransactionData> result4 = facade4.DeleteTransaction(e.Instance.Id); e.IsSuccessful = result4.IsSuccessful; if (result4.IsSuccessful) { // Refresh data in session CurrentInstance.Transactions = facade4.RetrieveTransactionsByContact(CurrentInstance.Id, new TransactionConverter()); } else { // Deal with Update result ProcUpdateResult(result4.ValidationResult, result4.Exception); } break; } } }