}// End getMilestoneList method. // ===================================================================================== /// <summary> /// This class returns a list of Alert objects based on the passed parameters. /// </summary> /// <param name="ProjectId">string: (Optional) The trial identifier.</param> /// <param name="Notification">Boolean: true, if the notification exists</param> /// <param name="OrgId">string: an organization identifier</param> /// <param name="State">EvAlert.AlertStates: (Optional) The alert state.</param> /// <param name="OrderBy">string: Sorting order.</param> /// <returns>List of EvAlert: a list of Alert object</returns> /// <remarks> /// This method consists of the following steps: /// /// 1. Exeute the method for retrieving the selection Alerts list /// /// 2. Return the selection list. /// /// </remarks> // ------------------------------------------------------------------------------------- public List <EvAlert> getView( string ProjectId, Boolean Notification, string OrgId, EvAlert.AlertStates State, string OrderBy) { this.LogMethod("getView method. "); this.LogDebug("ProjectId: " + ProjectId); this.LogDebug("OrgId: " + OrgId); this.LogDebug("State: " + State); // // Query the database. // List <EvAlert> view = this._dalProjectAlerts.getView( ProjectId, Notification, OrgId, String.Empty, State, EvAlert.AlertTypes.Null); this.LogDebug(this._dalProjectAlerts.Status); // // Return selectionList to UI // return(view); }//End getMilestoneList method.
}//End FilterViews method. // ===================================================================================== /// <summary> /// This class returns a list of option objects based on VisitId, OrgId, CurrentUser and State. /// </summary> /// <param name="Project">string: (Optional) The trial identifier.</param> /// <param name="OrgId">string: (Optional) The Organisation identifier.</param> /// <param name="CurrentUser">Evado.Model.Digital.EdUserProfile: (Optional) The user profile.</param> /// <param name="State">EvAlert.AlertStates: (Optional) The option state.</param> /// <returns>List of EvOption: A list of Options</returns> /// <remarks> /// This method consists of the following steps: /// /// 1. Get the Options list of selection alert objects /// /// 2. Filter the options list with the current user profile. /// /// 3. Return the filtered options list. /// </remarks> // ------------------------------------------------------------------------------------- public List <EvOption> getList( Model.Digital.EdApplication Project, String OrgId, Evado.Model.Digital.EdUserProfile CurrentUser, EvAlert.AlertStates State) { this.LogMethod("getList method."); this.LogDebug("ProjectId: " + Project.ApplicationId); this.LogDebug("OrgId: " + OrgId); this.LogDebug("UserName: "******"State: " + State); // // Get the list of trial alerts. // List <EvOption> list = this._dalProjectAlerts.getList( Project.ApplicationId, OrgId, CurrentUser.CommonName, State, false); this.LogDebug(this._dalProjectAlerts.Status); // // Filter the studies based on user profile. // this.FilterLists(CurrentUser, Project, list); // // Return selectionList to UI // return(list); }//End getList method.
// ===================================================================================== /// <summary> /// This class returns a list of Alert objects based on the passed parameters. /// </summary> /// <param name="Project">Evado.Model.Digital.EvProject: The project identifier.</param> /// <param name="ProjectOrganisation">Evado.Model.Digital.EvOrganisation: The Current User profile.</param> /// <param name="CurrentUser">Evado.Model.Digital.EdUserProfile: The Current User profile.</param> /// <param name="AlertState">EvAlert.AlertStates: (Optional) The alert state.</param> /// <param name="AlertType">EvAlert.AlertTypes: (Optional) The alert QueryType.</param> /// <returns>List of EvAlert: a list of Alert object</returns> /// <remarks> /// This method consists of the following steps: /// /// 1. Exeute the method for retrieving the selection Alerts list /// /// 2. Return the selection list. /// /// </remarks> // ------------------------------------------------------------------------------------- public List <EvAlert> getView( Evado.Model.Digital.EdUserProfile CurrentUser, EvAlert.AlertStates AlertState, EvAlert.AlertTypes AlertType) { this.LogMethod("getView method. "); this.LogDebug("UserName: "******"Alert State: " + AlertState); // // Initialise the methods variables and objects. // String orgId = String.Empty; Boolean bNotification = false; // // Set the bNotification and userCommonName to default values, // if the role is ProjectManager or Monitor or Sponsor. // if (CurrentUser.hasManagementAccess == true) { bNotification = true; orgId = String.Empty; } this.LogDebug("bNotification: " + bNotification); this.LogDebug("orgId: " + orgId); // // Get the list of raised alerts. // List <EvAlert> view = this._dalProjectAlerts.getView( Project.ApplicationId, bNotification, orgId, String.Empty, AlertState, AlertType); this.LogDebug(this._dalProjectAlerts.Status); // // Filter the studies based on user profile. // this.FilterViews(CurrentUser, Project, view); // // Return selectionList to UI // return(view); }//End getMilestoneList method.
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region class public methods // ===================================================================================== /// <summary> /// This class sets the value according with the field name. /// </summary> /// <param name="fieldname">AlertFieldNames: an alert's field name</param> /// <param name="Value">string: an alert's value</param> /// <returns> Evado.Model.EvEventCodes: an event code</returns> /// <remarks> /// This method consists of the following steps: /// /// 1. Initialize the local variables and objects of the method including: date, status and type /// /// 2. Switch the fieldname and update value for the property defined by the alert field names. /// </remarks> // ------------------------------------------------------------------------------------ public Evado.Model.EvEventCodes setValue(EvAlert.AlertFieldNames fieldname, string Value) { // // Initialise the methods local variables and objects. // DateTime date = EvcStatics.CONST_DATE_NULL; EvAlert.AlertStates status = EvAlert.AlertStates.Null; EvAlert.AlertTypes type = EvAlert.AlertTypes.Null; // // The switch determines the item to be updated. // switch (fieldname) { case EvAlert.AlertFieldNames.Alert_Id: { this._AlertId = Value; break; } case EvAlert.AlertFieldNames.Trial_Id: { this._ProjectId = Value; break; } case EvAlert.AlertFieldNames.To_Org_Id: { this._ToOrgId = Value; break; } case EvAlert.AlertFieldNames.To_User: { this._ToUser = Value; break; } case EvAlert.AlertFieldNames.Alert_Subject: { this._Subject = Value; break; } case EvAlert.AlertFieldNames.New_Message: this._NewMessage = Value; break; case EvAlert.AlertFieldNames.Message: this._Message = Value; break; case EvAlert.AlertFieldNames.From_User_UserId: this._FromUserUserId = Value; break; case EvAlert.AlertFieldNames.From_User: this.FromUser = Value; break; case EvAlert.AlertFieldNames.Raised_Date: if (DateTime.TryParse(Value, out date) == true) { this._Raised = date; break; } else { return(Evado.Model.EvEventCodes.Data_Date_Casting_Error); } case EvAlert.AlertFieldNames.Acknowledged_By_UserId: { this._AcknowledgedByUserId = Value; break; } case EvAlert.AlertFieldNames.Acknowledged_By: { this._AcknowledgedBy = Value; break; } case EvAlert.AlertFieldNames.Acknowledged_Date: if (DateTime.TryParse(Value, out date) == true) { this._Acknowledged = date; break; } else { return(Evado.Model.EvEventCodes.Data_Date_Casting_Error); } case EvAlert.AlertFieldNames.Closed_By_UserId: { this._ClosedByUserId.ToString( ); break; } case EvAlert.AlertFieldNames.Closed_By: { this._ClosedBy = Value; break; } case EvAlert.AlertFieldNames.Closed_Date: if (DateTime.TryParse(Value, out date) == true) { this._Closed = date; break; } else { return(Evado.Model.EvEventCodes.Data_Date_Casting_Error); } case EvAlert.AlertFieldNames.Type_Id: { if (Evado.Model.EvStatics.tryParseEnumValue <EvAlert.AlertTypes> (Value, out type) == false) { return(Evado.Model.EvEventCodes.Data_Enumeration_Casting_Error); } this._TypeId = type; break; } case EvAlert.AlertFieldNames.Alert_State: { if (Evado.Model.EvStatics.tryParseEnumValue <EvAlert.AlertStates> (Value, out status) == false) { return(Evado.Model.EvEventCodes.Data_Enumeration_Casting_Error); } this._State = status; break; } default: return(0); }//END Switch return(0); }//END getValue method