public virtual void ProgramPartnerDelete(ProgramPartner entity) { TraceCallEnterEvent.Raise(); try { m_DataContext.BeginNestedTran(); try { m_DataContext.ndihdProgramPartnerDelete(entity.OrganisationRef, entity.ProgramRef); m_DataContext.CommitNested(); } catch { m_DataContext.RollbackNested(); throw; } TraceCallReturnEvent.Raise(); return; } catch (Exception ex) { ExceptionManager.Publish(ex); TraceCallReturnEvent.Raise(false); throw; } }
public new void ProgramPartnerDelete(ProgramPartner entity) { TraceCallEnterEvent.Raise(); try { // logical checks: ProgramService progSrv = new ProgramService(); Program selected = progSrv.ProgramSelect(entity.ProgramRef); if (selected == null) throw new ApplicationException("Ezzel az azonosítóval nem létezik program."); if (!selected.IsActive) throw new ApplicationException("A program nem aktív."); // check permission: Writer or Admin string writerRole = selected.OrganisationRef.Value.ToString() + ".Writer"; PrincipalPermission permWriter = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, writerRole); PrincipalPermission permAdmin = new PrincipalPermission(Thread.CurrentPrincipal.Identity.Name, "Administrator"); permWriter.Union(permAdmin).Demand(); // save data: base.ProgramPartnerDelete(entity); BusinessAuditEvent.Success( new EventParameter("ProgramID", entity.ProgramRef.ToString()), new EventParameter("OrganisationID", entity.OrganisationRef.ToString()) ); TraceCallReturnEvent.Raise(); return; } catch (Exception ex) { ExceptionManager.Publish(ex); BusinessAuditEvent.Fail( new EventParameter("Exception", ex.ToString()), new EventParameter("ProgramID", entity.ProgramRef.ToString()), new EventParameter("OrganisationID", entity.OrganisationRef.ToString()) ); TraceCallReturnEvent.Raise(false); throw; } }
public virtual ProgramPartner ProgramPartnerSelect(DBGuid OrganisationRefVal, DBGuid ProgramRefVal) { TraceCallEnterEvent.Raise(); try { ProgramPartner result = null; DataSet entitySet = m_DataContext.ndihdProgramPartnerSelect(OrganisationRefVal, ProgramRefVal); if (entitySet.Tables[0].Rows.Count != 0) { result = new ProgramPartner(entitySet); } TraceCallReturnEvent.Raise(); return result; } catch (Exception ex) { ExceptionManager.Publish(ex); TraceCallReturnEvent.Raise(false); throw; } }
/// <summary> /// Handles the ItemCommand event of the gridOrganisation control. /// </summary> /// <param name="source">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.DataGridCommandEventArgs"/> instance containing the event data.</param> private void gridOrganisation_ItemCommand(object source, DataGridCommandEventArgs e) { try { //A szervezet link mûködése if (e.CommandName.ToLower().Equals("linktoorganisation")) { string orgId = e.CommandArgument.ToString(); string mode = Request["mode"]; string kefEventId = Request["orgId"]; //ha a KefMemberModify.aspx, vagy a KefOrganisationData.aspx -ról jöttünk if ((mode == "kefMemberModSelect") || (mode == "kefMemberSelect")) Response.Redirect("OrganisationData.aspx?orgID=" + orgId + "&mode=" + mode + "&kefEventId=" + kefEventId); else Response.Redirect("OrganisationData.aspx?orgID=" + orgId); } //partner select if (e.CommandName.ToLower().Equals("selectpartner")) { string selectedOrgId = e.CommandArgument.ToString(); string orgId = Request["orgId"]; switch (Request["mode"]) { case "kefMemberSelect": Response.Redirect("KefMemberCreate.aspx?orgID=" + orgId + "&selectedOrgId=" + selectedOrgId); break; case "kefMemberModSelect": Response.Redirect("KefMemberModify.aspx?kefId=" + Request["orgId"] + "&selectedOrgId=" + selectedOrgId); //Response.Redirect("KefMemberCreate.aspx?orgID=" + orgId + "&selectedOrgId=" + selectedOrgId); break; case "getWriteRight": Response.Redirect("OrganisationGetWriteRight.aspx?orgID=" + Request["orgId"] + "&selectedOrgId=" + selectedOrgId); break; default: string progId = Request["progId"]; Guid organisationGuid = new Guid(selectedOrgId); Guid programGuid = new Guid(progId); ProgramPartner partner = new ProgramPartner(organisationGuid, programGuid); IProgramPartnerService partnerSrv = ServiceFactory.GetProgramPartnerService(); partnerSrv.ProgramPartnerInsert(partner); Response.Redirect("ProgramData.aspx?progId=" + progId); break; } } } catch (Exception ex) { errorPanel.Exception = ex; } }
// ------------------------------------------------------------------------------------- /// <summary> /// Copy constructor. /// </summary> /// <param name="origInstance">Original document data to copy.</param> // ------------------------------------------------------------------------------------- public ProgramPartner(ProgramPartner origInstance) : base(origInstance) { }
private void gridPartners_ItemCommand(object source, DataGridCommandEventArgs e) { try { if (e.CommandName.ToLower().Equals("linktoorganisation")) { string orgId = e.CommandArgument.ToString(); Response.Redirect("OrganisationData.aspx?orgID=" + orgId); } if (e.CommandName.ToLower().Equals("delete")) { string orgId = e.CommandArgument.ToString(); string progId = Request["progid"]; Guid orgGuid = new Guid(orgId); Guid progGuid = new Guid(progId); ProgramPartner partner = new ProgramPartner(orgGuid, progGuid); IProgramPartnerService partnerSrv = ServiceFactory.GetProgramPartnerService(); partnerSrv.ProgramPartnerDelete(partner); ShowPartnerGrid(gridPartners, 0, null, null, progGuid); } } catch (Exception ex) { errorPanel.Exception = ex; } }