/// <summary> /// Updates the reference /// </summary> /// <returns>true if the update succeeded, false otherwise</returns> private bool UpdateReference() { Facade.IOrganisationReference facOrganisationReference = new Facade.Organisation(); string userId = ((Entities.CustomPrincipal)Page.User).UserName; return(facOrganisationReference.Update(m_reference, userId)); }
/// <summary> /// Updates the location /// </summary> /// <returns>true if the update succeeded, false otherwise</returns> private bool UpdateLocation() { Facade.IOrganisationLocation facOrganisationLocation = new Facade.Organisation(); string userId = ((Entities.CustomPrincipal)Page.User).UserName; Entities.FacadeResult result = facOrganisationLocation.Update(m_location, _individual, userId); if (!result.Success) { infringementDisplay.Infringements = result.Infringements; infringementDisplay.DisplayInfringments(); } m_location = facOrganisationLocation.GetLocationForOrganisationLocationId(m_location.OrganisationLocationId); cboTrafficArea.SelectedValue = m_location.Point.Address.TrafficArea.TrafficAreaId.ToString(); return(result.Success); }
private bool UpdateOrganisation() { Facade.IOrganisation facOrganisaton = new Facade.Organisation(); string userId = ((Entities.CustomPrincipal)Page.User).UserName; if (m_organisation.IdentityStatus == eIdentityStatus.Active && m_originalStatus == eIdentityStatus.Unapproved) { // Approve all the Points for this Client Customer too. Facade.IPoint facPoint = new Facade.Point(); bool success = facPoint.ApproveAllPointsForOganisation(m_organisation.IdentityId); } Entities.FacadeResult retVal = facOrganisaton.Update(m_organisation, userId); if (!retVal.Success) { infringementDisplay.Infringements = retVal.Infringements; infringementDisplay.DisplayInfringments(); infringementDisplay.Visible = true; } if (Globals.Configuration.ClientCustomerDeliveryNotificationEnabled) { Repositories.DTOs.GeofenceNotificationSettings settings = new Repositories.DTOs.GeofenceNotificationSettings(); settings.IdentityId = m_organisation.IdentityId; settings.Enabled = chkBoxEnableNotification.Checked; if (chkBoxEnableNotification.Checked) { settings.NotificationType = Convert.ToInt32(cbNotificationType.SelectedValue); settings.NotifyWhen = Convert.ToInt32(cbNotifyWhen.SelectedValue); settings.Recipient = txtContactDetail.Text; } facOrganisaton.AddOrUpdate(settings, userId); } return(retVal.Success); }
protected void btnApprovePoint_Click(object sender, EventArgs e) { int orderId = Convert.ToInt32(Request.QueryString["OrderId"].ToString()); int pointId = Convert.ToInt32(Request.QueryString["PointId"].ToString()); Facade.Point facPoint = new Orchestrator.Facade.Point(); Entities.Point point = facPoint.GetPointForPointId(pointId); Facade.IOrganisation facOrg = new Facade.Organisation(); Entities.Organisation org = facOrg.GetForName(point.OrganisationName); Entities.FacadeResult res = null; using (TransactionScope ts = new TransactionScope()) { if (org.IdentityStatus == eIdentityStatus.Unapproved) { // Set the identityStatus to approved org.IdentityStatus = eIdentityStatus.Active; facOrg.Update(org, this.Page.User.Identity.Name); } point.PointStateId = ePointState.Approved; res = facPoint.Update(point, this.Page.User.Identity.Name); ts.Complete(); } if (res.Success) { this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ApprovePoint", "window.opener.__doPostBack('','Refresh');window.close();", true); } else { idErrors.Infringements = res.Infringements; idErrors.DisplayInfringments(); idErrors.Visible = true; } }
protected void btnApproveOrganisation_Click(object sender, EventArgs e) { Facade.IOrganisation facOrganisation = new Facade.Organisation(); int organisationID = Convert.ToInt32(Request.QueryString["OrganisationID"].ToString()); this.Organisation = facOrganisation.GetForIdentityId(organisationID); this.Organisation.IdentityStatus = eIdentityStatus.Active; Entities.FacadeResult result = null; result = facOrganisation.Update(this.Organisation, this.Page.User.Identity.Name); if (result.Success) { this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ApprovePoint", "window.opener.__doPostBack('','Refresh');window.close();", true); } else { idErrors.Infringements = result.Infringements; idErrors.DisplayInfringments(); idErrors.Visible = true; } }