// ================================================================================== /// <summary> /// This method appends EVENT to the class log /// a new line at the end of the text. /// </summary> /// <param name="Ex">Exception object.</param> // ---------------------------------------------------------------------------------- public void LogException ( Exception Ex ) { String value = "NameSpace: " + this.ClassNameSpace + "\r\nUser: "******"\r\nCommonName: " + this.Session.UserProfile.CommonName + "\r\n" + EvStatics.getException ( Ex ); // // Initialise the method variables // EvApplicationEvent applicationEvent = new EvApplicationEvent ( EvApplicationEvent.EventType.Error, EvEventCodes.Ok, this.ClassNameSpace, value, this.Session.UserProfile.UserId ); this.AddEvent ( applicationEvent ); if ( this._ClassParameters.LoggingLevel >= 0 ) { this._AdapterLog.AppendLine ( DateTime.Now.ToString ( "dd-MM-yy hh:mm:ss" ) + " EXCEPTION EVENT: " ); this._AdapterLog.AppendLine ( value ); } }//END LogException class
}//END LogEvent class // ================================================================================== /// <summary> /// This method appends EVENT to the class log /// a new line at the end of the text. /// </summary> /// <param name="Ex">Exception object.</param> // ---------------------------------------------------------------------------------- protected void LogException(Exception Ex) { String value = "NameSpace: " + this.ClassNameSpace + "\r\nUser: "******"\r\nUserCommonName: " + this.ClassParameters.UserProfile.CommonName + "\r\n" + EvStatics.getException(Ex); // // Initialise the method variables // EvApplicationEvent applicationEvent = new EvApplicationEvent( EvApplicationEvent.EventType.Error, EvEventCodes.Ok, this.ClassNameSpace, value, this.ClassParameters.UserProfile.UserId); this.AddEvent(applicationEvent); // // Add to the local log. // this._Log.AppendLine(DateTime.Now.ToString("dd-MM-yy hh:mm:ss") + " EXCEPTION EVENT: "); this._Log.AppendLine(value); }//END LogException class
} // END DeleteItem method // ===================================================================================== /// <summary> /// Description: /// Creates or Updates the user profile in the ADS. /// </summary> /// <param name="UserToSave">EvAdsUserProfile</param> /// <param name="UserToSave">EvAdsUserProfile</param> /// <param name="OutEvUser">EvAdsUserProfile</param> // ------------------------------------------------------------------------------------- public EvAdsCallResult SaveItem( EvAdsUserProfile UserToSave, bool isCreatingNewUser, out EvAdsUserProfile OutEvUser) { this.LogMethod("SaveItem method."); this.LogValue("UserToSave.SamAccountName: " + UserToSave.SamAccountName); this.LogValue("isCreatingNewUser: "******"UserToSave.Password: "******"ACTION: SaveItem"); return(EvAdsCallResult.Invalid_Argument); } else { if (isCreatingNewUser == true && callResult == EvAdsCallResult.Object_Not_Found) { OutEvUser = _evAdFacade.CreateNewUser(UserToSave); this.LogMethod_End("ACTION: CreateNewUser"); } else { if (isCreatingNewUser == false && callResult == EvAdsCallResult.Success) { this.LogValue("ACTION: UpdatE user"); OutEvUser = _evAdFacade.UpdateAdUser(UserToSave); } } } } catch (Exception Ex) { this.LogValue(EvStatics.getException(Ex)); } this.LogAssembly(this._evAdFacade.Log); this.LogMethod_End("SaveItem"); return(EvAdsCallResult.Success); }
}//END LogEvent class // ================================================================================== /// <summary> /// This method appends EVENT to the class log /// a new line at the end of the text. /// </summary> /// <param name="Ex">Exception object.</param> // ---------------------------------------------------------------------------------- protected void LogEvent(Exception Ex) { if (this._Settings.LoggingLevel >= 0) { this._Log.AppendLine(DateTime.Now.ToString("dd-MM-yy hh:mm:ss") + " EXCEPTION EVENT: "); this._Log.AppendLine(EvStatics.getException(Ex)); } }//END LogEvent class
// ================================================================================== /// <summary> /// This method appends EVENT to the class log /// a new line at the end of the text. /// </summary> /// <param name="Ex">Exception object.</param> // ---------------------------------------------------------------------------------- public void LogException ( Exception Ex ) { String value = "NameSpace: " + IntegrationServices.CONST_NAME_SPACE + "\r\n" + EvStatics.getException ( Ex ); if ( _LoggingLevel >= 0 ) { this._ApplicationLog.AppendLine ( DateTime.Now.ToString ( "dd-MM-yy hh:mm:ss" ) + " EXCEPTION EVENT: " ); this._ApplicationLog.AppendLine ( value ); } }//END LogException class
//=================================================================================== /// <summary> /// This method set the form record type. /// </summary> /// <param name="FormType">EvFormRecordTypes enumerated list</param> //----------------------------------------------------------------------------------- public void SetLayoutType(String FormType) { EdRecordTypes recordType = EdRecordTypes.Null; if (EvStatics.tryParseEnumValue <EdRecordTypes> (FormType, out recordType) == true) { this.RecordLayoutTypeSelection = recordType; } this.RecordLayoutTypeSelection = EdRecordTypes.Null; }
}//END ExportTableSpacer method. // ================================================================================== /// <summary> /// This class generates the export ResultData output. /// </summary> /// <param name="FormField">EvFormField: a formfield object</param> /// <param name="ExportFreeText">Boolean: true, if the free text fields are exported</param> /// <returns>string: an export record field ResultData string</returns> /// <remarks> /// This method consists of the following steps: /// /// 1. Switch the header field object's QueryType and export the associated ResultData. /// /// 2. Return the export record field ResultData string, if the types that have values. /// /// 3. Else, return empty string. /// </remarks> // ---------------------------------------------------------------------------------- private bool getExportRecordFieldData(EdRecordField FormField, bool ExportFreeText) { // // Select the field QueryType to export. // switch (FormField.TypeId) { case EvDataTypes.Numeric: { this.exportColumnValue(FormField.FieldId, FormField.ItemValue); return(true); } case EvDataTypes.Table: case EvDataTypes.Special_Matrix: { this.ExportTableData(FormField); return(true); } case EvDataTypes.Check_Box_List: { this.ExportCheckBoxData(FormField); return(true); } case EvDataTypes.Boolean: { string value = EvStatics.encodeCsvBoolean(FormField.ItemValue); this.exportColumnValue(FormField.FieldId, value); return(true); } case EvDataTypes.Free_Text: { if (ExportFreeText == true) { this.exportColumnValue(FormField.FieldId, FormField.ItemValue); } return(true); } default: { this.exportColumnValue(FormField.FieldId, FormField.ItemValue); return(true); } } //END Switch } //ENd getExportData
}//END Method #region generate test case methods. // ================================================================================== /// <summary> /// This method geneates the app data test cases. /// </summary> // ---------------------------------------------------------------------------------- private void generateTestCases ( ) { this.LogMethod ( "generateTestCases" ); // // Initialise the methods variables and objects. // EutAction action = new EutAction ( ); // // Create test case for application object title. // action = new EutAction ( ); action.Action = EutCommand.Test_Application_Title; action.setParameter ( EutCommandParameters.Value, this._ClientData.Title ); this._TestCaseList.Add ( action ); // // Create test case for page object title. // action = new EutAction ( ); action.Action = EutCommand.Test_Page_Title; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, this._ClientData.Page.Title ); this._TestCaseList.Add ( action ); // // Create test case for page object status. // action = new EutAction ( ); action.Action = EutCommand.Test_Page_Status; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, this._ClientData.Page.EditAccess.ToString ( ) ); this._TestCaseList.Add ( action ); // // Create test case for page group object title. // this.generateGroupTestCases ( ); }//END method
// ================================================================================== /// <summary> /// This method reads the content of the data row object containing a query result /// into an Activity Record object. /// </summary> /// <param name="Row">DataRow: a data row record object</param> /// <returns>EvActivityForm: a data row object</returns> /// <remarks> /// This method consists of the following steps: /// /// 1. Extract the data object values from the data row object and add to the activity form object. /// /// 2. Return the activity form object. /// </remarks> // ---------------------------------------------------------------------------------- private EvObjectParameter readDataRow(DataRow Row) { // // Initialise application parameter object // EvObjectParameter parameter = new EvObjectParameter( ); // // Extract the data object values from the data row object and add to the activity form object. // parameter.Guid = EvSqlMethods.getGuid(Row, "OBJ_GUID"); parameter.Order = EvSqlMethods.getInteger(Row, "OBP_ORDER"); parameter.Name = EvSqlMethods.getString(Row, "OBP_NAME"); parameter.DataType = EvStatics.parseEnumValue <EvDataTypes> (EvSqlMethods.getString(Row, "OBP_TYPE")); parameter.Value = EvSqlMethods.getString(Row, "OBP_VALUE"); parameter.Options = EvSqlMethods.getString(Row, "OBP_OPTIONS"); // // Return the application parameter object. // return(parameter); }// End readDataRow method.
}//END exportProjectRecords method //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region export methods // ===================================================================================== /// <summary> /// This method creates the content for the common record export file as a CSV file. /// </summary> /// <param name="FormRecordList">List of EvForm: a list of form objects</param> /// <param name="UserProfile">Evado.Digital.Model.EdUserProfile: The user profile.</param> /// <param name="IncludeFreeTextData">Boolean: True, if the free text fields are exported.</param> /// <param name="IncludeDraftRecords">Boolean: True, if the initialised records are included</param> /// <returns>String: an export file string. </returns> /// <remarks> /// This method consists of the following steps: /// /// 1. Exit, if the form objects list is empty. /// /// 2. Loop through the form list and the associated form field list. /// /// 3. Add the formfield list's values to the output string. /// /// 4. Return the output string. /// </remarks> // ---------------------------------------------------------------------------------- public String createExportFile( System.Collections.Generic.List <EdRecord> FormRecordList, Evado.Digital.Model.EdUserProfile UserProfile, bool IncludeFreeTextData, bool IncludeDraftRecords) { this.LogMethod("createExportFile method "); this.LogDebug("IncludeFreeTextData:" + IncludeFreeTextData); this.LogDebug("IncludeDraftRecords:" + IncludeDraftRecords); try { // // Initialise the methods variables and objects. // EdRecord headerForm = new EdRecord( ); System.Text.StringBuilder stCsvData = new System.Text.StringBuilder( ); // // Only process the common records if more than one exists. // if (FormRecordList.Count == 0) { this.LogDebug("FormRecordList count is zero."); this.EventCode = EvEventCodes.Data_Export_Empty_Record_List; this.LogMethodEnd("createExportFile"); return(stCsvData.ToString( )); } // // Using the last record get a form header i.e. the latest version. // headerForm = FormRecordList [(FormRecordList.Count - 1)]; // // Create the report header // stCsvData.AppendLine(Evado.Digital.Model.EvcStatics.encodeCsvFirstColumn("Form Type: " + EvStatics.getEnumStringValue(headerForm.TypeId))); stCsvData.AppendLine(Evado.Digital.Model.EvcStatics.encodeCsvFirstColumn("FormId: " + headerForm.LayoutId)); stCsvData.AppendLine(Evado.Digital.Model.EvcStatics.encodeCsvFirstColumn("Form Title: " + headerForm.Title)); stCsvData.AppendLine(Evado.Digital.Model.EvcStatics.encodeCsvFirstColumn("Exported on: " + DateTime.Now.ToString("dd MMM yyyy HH:mm") + " By " + UserProfile.CommonName)); this.LogDebug("Form Type: " + headerForm.Design.TypeId); this.LogDebug("FormId: " + headerForm.LayoutId); this.LogDebug("Form Title: " + headerForm.Title); this.LogDebug("Exported on: " + DateTime.Now.ToString("dd MMM yyyy HH:mm") + " By " + UserProfile.CommonName); // // Ouput the ResultData header. // this._OutputDataColumnCount = this.createExportRecordHeader(headerForm, IncludeFreeTextData); // // Append the CSV data header row. // stCsvData.AppendLine(this.ConvertToCsv(this._ExportColumnHeader)); this.LogDebug("Commence export record data."); // // Iterate through the datagrid processing each letter in the grid // foreach (EdRecord record in FormRecordList) { this._ExportColumnRow = new string [this._OutputDataColumnCount]; // // IF the item is a valid record output it. // if (record.State == EdRecordObjectStates.Withdrawn) { this.LogDebug("RecordID: " + record.RecordId + " >> Withdrawn or querid record."); continue; } if (record.State == EdRecordObjectStates.Draft_Record && IncludeDraftRecords == false) { this.LogDebug("RecordID: " + record.RecordId + " >> Initialised record."); continue; } this.LogDebug("RecordID: " + record.RecordId); this.LogDebug("Field Count: " + record.Fields.Count); // // Output the record left hand static fields. // this._ExportColumnRow [0] = record.RecordId; this._ExportColumnRow [1] = record.stRecordDate; // // Output the record fields // foreach (EdRecordField recordField in record.Fields) { this.LogDebug("FieldId: " + recordField.FieldId); this.LogDebug("field Type: " + recordField.TypeId); this.LogDebug("Field Guid: " + recordField.Guid); this.LogDebug("ItemValue: " + recordField.ItemValue); this.LogDebug("ItemText: " + recordField.ItemText); if (recordField.isReadOnly == true) { continue; } // // Export form field // if (recordField.Guid == Guid.Empty) { continue; } // // select the field type to export. // switch (recordField.TypeId) { case EvDataTypes.Special_Matrix: case EvDataTypes.Table: { this.ExportTableData(recordField); break; } case EvDataTypes.Check_Box_List: { this.ExportCheckBoxData(recordField); break; } default: { this.getExportRecordFieldData( recordField, IncludeFreeTextData); break; } } //END switch statement } //END field iteration loop. this.LogDebug("Comment.Count: " + record.CommentList.Count); String stComments = String.Empty; foreach (EdFormRecordComment comment in record.CommentList) { stComments += comment.Content + " by " + comment.UserCommonName + " on " + comment.CommentDate.ToString("dd-MMM-yy HH:mm") + " "; } // // record footer information // this.exportColumnValue(StaticHeaderColumns.Comments, stComments); // // Convert the output row into a CSV row. // stCsvData.AppendLine(this.ConvertToCsv(this._ExportColumnRow)); }//END record list iteration loop this.LogDebug("ExportFile length: " + stCsvData.Length); this.LogMethodEnd("createExportFile"); // // Return the new record. // return(stCsvData.ToString( )); } //End Try catch (Exception Ex) { this.EventCode = EvEventCodes.Data_Export_Exception_Event; this.LogException(Ex); } // End catch. this.LogMethodEnd("createExportFile"); return(String.Empty); }//END createExportFile class
}//END loadSelectionLists method /// ======================================================================================= /// <summary> /// This method loads the navigational page identifiers list for all static, entities and record layouts /// </summary> // --------------------------------------------------------------------------------- public void LoadPageIdentifiers( ) { this.LogInitMethod("LoadPageIdentifiers method"); if (EuAdapter.AdapterObjects.PageIdentifiers == null) { EuAdapter.AdapterObjects.PageIdentifiers = new List <EvOption> ( ); } if (EuAdapter.AdapterObjects.PageIdentifiers.Count > 0) { return; } // // Initialise the methods variables and objects. // EuAdapter.AdapterObjects.PageIdentifiers = new List <EvOption> ( ); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption( )); // // add the static page identifiers. // #region static page identifiers. //this.LogInit ( "Generating the Static PageId list" ); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Home_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Access_Denied)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Alert_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Alert_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Ancillary_Record_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Ancillary_Record_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Application_Event)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Application_Event_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Application_Profile)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Database_Version)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Email_User_Page)); //this._AdapterObjects.PageIdentifiers.Add ( EvStatics.getOption ( Evado.Digital.Model.EdStaticPageIds.Data_Dictionary_View ) ); //this._AdapterObjects.PageIdentifiers.Add ( EvStatics.getOption ( Evado.Digital.Model.EdStaticPageIds.Data_Dictionary_Page ) ); //this._AdapterObjects.PageIdentifiers.Add ( EvStatics.getOption ( Evado.Digital.Model.EdStaticPageIds.Data_Dictionary_Upload ) ); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Form_Draft_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Form_Properties_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Form_Properties_Section_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Form_Field_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Form_Template_Upload)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Form_Template_Download)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Email_Templates_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Entity_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Entity_Admin_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Entity_Export_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Entity_Layout_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Entity_Layout_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Entity_Filter_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Entity_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Login_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Menu_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Menu_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Operational_Report_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Operational_Report_List)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Organisation_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Organisation_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Page_Layout_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Page_Layout_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Page_Layout_Upload)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Report_Saved_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Report_Template_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Report_Template_Column_Selection_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Report_Template_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Report_Template_Upload)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Report_Template_Download)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Record_Admin_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Record_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Records_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Record_Layout_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Record_Layout_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Selection_List_Upload)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Selection_List_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.Selection_List_View)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.User_DownLoad_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.User_Profile_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.My_User_Profile_Update_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.User_Profile_Password_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.User_Upload_Page)); EuAdapter.AdapterObjects.PageIdentifiers.Add(EvStatics.getOption(Evado.Digital.Model.EdStaticPageIds.User_View)); #endregion this.LogInit("Generating the PageLayout PageId list"); // // dynamic page identifiers for Entities by LayoutId // foreach (EdPageLayout pageLayout in EuAdapter.AdapterObjects.AllPageLayouts) { if (pageLayout.State != EdPageLayout.States.Issued) { continue; } String pageId = EuAdapter.CONST_PAGE_ID_PREFIX + pageLayout.PageId; String pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > UserType {3} ", pageId, pageLayout.PageId, pageLayout.Title, pageLayout.UserTypes); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageId + " - " + pageLayout.Title)); }//END page list iteration //this.LogInit ( "Generating the Entities PageId list" ); // // dynamic page identifiers for Entities by LayoutId // foreach (EdRecord entityLayout in EuAdapter.AdapterObjects.AllEntityLayouts) { if (entityLayout.State != EdRecordObjectStates.Form_Issued) { this.LogInit("NOT ISSUED: {0} - {1} > ParentType {2} ", entityLayout.LayoutId, entityLayout.Title, entityLayout.Design.ParentType); continue; } String pageId = EuAdapter.CONST_ENTITY_PREFIX + entityLayout.LayoutId; String pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, entityLayout.LayoutId, entityLayout.Title, entityLayout.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); pageId = EuAdapter.CONST_ENTITY_PREFIX + entityLayout.LayoutId + EuAdapter.CONST_AUTHOR_PAGE_ID_SUFFIX; pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, entityLayout.LayoutId, entityLayout.Title, entityLayout.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); pageId = EuAdapter.CONST_ENTITY_PREFIX + entityLayout.LayoutId + EuAdapter.CONST_ENTITY_FILTERED_LIST_SUFFIX; pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, entityLayout.LayoutId, entityLayout.Title, entityLayout.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); // // add the page identifier for child entities. // switch (entityLayout.Design.ParentType) { case EdRecord.ParentTypeList.Organisation_Default: { pageId = EuAdapter.CONST_ENTITY_PREFIX + entityLayout.LayoutId + EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX2; pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, entityLayout.LayoutId, entityLayout.Title, entityLayout.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); break; } case EdRecord.ParentTypeList.Organisation: { pageId = EuAdapter.CONST_ENTITY_PREFIX + entityLayout.LayoutId + EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX; pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, entityLayout.LayoutId, entityLayout.Title, entityLayout.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); break; } case EdRecord.ParentTypeList.User_Default: { pageId = EuAdapter.CONST_ENTITY_PREFIX + entityLayout.LayoutId + EuAdapter.CONST_USER_PARENT_PAGE_ID_SUFFIX2; pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, entityLayout.LayoutId, entityLayout.Title, entityLayout.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); break; } case EdRecord.ParentTypeList.User: { pageId = EuAdapter.CONST_ENTITY_PREFIX + entityLayout.LayoutId + EuAdapter.CONST_USER_PARENT_PAGE_ID_SUFFIX; pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, entityLayout.LayoutId, entityLayout.Title, entityLayout.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); break; } case EdRecord.ParentTypeList.Entity: { pageId = EuAdapter.CONST_ENTITY_PREFIX + entityLayout.LayoutId + EuAdapter.CONST_ENTITY_PARENT_PAGE_ID_SUFFIX; pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, entityLayout.LayoutId, entityLayout.Title, entityLayout.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); break; } } //END switch statement. } //END Entity list iteration //this.LogInit ( "Generating the Records PageId list" ); // // dynamic page identifiers for Entities by LayoutId // foreach (EdRecord recordLayouts in EuAdapter.AdapterObjects.AllRecordLayouts) { if (recordLayouts.State != EdRecordObjectStates.Form_Issued) { continue; } String pageId = EuAdapter.CONST_RECORD_PREFIX + recordLayouts.LayoutId; String pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, recordLayouts.LayoutId, recordLayouts.Title, recordLayouts.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); // // add the page identifier for child entities. // switch (recordLayouts.Design.ParentType) { case EdRecord.ParentTypeList.Organisation: { pageId = EuAdapter.CONST_RECORD_PREFIX + recordLayouts.LayoutId + EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX; pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, recordLayouts.LayoutId, recordLayouts.Title, recordLayouts.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); break; } case EdRecord.ParentTypeList.User: { pageId = EuAdapter.CONST_RECORD_PREFIX + recordLayouts.LayoutId + EuAdapter.CONST_USER_PARENT_PAGE_ID_SUFFIX; pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, recordLayouts.LayoutId, recordLayouts.Title, recordLayouts.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); break; } case EdRecord.ParentTypeList.Entity: { pageId = EuAdapter.CONST_RECORD_PREFIX + recordLayouts.LayoutId + EuAdapter.CONST_ENTITY_PARENT_PAGE_ID_SUFFIX; pageLabel = pageId.Replace("_", " "); this.LogInit("{0} = {1} - {2} > ParentType {3} ", pageId, recordLayouts.LayoutId, recordLayouts.Title, recordLayouts.Design.ParentType); EuAdapter.AdapterObjects.PageIdentifiers.Add(new EvOption(pageId, pageLabel)); break; } } //END switch statement. } //END Record list iteration this.LogInit("PageIdentifiers.Count: " + EuAdapter.AdapterObjects.PageIdentifiers.Count); this.LogInitMethodEnd("LoadPageIdentifiers method"); }//END LoadPageIdentifiers method
public Stream updateTokenUserProfileService(string ClientVersion, Stream content) { Global.ClearApplicationLog( ); this.LogMethod("updateTokenUserProfileService web service"); this.LogDebug("ClientVersion content {0}", ClientVersion); String SessionId = String.Empty; try { // // Initialise the methods variables and object. // string json = String.Empty; Evado.Model.EusTokenUserProfile tokenUserProfile = new Evado.Model.EusTokenUserProfile( ); String hostUrl = this._Context.Request.Headers ["Host"]; this.LogDebug("hostUrl: {0} ", hostUrl); this.LogDebug("Request.Url: {0} ", this._Context.Request.Url); this.LogDebug("Request.UserHostAddress: {0} ", this._Context.Request.UserHostAddress); this.LogDebug("Request.UserHostName: {0} ", this._Context.Request.UserHostName); if (Global.ValidTokenUserProfileIpAddresses.Contains(this._Context.Request.UserHostAddress) == false) { this.LogDebug("ValidTokenUserProfileIpAddresses NOT found"); return(this.WebServiceResponse("ERROR")); } // // first load the POST payload into a string // the POST content comes from the content param above // as it is the only param that is not listed in the URI template // string content_value = new StreamReader(content).ReadToEnd( ); this.LogDebug("Post content \r\n{0}", content_value); // // Log the transaction if (content_value == String.Empty) { return(this.WebServiceResponse("ERROR")); } // // serialise the client groupCommand // Evado.Model.EusTokenUserProfile UserProfie = JsonConvert.DeserializeObject <Evado.Model.EusTokenUserProfile> (content_value); this.LogDebug("AppId: " + UserProfie.ApplicationID); this.LogDebug("TokenId: " + UserProfie.Token); this.LogDebug("UserId: " + UserProfie.UserId); this.LogDebug("GivenName: " + UserProfie.GivenName); this.LogDebug("FamilyName: " + UserProfie.FamilyName); this.LogDebug("EmailAddress: " + UserProfie.EmailAddress); this.LogDebug("UserType: " + UserProfie.UserType); this.LogDebug("UserStatus: " + UserProfie.UserStatus); EvEventCodes result = this.UpdateTokenUserProfile(UserProfie); // // send the web service response to the device app. // return(this.WebServiceResponse(result.ToString())); } catch (Exception Ex) { string EventMessage = "Evado.Digital.WebService.TokenService event method.\r\n" + EvStatics.getException(Ex); this.LogEvent(EventMessage); return(WebServiceResponse(EvEventCodes.Token_User_Profile_Update_Error.ToString())); } // Close catch } //END Create web method.
}//ENd LogEvent method // ================================================================================= /// <summary> /// This static method removes a user from the online user list. /// /// </summary> // --------------------------------------------------------------------------------- private void LogEvent(Exception Value) { String value = EvStatics.getException(Value); this.LogEvent(value); }//END LogEvent method
}//END generateGroupTestCases method // ================================================================================== /// <summary> /// This method creates page group test cases. /// </summary> // ---------------------------------------------------------------------------------- private void generateGroupFieldsTestCases ( Group group ) { this.LogMethod ( "generateFieldsTestCases" ); // // Initialise the methods variables and objects. // EutAction action = new EutAction ( ); // // Create test case for page field title. // foreach ( Field field in group.FieldList ) { action = new EutAction ( ); action.Action = EutCommand.Test_Field_Title; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, field.Title ); this._TestCaseList.Add ( action ); // // Create test case for field status. // action = new EutAction ( ); action.Action = EutCommand.Test_Group_Edit_Status; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, field.EditAccess.ToString ( ) ); this._TestCaseList.Add ( action ); // // Create test case for field layout. // action = new EutAction ( ); action.Action = EutCommand.Test_Group_Layout_Setting; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, field.Layout.ToString ( ) ); // // Create test case for field data type. // action = new EutAction ( ); action.Action = EutCommand.Test_Field_Data_Type; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, field.Type.ToString ( ) ); this._TestCaseList.Add ( action ); // // Create test case for field is mandatory setting // action = new EutAction ( ); action.Action = EutCommand.Test_Field_Mandatory; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, field.Mandatory.ToString ( ) ); this._TestCaseList.Add ( action ); // // Create test case for field identifier // action = new EutAction ( ); action.Action = EutCommand.Test_Field_Identifier; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, field.FieldId.ToString ( ) ); this._TestCaseList.Add ( action ); // // Create test case for group parameters // foreach ( Parameter prm in field.Parameters ) { action = new EutAction ( ); action.Action = EutCommand.Test_Field_Parameter_Value; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Parameter_Name, prm.Name ); action.setParameter ( EutCommandParameters.Value, prm.Value ); this._TestCaseList.Add ( action ); }//END parameter interation loop. }//END iteration loop }//END generateGroupTestCases method
//=================================================================================== /// <summary> /// This value checks that a parameter exists in the test action /// /// </summary> /// <param name="Parameter">EuTestActionParameters enumerated value.</param> /// <returns>Bool: True indicates the parameter exists.</returns> //----------------------------------------------------------------------------------- public bool createParameterList ( ) { // // If option list exists then exit as it does not need to be created. // if ( this._optionList.Count > 0 ) { return true; } // // If there are no parameters then exit with error as nothing can be created. // if ( this._Parameters == String.Empty ) { return false; } // // initialise the methods variables and objects. // string [ ] arParameters = this._Parameters.Split ( ';' ); EutCommandParameters enParameter = EutCommandParameters.Null; this.AddResponse = String.Empty; // // Iterate through the parameters array creating a parameter list. // foreach ( String parameter in arParameters ) { // // exit is parmeter is empty. // if ( parameter == String.Empty ) { return false; } // // exit is parmeter is empty. // if ( parameter.Contains ( "=" ) == false ) { return false; } int eqIndex = parameter.IndexOf ( '=' ); string parmeterName = parameter.Substring ( 0, eqIndex ); String parmeterValue = parameter.Substring ( eqIndex + 1 ); parmeterName = parmeterName.Trim ( ); // // validate that the parameter is valid. // if ( EvStatics.tryParseEnumValue<EutCommandParameters> ( parmeterName, out enParameter ) == false ) { this.Result = EutCommandResults.Parameter_Validation_Failure; this.AddResponse = "Parameter : " + parmeterName + " failed type validation. "; return false; } this._optionList.Add ( new EutParameter ( enParameter, parmeterValue.Trim ( ) ) ); }//End parameter iteration loop. // // test to see if the value value needs to be reversed. // this.hasReverseStatus ( ); return true; }//END createParameterList method
}//END method // ================================================================================== /// <summary> /// This methods returns a pageMenuGroup object contains a selection of applicationEvents. /// </summary> /// <param name="PageObject">Evado.UniForm.Model.Page object</param> /// <returns>Evado.UniForm.Model.Group object</returns> // --------------------------------------------------------------------------------- public void getSelectionGroup ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getSelectionGroup" ); this.LogValue ( "EventStartDate: " + this.Session.EventStartDate ); this.LogValue ( "EventFinishDate: " + this.Session.EventFinishDate ); // // initialise the methods variables and objects. // Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( ); DateTime rangeStartDate = EvStatics.getDateTime ( "1 jan 2020" ); DateTime rangeFinishDate = DateTime.Now.AddDays ( 1 ); // // create the selection group. // Evado.UniForm.Model.Group selectionGroup = PageObject.AddGroup ( EdLabels.ApplicationEvent_Selection_Group_Title, Evado.UniForm.Model.EditAccess.Enabled ); selectionGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; // // Set the selection to the start date // groupField = selectionGroup.createDateField ( EuApplicationEvents.CONST_START_DATE_FIELD_ID, EdLabels.ApplicationEvent_Start_Date_Selection_Field_Label, this.Session.EventStartDate, rangeStartDate, rangeFinishDate ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // Set the selection to the start date // groupField = selectionGroup.createDateField ( EuApplicationEvents.CONST_FINISH_DATE_FIELD_ID, EdLabels.ApplicationEvent_Finish_Date_Selection_Field_Label, this.Session.EventFinishDate, rangeStartDate, rangeFinishDate ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // get the list of event codes. // if ( this.AdapterObjects.EventCodeSelectionList.Count == 0 ) { this.AdapterObjects.EventCodeSelectionList = Evado.Model.EvStatics.getOptionsFromEnum ( typeof ( EvEventCodes ), true ); Evado.Digital.Model.EvcStatics.sortOptionListValues ( this.AdapterObjects.EventCodeSelectionList ); } // // Set the selection to the event id // groupField = selectionGroup.createSelectionListField ( EuApplicationEvents.CONST_EVENT_FIELD_ID, EdLabels.ApplicationEvent_Event_Id_Selection_Field_Label, this.Session.EventId.ToString ( ), this.AdapterObjects.EventCodeSelectionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // get the list of event ids. // List<EvOption> optionList = Evado.Model.EvStatics.getOptionsFromEnum ( typeof ( EvApplicationEvent.EventType ), true ); // // Set the selection to the type id // groupField = selectionGroup.createSelectionListField ( EuApplicationEvents.CONST_TYPE_FIELD_ID, EdLabels.ApplicationEvent_Type_Selection_Field_Label, this.Session.EventType, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // Set the selection to the USER Name // Evado.Digital.Model.EvcStatics.sortOptionListValues ( this.Session.EventUserSelectionList ); groupField = selectionGroup.createSelectionListField ( EuApplicationEvents.CONST_USER_FIELD_ID, EdLabels.ApplicationEvent_UserName_Selection_Field_Label, this.Session.EventUserName, this.Session.EventUserSelectionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // Create a custom groupCommand to process the selection. // Evado.UniForm.Model.Command customCommand = selectionGroup.addCommand ( EdLabels.ApplicationEvent_Selection_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Events.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); // // Set the custom groupCommand parameter. // customCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); }//END getSelectionGroup method
}//END hasTestParameter value //=================================================================================== /// <summary> /// This value set a class member value. /// </summary> //----------------------------------------------------------------------------------- public bool SetValue ( EuTestCaseMembers Member, String Value ) { // // initialise the methods variables // int iValue = 0; EutCommand testType = EutCommand.Null; EutCommandResults result = EutCommandResults.Ok; switch ( Member ) { case EuTestCaseMembers.Section: { if ( int.TryParse ( Value, out iValue ) == false ) { return false; } this.SectionNo = iValue; return true; } case EuTestCaseMembers.No: { if ( int.TryParse ( Value, out iValue ) == false ) { return false; } this.TestNo = iValue; return true; } case EuTestCaseMembers.Action: { if ( EvStatics.tryParseEnumValue<EutCommand> ( Value, out testType ) == false ) { return false; } this.Action = testType; return true; } case EuTestCaseMembers.Parameters: { this.Parameters = Value; this.createParameterList ( ); return true; } case EuTestCaseMembers.Description: { this.Description = Value; return true; } case EuTestCaseMembers.TestResponse: { this.AddResponse = Value; return true; } case EuTestCaseMembers.TestResult: { if ( EvStatics.tryParseEnumValue<EutCommandResults> ( Value, out result ) == false ) { return false; } this.Result = result; return true; } } return false; }
// ================================================================================= /// <summary> /// This method generates a list of PageIds /// </summary> /// <returns></returns> // --------------------------------------------------------------------------------- public static List <Evado.Model.EvOption> getPageIdSList(bool IsSelectionList) { return(EvStatics.getOptionsFromEnum(typeof(EvPageIds), IsSelectionList)); }
// ============================================================================== /// <summary> /// This method creates an entity filter selection field object. /// </summary> /// <param name="PageGroup">Evado.Model.Uniform.Group object to add the pageGroup .</param> /// <param name="FilterIndex">Integer: filter index</param> /// <param name="SelectionFilter">String: filter value </param> /// <param name="Field">EdRecordField object.</param> // ------------------------------------------------------------------------------ private void getFilteredList_SelectionField ( Evado.UniForm.Model.Group PageGroup, int FilterIndex, String SelectionFilter, EdRecordField Field ) { this.LogMethod ( "getFilteredList_SelectionField" ); this.LogDebug ( "FilterIndex: {0}, SelectionFilter: {1}. ", FilterIndex, SelectionFilter ); //this.LogDebug ( "F: {0}, T: {1}, Type {2}. ", Field.FieldId, Field.Title, Field.TypeId ); List<EvOption> optionList = Evado.UniForm.Model.EuStatics.getStringAsOptionList ( Field.Design.Options ); optionList.Sort ( ( n1, n2 ) => n1.Description.CompareTo ( n2.Description ) ); List<EvOption> selectionOptionList = new List<EvOption> ( ); selectionOptionList.Add ( new EvOption ( ) ); foreach ( EvOption opt in optionList ) { selectionOptionList.Add ( opt ); } // // user the switch to select the selection data types. // switch ( Field.TypeId ) { case EvDataTypes.Check_Box_List: { var field = PageGroup.createCheckBoxListField ( EuEntities.CONST_SELECTION_FIELD + FilterIndex, Field.Title, SelectionFilter, optionList ); field.Layout = EuAdapter.DefaultFieldLayout; field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); break; } case EvDataTypes.Yes_No: case EvDataTypes.Boolean: { var field = PageGroup.createBooleanField ( EuEntities.CONST_SELECTION_FIELD + FilterIndex, Field.Title, EvStatics.getBool ( SelectionFilter ) ); field.Layout = EuAdapter.DefaultFieldLayout; field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); break; } case EvDataTypes.Selection_List: case EvDataTypes.Radio_Button_List: { var field = PageGroup.createSelectionListField ( EuEntities.CONST_SELECTION_FIELD + FilterIndex, Field.Title, SelectionFilter, selectionOptionList ); field.Layout = EuAdapter.DefaultFieldLayout; field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); break; } case EvDataTypes.External_Selection_List: case EvDataTypes.External_RadioButton_List: { this.LogDebug ( "External_Selection_List filter" ); selectionOptionList = this.getFilteredList_SelectionOptions ( Field, true ); if ( selectionOptionList.Count <= 1 ) { this.LogDebug ( "No Selection list options" ); break; } var field = PageGroup.createSelectionListField ( EuEntities.CONST_SELECTION_FIELD + FilterIndex, Field.Title, SelectionFilter, selectionOptionList ); field.Layout = EuAdapter.DefaultFieldLayout; field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); break; } case EvDataTypes.External_CheckBox_List: { this.LogDebug ( "External_CheckBox_List filter" ); selectionOptionList = this.getFilteredList_SelectionOptions ( Field, false ); if ( selectionOptionList.Count == 0 ) { this.LogDebug ( "No CheckBox list options" ); break; } var field = PageGroup.createCheckBoxListField ( EuEntities.CONST_SELECTION_FIELD + FilterIndex, Field.Title, SelectionFilter, selectionOptionList ); field.Layout = EuAdapter.DefaultFieldLayout; field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); break; } }//END switch statment this.LogMethodEnd ( "getFilteredList_SelectionField" ); }//END getFilteredList_SelectionField Query
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region Class public methods // ================================================================================== /// <summary> /// This method gets the trial site object. /// /// </summary> /// <param name="PageCommand">ClientPateEvado.UniForm.Model.Command object</param> /// <returns>Evado.UniForm.Model.AppData</returns> // ---------------------------------------------------------------------------------- override public Evado.UniForm.Model.AppData getDataObject ( Evado.UniForm.Model.Command PageCommand ) { this.LogMethod ( "getClientDataObject" ); this.LogValue ( "PageCommand Content: " + PageCommand.getAsString ( false, false ) ); try { // // Initialise the methods variables and objects. // bool bResult = true; Evado.UniForm.Model.AppData clientDataObjectObject = new Evado.UniForm.Model.AppData ( ); // // Determine if the user has access to this page and log and error if they do not. // if ( this.Session.UserProfile.hasAdministrationAccess == false ) { this.LogIllegalAccess ( this.ClassNameSpace + "getListObject", this.Session.UserProfile ); this.ErrorMessage = EdLabels.Illegal_Page_Access_Attempt; return null; } // // Log access to page. // this.LogPageAccess ( this.ClassNameSpace + "getObject", this.Session.UserProfile ); if ( this.AdapterObjects.ContentTemplates == null ) { this.AdapterObjects.ContentTemplates = new EvStaticContentTemplates ( ); this.AdapterObjects.ContentTemplates = EvStatics.Files.readXmlFile<EvStaticContentTemplates> ( this.AdapterObjects.ApplicationPath, EuStaticContentTemplates.CONST_EMAIL_TEMPLATE_FILENAME ); } if ( this.AdapterObjects.ContentTemplates == null ) { this.AdapterObjects.ContentTemplates = new EvStaticContentTemplates ( ); } if ( this.AdapterObjects.ContentTemplates.IntroductoryEmail_Title == null ) { this.AdapterObjects.ContentTemplates.IntroductoryEmail_Title = String.Empty; this.AdapterObjects.ContentTemplates.IntroductoryEmail_Body = String.Empty; this.AdapterObjects.ContentTemplates.UpdatePasswordEmail_Title = String.Empty; this.AdapterObjects.ContentTemplates.UpdatePasswordEmail_Body = String.Empty; this.AdapterObjects.ContentTemplates.ResetPasswordEmail_Body = String.Empty; this.AdapterObjects.ContentTemplates.ResetPasswordEmail_Body = String.Empty; this.AdapterObjects.ContentTemplates.PasswordConfirmationEmail_Title = String.Empty; this.AdapterObjects.ContentTemplates.PasswordConfirmationEmail_Body = String.Empty; } _displayPage = false; string value = PageCommand.GetParameter ( EuStaticContentTemplates.CONST_DISPLAY_PAGE ); if ( true == EvStatics.getBool ( value ) ) { _displayPage = true; } // // Set the page type to control the DB query type. // string pageType = PageCommand.GetPageId ( ); this.Session.setPageId ( pageType ); this.LogValue ( "PageId: " + this.Session.PageId ); // // Determine the method to be called // switch ( PageCommand.Method ) { case Evado.UniForm.Model.ApplicationMethods.Get_Object: { clientDataObjectObject = this.getObject ( PageCommand ); break; } case Evado.UniForm.Model.ApplicationMethods.Save_Object: { this.LogValue ( " Save Object method" ); // // Update the object values // bResult = this.updateObject ( PageCommand ); // // Process an update error result. // if ( bResult == false ) { this.LogValue ( " Save method failed" ); // // Return the generated ResultData object. // clientDataObjectObject = null; } break; } }//END Swith // // Handle returned exceptions. // if ( clientDataObjectObject == null ) { this.LogValue ( " null application data returned." ); } // // Return the last client ResultData object. // return clientDataObjectObject; } catch ( Exception Ex ) { this.LogException ( Ex ); } return new Evado.UniForm.Model.AppData ( ); }//END getClientDataObject method
}//END method // ===================================================================================== /// <summary> /// This method generates the commands associated with the selected menu item. /// </summary> /// <param name="PageId">String: page identifier</param> /// <param name="Title">String: command title</param> /// <returns>Evado.UniForm.Model.Command object.</returns> // ------------------------------------------------------------------------------------ public Evado.UniForm.Model.Command GetNavigationCommand ( String PageId, String Title, String Parameters) { this.resetAdapterLog ( ); this.LogMethod ( "getMenuCommandObject" ); this.LogDebug ( "PageId: {0}, Title: {1}.", PageId, Title ); // // Initialise the methods variables and objects. // Evado.Digital.Model.EdStaticPageIds pageId = Evado.Digital.Model.EdStaticPageIds.Null; Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( ); // // process static page identifeirs to create their commands. // if ( EvStatics.tryParseEnumValue<Evado.Digital.Model.EdStaticPageIds> ( PageId, out pageId ) == true ) { #region Admin menu items // // Administration page commands // switch ( pageId ) { case Evado.Digital.Model.EdStaticPageIds.Application_Profile: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Application_Properties.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Database_Version: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Application_Properties.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Database_Version ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Email_Templates_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Email_Templates.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Application_Event_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Events.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Application_Event: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Events.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); // // Add the groupCommand parameters. // pageCommand.SetGuid ( this.Session.MenuItem.Guid ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Organisation_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Organisations.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Organisation_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Organisations.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); // // Add the groupCommand parameters. // pageCommand.SetGuid ( this.Session.MenuItem.Guid ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.User_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Users.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.My_User_Profile_Update_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Users.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Email_User_Page: { string [] arParameters = Parameters.Split ( ';' ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Users.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); foreach ( string parm in arParameters ) { if ( parm.Contains ( "=" ) == false ) { continue; } String [] arParm = parm.Split ( '=' ); pageCommand.AddParameter ( arParm [ 0 ], arParm [ 1 ] ); } return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Menu_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Menu.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } }//END admin page switch statement //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region applilcation configuration // // Project configuration menu commands. // switch ( pageId ) { case Evado.Digital.Model.EdStaticPageIds.Alert_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Alert.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Binary_File_List_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Binary_File.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Page_Layout_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Page_Layouts.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Page_Layout_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Page_Layouts.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Selection_List_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Selection_Lists.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Selection_List_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Selection_Lists.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Record_Layout_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Record_Layouts.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Entity_Layout_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entity_Layouts.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } }//END admin page switch statement //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region analysis and reporting menu items. // // Project analysis and reporting menu commands. // switch ( pageId ) { case Evado.Digital.Model.EdStaticPageIds.Data_Charting_Page: { this.LogValue ( PageId + " ADDED" ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Analysis.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Record_Query_Page: { this.LogValue ( PageId + " ADDED" ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Analysis.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Audit_Configuration_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Application_Properties.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Audit_Records_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Application_Properties.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Audit_Record_Items_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Application_Properties.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); return pageCommand; } } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region reporting menu items. // // Project analysis and reporting menu commands. // switch ( pageId ) { case Evado.Digital.Model.EdStaticPageIds.Report_Template_View: { this.LogValue ( PageId + " ADDED" ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.ReportTemplates.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Report_Template_Page: { this.LogValue ( PageId + " ADDED" ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.ReportTemplates.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Operational_Report_List: { this.LogValue ( PageId + " ADDED" ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Reports.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Operational_Report_Page: { this.LogValue ( PageId + " ADDED" ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Reports.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); return pageCommand; } }//END switch statement //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region record menu items. // // Project records menu commands. // switch ( pageId ) { // ------------------------------------------------------------------------------ // milestone ancillary records pages. // case Evado.Digital.Model.EdStaticPageIds.Ancillary_Record_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Ancillary_Record.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Records_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Record_Export_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Record_Admin_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Record_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); pageCommand.SetGuid ( this.Session.Record.Guid ); if ( this.Session.Entity != null ) { pageCommand.AddParameter ( EdRecord.FieldNames.TypeId, this.Session.Entity.TypeId ); } return pageCommand; } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region Entity commands // // Entitity menu commands // case Evado.Digital.Model.EdStaticPageIds.Entity_View: case Evado.Digital.Model.EdStaticPageIds.Entity_Filter_View: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Entity_Export_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Entity_Admin_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); return pageCommand; } case Evado.Digital.Model.EdStaticPageIds.Entity_Page: { pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); pageCommand.SetGuid ( this.Session.Entity.Guid ); if ( this.Session.Entity != null ) { pageCommand.AddParameter ( EdRecord.FieldNames.TypeId, this.Session.Entity.TypeId ); } return pageCommand; } }//END switch //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion }//END Static page ids. // // Create the command to to display a page layout.. // if ( PageId.Contains ( EuAdapter.CONST_PAGE_ID_PREFIX ) == true ) { string stPageId = PageId.Replace ( EuAdapter.CONST_PAGE_ID_PREFIX, String.Empty ); this.LogDebug ( "PAGE: PageId: {0}, Title: {1} StPageId: {2}.", PageId, Title, stPageId ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Page.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( stPageId ); pageCommand.AddParameter ( EuEntities.CONST_HIDE_SELECTION, "Yes" ); return pageCommand; } // // Create the command to query Entities as a filtered list // i.e. retrieves an organisation's child entity layout. // if ( PageId.Contains ( EuAdapter.CONST_AUTHOR_PAGE_ID_SUFFIX ) == true ) { string layoutId = PageId.Replace ( EuAdapter.CONST_ENTITY_PREFIX, String.Empty ); layoutId = layoutId.Replace ( EuAdapter.CONST_AUTHOR_PAGE_ID_SUFFIX, String.Empty ); this.LogDebug ( "AUTHOR: PageId: {0}, Title: {1} Layout: {2}, Author Query.", PageId, Title, layoutId ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Entity_View ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EdRecord.FieldNames.Author, this.Session.UserProfile.UserId ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentUserId, this.Session.UserProfile.UserId ); pageCommand.AddParameter ( EuEntities.CONST_HIDE_SELECTION, "Yes" ); pageCommand.AddParameter ( EuEntities.CONST_AUTHOR_SELECTION, "Yes" ); return pageCommand; } // // Create the command to query Entities as a filtered list // i.e. retrieves an organisation's child entity layout. // if ( PageId.Contains ( EuAdapter.CONST_ENTITY_FILTERED_LIST_SUFFIX ) == true ) { string layoutId = PageId.Replace ( EuAdapter.CONST_ENTITY_PREFIX, String.Empty ); layoutId = layoutId.Replace ( EuAdapter.CONST_ENTITY_FILTERED_LIST_SUFFIX, String.Empty ); this.LogDebug ( "FILTERED: PageId: {0}, Title: {1} Layout: {2}, Filtered Query.", PageId, Title, layoutId ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Entity_Filter_View ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EuEntities.CONST_EMPTY_SELECTION_FIELD, "Yes" ); return pageCommand; } // // Create the command to access a Entity by its organisation parent's identifier. // i.e. retrieves an organisation's child entity layout. // if ( PageId.Contains ( EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX2 ) == true ) { string layoutId = PageId.Replace ( EuAdapter.CONST_ENTITY_PREFIX, String.Empty ); this.LogDebug ( "1 layoutId: {0}.", layoutId ); layoutId = layoutId.Replace ( EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX2, String.Empty ); this.LogDebug ( "2 Template: {0}.", EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX2 ); this.LogDebug ( "2 layoutId: {0}.", layoutId ); this.LogDebug ( "ORG: PageId: {0}, Title: {1} Layout: {2}, Org Parent.", PageId, Title, layoutId ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EuEntities.CONST_HIDE_SELECTION, "Yes" ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentOrgId, this.Session.Organisation.OrgId ); this.LogDebug ( "Command Method: {0}.", pageCommand.Method ); return pageCommand; } // // Create the command to access a Entity by its organisation parent's identifier. // i.e. retrieves an organisation's child entity layout. // if ( PageId.Contains ( EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX ) == true ) { string layoutId = PageId.Replace ( EuAdapter.CONST_ENTITY_PREFIX, String.Empty ); this.LogDebug ( "1 layoutId: {0}.", layoutId ); layoutId = layoutId.Replace ( EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX, String.Empty ); this.LogDebug ( "2 Template: {0}.", EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX ); this.LogDebug ( "2 layoutId: {0}.", layoutId ); this.LogDebug ( "ORG: PageId: {0}, Title: {1} Layout: {2}, Org Parent.", PageId, Title, layoutId ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EuEntities.CONST_HIDE_SELECTION, "Yes" ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentOrgId, this.Session.Organisation.OrgId ); return pageCommand; } // // Create the command to access a Entity by its user parent's identifier. // i.e. retrieves an user's child entity layout. // else if ( PageId.Contains ( EuAdapter.CONST_USER_PARENT_PAGE_ID_SUFFIX2 ) == true ) { string layoutId = PageId.Replace ( EuAdapter.CONST_ENTITY_PREFIX, String.Empty ); this.LogDebug ( "1 layoutId: {0}.", layoutId ); layoutId = layoutId.Replace ( EuAdapter.CONST_USER_PARENT_PAGE_ID_SUFFIX2, String.Empty ); this.LogDebug ( "2 layoutId: {0}.", layoutId ); this.LogDebug ( "DEF USR: PageId: {0}, Title: {1} Layout: {2}, User Parent.", PageId, Title, layoutId ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EuEntities.CONST_HIDE_SELECTION, "Yes" ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentUserId, this.Session.UserProfile.UserId ); return pageCommand; } // // Create the command to access a Entity by its user parent's identifier. // i.e. retrieves an user's child entity layout. // else if ( PageId.Contains ( EuAdapter.CONST_USER_PARENT_PAGE_ID_SUFFIX ) == true ) { string layoutId = PageId.Replace ( EuAdapter.CONST_ENTITY_PREFIX, String.Empty ); layoutId = layoutId.Replace ( EuAdapter.CONST_USER_PARENT_PAGE_ID_SUFFIX, String.Empty ); this.LogDebug ( "USER: PageId: {0}, Title: {1} Layout: {2}, User Parent.", PageId, Title, layoutId ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EuEntities.CONST_HIDE_SELECTION, "Yes" ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentUserId, this.Session.UserProfile.UserId ); return pageCommand; } // // Create the command to access a Entity by its Entity parent. // i.e. retrieves an Entity's child records layout. // else if ( PageId.Contains ( EuAdapter.CONST_ENTITY_PARENT_PAGE_ID_SUFFIX ) == true ) { this.LogDebug ( "A PageId: {0}, Title: {1} Entity Parent.", PageId, Title ); string layoutId = PageId.Replace ( EuAdapter.CONST_ENTITY_PARENT_PAGE_ID_SUFFIX, String.Empty ); this.LogDebug ( "1 layoutId: {0}.", layoutId ); layoutId = layoutId.Replace ( EuAdapter.CONST_ENTITY_PREFIX, String.Empty ); this.LogDebug ( "2 layoutId: {0}.", layoutId ); this.LogDebug ( "PARENT: PageId: {0}, Title: {1} Layout: {2}, User Parent.", PageId, Title, layoutId ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EuEntities.CONST_HIDE_SELECTION, "Yes" ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentGuid, this.Session.Entity.Guid ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentLayoutId, this.Session.Entity.LayoutId ); return pageCommand; } // // Create the command to access a Entity by its Entity parent. // i.e. retrieves an Entity's child records layout. // else if ( PageId.Contains ( EuAdapter.CONST_ENTITY_PARENT_PAGE_ID_SUFFIX ) == true ) { this.LogDebug ( "A PageId: {0}, Title: {1} Entity Parent.", PageId, Title ); string layoutId = PageId.Replace ( EuAdapter.CONST_ENTITY_PARENT_PAGE_ID_SUFFIX, String.Empty ); this.LogDebug ( "1 layoutId: {0}.", layoutId ); layoutId = layoutId.Replace ( EuAdapter.CONST_ENTITY_PREFIX, String.Empty ); this.LogDebug ( "2 layoutId: {0}.", layoutId ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EuEntities.CONST_HIDE_SELECTION, "Yes" ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentGuid, this.Session.Entity.Guid ); return pageCommand; } // // Create the command to access Entities by their layout identifers. // else if ( PageId.Contains ( EuAdapter.CONST_ENTITY_PREFIX ) == true ) { this.LogDebug ( "PageId: {0}, Title: {1} Layout.", PageId, Title ); string layoutId = PageId.Replace ( EuAdapter.CONST_ENTITY_PREFIX, String.Empty ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EuEntities.CONST_HIDE_SELECTION, "Yes" ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); return pageCommand; } // // Create the command to access records by their layout identifers. // if ( PageId.Contains ( EuAdapter.CONST_RECORD_PREFIX) == true ) { string layoutId = PageId.Replace ( EuAdapter.CONST_RECORD_PREFIX, String.Empty ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); return pageCommand; } // // Create the command to access a record by its organisation parent's identifier. // i.e. retrieves an organisation's child entity layout. // else if ( PageId.Contains ( EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX ) == true ) { string layoutId = PageId.Replace ( EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX, String.Empty ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentOrgId, this.Session.Organisation.OrgId ); return pageCommand; } // // Create the command to access a record by its user parent's identifier. // i.e. retrieves an user's child entity layout. // else if ( PageId.Contains ( EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX ) == true ) { string layoutId = PageId.Replace ( EuAdapter.CONST_ORG_PARENT_PAGE_ID_SUFFIX, String.Empty ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentUserId, this.Session.UserProfile.UserId ); return pageCommand; } // // Create the command to access a record by its Entity parent. // i.e. retrieves an Entity's child records layout. // else if ( PageId.Contains ( EuAdapter.CONST_ENTITY_PARENT_PAGE_ID_SUFFIX ) == true ) { string layoutId = PageId.Replace ( EuAdapter.CONST_ENTITY_PARENT_PAGE_ID_SUFFIX, String.Empty ); pageCommand = new Evado.UniForm.Model.Command ( Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( PageId ); pageCommand.AddParameter ( EdRecord.FieldNames.Layout_Id, layoutId ); pageCommand.AddParameter ( EuEntities.CONST_HIDE_SELECTION, "Yes" ); pageCommand.AddParameter ( EdRecord.FieldNames.ParentGuid, this.Session.Entity.Guid ); return pageCommand; } return null; }//END convertMenuItem method
}//END sendEmail method // ================================================================================== /// <summary> /// /// This method sends an email to the recipants in the email address list. /// /// </summary> /// <param name="Subject">The email subject string</param> /// <param name="HtmlBody">The email html body</param> /// <param name="SenderEmailAddress">The sender's email address</param> /// <param name="RecipantEmailAddresses">Delimited string of recipant email addresses.</param> /// <param name="AttachmentDirectoryPath">Directory path to the attachment if it exists.</param> /// <returns>EmailStatus value</returns> // --------------------------------------------------------------------------------- public EmailStatus sendEmail( String Subject, String HtmlBody, String SenderEmailAddress, String RecipantEmailAddresses, String AttachmentDirectoryPath) { this.LogMethod("sendEmail method. "); this.LogDebug("Subject: " + Subject); // this.LogDebugValue( "HtmlBody: " + HtmlBody ); this.LogDebug("SenderEmailAddress: " + SenderEmailAddress); this.LogDebug("RecipantEmailAddresses: " + RecipantEmailAddresses); this.LogDebug("AttachmentDirectoryPath: " + AttachmentDirectoryPath); try { // // Validate that the are the settings for the SMTP server. // if (this._SmtpServer == String.Empty) { this.LogDebug(EvStatics.enumValueToString(EmailStatus.No_SMTP_Url)); return(EmailStatus.No_SMTP_Url); } // // Validate that the are the settings for the SMTP server. // if (RecipantEmailAddresses == String.Empty) { this.LogDebug(EvStatics.enumValueToString(EmailStatus.No_Reciever_Addresses)); return(EmailStatus.No_Reciever_Addresses); } // // If the sender's email address is empty put in a dummy address. // if (SenderEmailAddress == String.Empty) { SenderEmailAddress = "*****@*****.**"; } // // Get the list of email addresses. // MailAddress fromAddress = new MailAddress(this._SmtpUserId); MailAddressCollection recipantAddressList = new MailAddressCollection( ); MailAddress replyToAddress = new MailAddress(SenderEmailAddress); // // Generate an array of email addresses. // String[] arrRecipantEmailAddresses = RecipantEmailAddresses.Split(';'); // // Create the to address list. // foreach (String recipantEmailAddress in arrRecipantEmailAddresses) { String stRecipantEmailAddress = recipantEmailAddress.Replace("(", "<"); stRecipantEmailAddress = stRecipantEmailAddress.Replace(")", ">"); if (stRecipantEmailAddress.Contains(">") == true) { stRecipantEmailAddress = stRecipantEmailAddress.Replace(">", String.Empty); int index = stRecipantEmailAddress.IndexOf('<'); string recipantntName = stRecipantEmailAddress.Substring(0, index).Trim( ); string recipantntAddress = stRecipantEmailAddress.Substring(index + 1).Trim( ); // this.LogDebugValue( "name: " + recipantntName + ", address: " + recipantntAddress ); MailAddress toAddress = new MailAddress(recipantntAddress, recipantntName); recipantAddressList.Add(toAddress); } else { if (recipantEmailAddress.Length > 0) { // this.LogDebugValue( "name: " + recipantEmailAddress + ", address: " + recipantEmailAddress ); MailAddress toAddress = new MailAddress(recipantEmailAddress, recipantEmailAddress); recipantAddressList.Add(toAddress); } } }//END interation loop this.LogDebug("toAddresses: " + recipantAddressList.Count); if (recipantAddressList.Count == 0) { this.LogDebug("No Addressee list."); return(EmailStatus.No_Reciever_Addresses); } this.LogDebug("Creating Email message."); // // Initialise the email message content // MailMessage message = new MailMessage(fromAddress, recipantAddressList[0]); message.ReplyToList.Add(replyToAddress); message.Subject = Subject; message.IsBodyHtml = true; message.Body = HtmlBody; // // Add the to recipant email address list. // for (int i = 1; i < recipantAddressList.Count; i++) { message.To.Add(recipantAddressList[i]); }//END interation loop this.LogDebug("message.To: " + message.To.Count); // // Get the report and save it in a temporary file. // if (AttachmentDirectoryPath != String.Empty) { // // Create the file attachment for this e-mail message. // Attachment attachment = new Attachment(AttachmentDirectoryPath); // Add the file attachment to this e-mail message. message.Attachments.Add(attachment); this.LogDebug("message.Attachments: " + message.Attachments.Count); } // // Initialise the Smtp Email client // SmtpClient smtpClient = new SmtpClient(this._SmtpServer, this._SmtpServerPort); smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; smtpClient.EnableSsl = _EnableSsl; this.LogDebug("client.Host: " + smtpClient.Host); this.LogDebug("client.Port: " + smtpClient.Port); this.LogDebug("client.DeliveryMethod: " + smtpClient.DeliveryMethod); this.LogDebug("client.EnableSsl: " + smtpClient.EnableSsl); // // Initialise the email server credentials if it is needed. // if (this._SmtpUserId != String.Empty) { this.LogDebug("SmtpUserId: " + this._SmtpUserId); this.LogDebug("SmtpPassword: "******"Email Sent."); return(EmailStatus.Email_Sent); } catch (Exception Ex) { this.LogDebug("Event content: "); this.LogDebug(EvStatics.getException(Ex)); return(EmailStatus.Email_Send_Request_Failed); } }//END sendEmail method
}//END getListObject method. // ================================================================================== /// <summary> /// This methods saves the event log selection parameters to the session object. /// </summary> // --------------------------------------------------------------------------------- private void saveEventLogSelectionParameters ( Evado.UniForm.Model.Command PageCommand ) { this.LogMethod ( "saveEventLogSelectionParameters" ); // // Retrieve the selection options. // String value = String.Empty; this.Session.EventId = EvEventCodes.Null; // // Start date selection // if ( PageCommand.hasParameter ( EuApplicationEvents.CONST_START_DATE_FIELD_ID ) == true ) { var startDate = EvStatics.getDateTime ( PageCommand.GetParameter ( EuApplicationEvents.CONST_START_DATE_FIELD_ID ) ); this.LogValue ( "startDate: " + startDate ); if ( this.Session.EventStartDate != startDate ) { this.Session.EventStartDate = startDate; this.Session.ApplicationEventList = new List<EvApplicationEvent> ( ); } } // // finish data selection. // if ( PageCommand.hasParameter ( EuApplicationEvents.CONST_FINISH_DATE_FIELD_ID ) == true ) { var finishDate = EvStatics.getDateTime ( PageCommand.GetParameter ( EuApplicationEvents.CONST_FINISH_DATE_FIELD_ID ) ); if ( this.Session.EventFinishDate != finishDate ) { this.Session.EventFinishDate = finishDate; this.Session.ApplicationEventList = new List<EvApplicationEvent> ( ); } } // // Event Identifier selection. // if ( PageCommand.hasParameter ( EuApplicationEvents.CONST_EVENT_FIELD_ID ) == true ) { var eventId = PageCommand.GetParameter<EvEventCodes> ( EuApplicationEvents.CONST_EVENT_FIELD_ID ); if ( eventId != this.Session.EventId ) { this.Session.EventId = eventId; this.Session.ApplicationEventList = new List<EvApplicationEvent> ( ); } } // // Event type selection. // this.Session.EventType = PageCommand.GetParameter ( EuApplicationEvents.CONST_TYPE_FIELD_ID ); if ( PageCommand.hasParameter ( EuApplicationEvents.CONST_TYPE_FIELD_ID ) == true ) { var eventId = PageCommand.GetParameter ( EuApplicationEvents.CONST_TYPE_FIELD_ID ); if ( eventId != this.Session.EventType ) { this.Session.EventType = eventId; this.Session.ApplicationEventList = new List<EvApplicationEvent> ( ); } } // // user selection // this.Session.EventUserName = PageCommand.GetParameter ( EuApplicationEvents.CONST_USER_FIELD_ID ); // // set the minimium event range. // if ( this.Session.EventStartDate == Evado.Digital.Model.EvcStatics.CONST_DATE_MIN_RANGE ) { this.Session.EventStartDate = Evado.Digital.Model.EvcStatics.getDateTime ( DateTime.Now.ToString ( "dd MMM yyyy" ) ); this.Session.EventFinishDate = this.Session.EventStartDate.AddDays ( 1 ); } this.LogValue ( "EventId: " + this.Session.EventId ); this.LogValue ( "EventType: " + this.Session.EventType ); this.LogValue ( "EventUserName: "******"EventStartDate: " + this.Session.EventStartDate ); this.LogValue ( "EventFinishDate: " + this.Session.EventFinishDate ); this.LogValue ( "ApplicationEventList.Count: " + this.Session.ApplicationEventList.Count ); this.LogMethodEnd ( "saveEventLogSelectionParameters" ); }//END Method
}//END getProperties_GeneralPageGroup Method // ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="Page">Evado.UniForm.Model.Page object.</param> // ------------------------------------------------------------------------------ private void getPropertiesPage_SettingGroup ( Evado.UniForm.Model.Page Page ) { this.LogMethod ( "getPropertiesPage_SettingGroup" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( ); Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( ); Evado.UniForm.Model.Parameter parameter = new Evado.UniForm.Model.Parameter ( ); List<EvOption> optionList = new List<EvOption> ( ); // // Define the general properties pageMenuGroup.. // pageGroup = Page.AddGroup ( EdLabels.Form_Properties_Settings_Group_Title ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.SetCommandBackBroundColor ( Evado.UniForm.Model.GroupParameterList.BG_Mandatory, Evado.UniForm.Model.Background_Colours.Red ); this.GetDataObject_GroupCommands ( pageGroup ); // // Layout field readonly display format settings // optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.FieldReadonlyDisplayFormats ), false ); groupField = pageGroup.createSelectionListField ( EdRecord.FieldNames.FieldReadonlyDisplayFormat.ToString ( ), EdLabels.EntityLayout_FieldDisplayFormat_Field_Title, this.Session.EntityLayout.Design.FieldReadonlyDisplayFormat, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; // // Form Update reason // optionList = this.AdapterObjects.Settings.GetRoleOptionList ( false ); groupField = pageGroup.createCheckBoxListField ( EdRecord.FieldNames.ReadAccessRoles.ToString ( ), EdLabels.Record_Layout_AccessRole_Field_Label, this.Session.EntityLayout.Design.EditAccessRoles, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.EditAccess = this._DesignAccess; groupField = pageGroup.createCheckBoxListField ( EdRecord.FieldNames.EditAccessRoles.ToString ( ), EdLabels.Record_Layout_EditRole_Field_Label, this.Session.EntityLayout.Design.ReadAccessRoles, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.EditAccess = this._DesignAccess; // // Layout author only draft record access // optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.AuthorAccessList ), false ); this.LogDebug ( "Author Access option list length: ", optionList ); this.LogDebug ( "RecordLayout.Design.AuthorAccess: ", this.Session.EntityLayout.Design.AuthorAccess ); groupField = pageGroup.createSelectionListField ( EdRecord.FieldNames.AuthorAccess.ToString ( ), EdLabels.Record_Layout_Author_Access_Setting_Field_Title, this.Session.EntityLayout.Design.AuthorAccess, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.EditAccess = this._DesignAccess; // // Enable display if chiled entities. // groupField = pageGroup.createBooleanField ( EdRecord.FieldNames.DisplayRelatedEntities.ToString ( ), EdLabels.EntityLayout_Display_Related_Entities_Field_Title, this.Session.EntityLayout.Design.DisplayRelatedEntities ); groupField.Layout = EuAdapter.DefaultFieldLayout; // // Layout author only edit record access // optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.ParentTypeList ), true ); groupField = pageGroup.createSelectionListField ( EdRecord.FieldNames.ParentType.ToString ( ), EdLabels.Record_Layout_Parent_Object_Type_Field_Title, this.Session.EntityLayout.Design.ParentType, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.EditAccess = this._DesignAccess; // // Select the hierachical entities this entity can be referenced to. // if ( this.Session.EntityLayout.Design.ParentType == EdRecord.ParentTypeList.Entity ) { optionList = this.AdapterObjects.GetIssuedEntityOptions ( false ); groupField = pageGroup.createCheckBoxListField ( EdRecord.FieldNames.ParentEntities.ToString ( ), EdLabels.Record_Layout_Parent_Entity_Selection_Field_Title, this.Session.EntityLayout.Design.ParentEntities, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; } // // Default field layout // optionList = EvStatics.getOptionsFromEnum ( typeof ( Evado.UniForm.Model.FieldLayoutCodes ), false ); if ( this.Session.EntityLayout.Design.DefaultPageLayout == null ) { this.Session.EntityLayout.Design.DefaultPageLayout = EuAdapter.DefaultFieldLayout.ToString ( ); } groupField = pageGroup.createSelectionListField ( EdRecord.FieldNames.DefaultPageLayout.ToString ( ), EdLabels.Form_Llink_Default_Layout_Field_Title, this.Session.EntityLayout.Design.DefaultPageLayout, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; // // Record LLnk content setting // optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.LinkContentSetting ), false ); if ( this.Session.EntityLayout.Design.LinkContentSetting == EdRecord.LinkContentSetting.Null ) { this.Session.EntityLayout.Design.LinkContentSetting = EdRecord.LinkContentSetting.Default; } groupField = pageGroup.createSelectionListField ( EdRecord.FieldNames.LinkContentSetting, EdLabels.Record_Link_Content_Setting_Field_Title, this.Session.EntityLayout.Design.LinkContentSetting, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; // // Record header layout settings // optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.HeaderFormat ), false ); if ( this.Session.EntityLayout.Design.HeaderFormat == EdRecord.HeaderFormat.Null ) { this.Session.EntityLayout.Design.HeaderFormat = EdRecord.HeaderFormat.Default; } groupField = pageGroup.createSelectionListField ( EdRecord.FieldNames.HeaderFormat, EdLabels.RecordLayout_Header_Format_Field_Title, this.Session.EntityLayout.Design.HeaderFormat, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; // // Record footer layout settings // optionList = EvStatics.getOptionsFromEnum ( typeof ( EdRecord.FooterFormat ), false ); if ( this.Session.EntityLayout.Design.FooterFormat == EdRecord.FooterFormat.Null ) { this.Session.EntityLayout.Design.FooterFormat = EdRecord.FooterFormat.Default; } groupField = pageGroup.createSelectionListField ( EdRecord.FieldNames.FooterFormat, EdLabels.RecordLayout_Footer_Format_Field_Title, this.Session.EntityLayout.Design.FooterFormat, optionList ); groupField.Layout = EuAdapter.DefaultFieldLayout; // // Form CS Script // groupField = pageGroup.createBooleanField ( EdRecord.FieldNames.HasCsScript.ToString ( ), EdLabels.Form_Cs_Script_Field_Title, this.Session.EntityLayout.Design.hasCsScript ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.EditAccess = this._DesignAccess; this.LogMethodEnd ( "getPropertiesPage_SettingGroup" ); }//END getProperties_GeneralPageGroup Method
}//END getDataObject_ExitPage method // ================================================================================== /// <summary> /// THis method saves the ResultData object updating the field values contained in the /// parameter list. /// </summary> /// <param name="PageCommand">Evado.UniForm.Model.ClientClientDataObjectEvado.UniForm.Model.Command object.</param> /// <returns>Application Data object</returns> // ---------------------------------------------------------------------------------- private EvEventCodes RegisterUserDetails ( Evado.UniForm.Model.Command PageCommand ) { this.LogMethod ( "RegisterUserDetails" ); try { // // Initialise the methods variables and objects. // Evado.UniForm.Model.AppData clientDataObject = new Evado.UniForm.Model.AppData ( ); EvEventCodes result; // // Update the object. // if ( this.updateObjectValue ( PageCommand ) == false ) { this.ErrorMessage = EdLabels.UserProfile_Value_Update_Error_Message; this.LogMethodEnd ( "RegisterUserDetails" ); return EvEventCodes.Value_Update_Processing_Error; } this.LogValue ( "Guid: " + this.Session.AdminUserProfile.Guid ); this.LogValue ( "UserId: " + this.Session.AdminUserProfile.UserId ); this.LogValue ( "CommonName: " + this.Session.AdminUserProfile.CommonName ); this.Session.AdminUserProfile.UserId = EvStatics.CleanSamUserId ( this.Session.AdminUserProfile.UserId ); if ( PageCommand.hasParameter ( EuUserRegistration.CONST_NEW_PASSWORD_PARAMETER ) == true ) { this.LogValue ( "Creating a new password." ); this.createDefaultPassword ( ); } this.LogValue ( "AdminUserProfile.Password: "******"RegisterUserDetails" ); return result; } this.LogMethodEnd ( "RegisterUserDetails" ); return EvEventCodes.Ok; } catch ( Exception Ex ) { // // Create the error message to be displayed to the user. // this.ErrorMessage = EdLabels.User_Profile_Save_Error_Message; // // Generate the log the error event. // this.LogException ( Ex ); } this.LogMethodEnd ( "RegisterUserDetails" ); return EvEventCodes.Database_Record_Update_Error; }//END RegisterUserDetails method
}//END processNotAvailableValues method #endregion #region Record field list Queries // ===================================================================================== /// <summary> /// This class returns a list of formfield object retrieved by the record Guid. /// </summary> /// <param name="Record">EvForm: (Mandatory) The record object.</param> /// <param name="IncludeComments">bool: true = include field comments.</param> /// <returns>List of EvFormField: a formfield object.</returns> /// <remarks> /// This method consists of the following steps: /// /// 1. Return an empty formfield object if the record's Guid is empty /// /// 2. Define the sql query parameters and sql query string /// /// 3. Execute the sql query string with parameters and store the results on data table. /// /// 4. Iterate through the table and extract the data row to the formfield object. /// /// 5. Add object result to the formfields list. /// /// 6. Return the formfields list. /// </remarks> // ------------------------------------------------------------------------------------- public List <EdRecordField> getRecordFieldList( EdRecord Record) { this.LogMethod("getRecordFieldList method. "); this.LogDebug("Record.Guid: " + Record.Guid); // // Initialise the methods variables and objects. // List <EdRecordField> recordFieldList = new List <EdRecordField> ( ); EdRecordField recordField = new EdRecordField( ); Guid previousValueGuid = Guid.Empty; // // Validate whether the record Guid is not empty. // if (Record.Guid == Guid.Empty) { return(recordFieldList); } // // Define the SQL query parameters. // SqlParameter [] cmdParms = new SqlParameter [] { new SqlParameter(PARM_RECORD_GUID, SqlDbType.UniqueIdentifier), }; cmdParms [0].Value = Record.Guid; // // Define the query string. // _Sql_QueryString = SQL_QUERY_VALUES_VIEW + " WHERE ( " + EdRecordValues.DB_RECORD_GUID + " =" + EdRecordValues.PARM_RECORD_GUID + ") " + "ORDER BY " + EdRecordFields.DB_ORDER + "; "; this.LogDebug(_Sql_QueryString); // // Execute the query against the database. // using (DataTable table = EvSqlMethods.RunQuery(_Sql_QueryString, cmdParms)) { if (table.Rows.Count == 0) { return(recordFieldList); } // // Iterate through the results extracting the role information. // for (int count = 0; count < table.Rows.Count; count++) { // // Extract the table row // DataRow row = table.Rows [count]; Guid recordValueGuid = EvSqlMethods.getGuid(row, EdRecordValues.DB_VALUES_GUID); this.LogDebug("previousValueGuid: {0}, recordValueGuid: {1}.", previousValueGuid, recordValueGuid); // // Empty fields are skipped. // if (recordValueGuid == Guid.Empty) { this.LogDebug("Skip the value Guid is empty."); continue; } // If the field guid has changed then it is a new field. // So add the previous field then get the data for the new field. // if (previousValueGuid != recordValueGuid) { this.LogDebug("Change of recordValueGuid."); // // Add the last field to the list. // if (recordField.Guid != Guid.Empty) { this.LogDebug("Add field to record field list."); recordFieldList.Add(recordField); } // // Get the object data from the row. // recordField = this.getRowData(row); // // skip all non summary field if summary fields is selected. // if (Record.Design.LinkContentSetting != EdRecord.LinkContentSetting.First_Text_Field && Record.SelectOnlySummaryFields == true && recordField.Design.IsSummaryField == false) { this.LogDebug("{0} is a summary field so SKIPPED.", recordField.FieldId); continue; } // // skip all non summary field if summary fields is selected. // if (Record.Design.LinkContentSetting != EdRecord.LinkContentSetting.First_Text_Field && count > 1) { this.LogDebug("{0} first field retrieved so SKIPPED.", recordField.FieldId); continue; } // // Update the lst field guid to enable the other field values to be collected. // previousValueGuid = recordField.Guid; }//END create new field object. this.LogDebug("Read in value data."); switch (recordField.TypeId) { case Evado.Model.EvDataTypes.Special_Matrix: case Evado.Model.EvDataTypes.Table: { this.getTableCellValue(row, recordField); break; } case Evado.Model.EvDataTypes.Check_Box_List: { this.getCheckBoxValue(row, recordField); break; } case Evado.Model.EvDataTypes.Numeric: { recordField.ItemValue = EvSqlMethods.getString(row, EdRecordValues.DB_VALUES_NUMERIC); this.LogDebug("recordField.ItemValue: {0}.", recordField.ItemValue); break; } case Evado.Model.EvDataTypes.Boolean: case Evado.Model.EvDataTypes.Yes_No: { bool bValue = EvSqlMethods.getBool(row, EdRecordValues.DB_VALUES_NUMERIC); this.LogDebug("bValue: {0}.", bValue); recordField.ItemValue = "No"; if (bValue == true) { recordField.ItemValue = "Yes"; } this.LogDebug("recordField.ItemValue: {0} bool.", recordField.ItemValue); break; } case Evado.Model.EvDataTypes.Date: { var dtValue = EvSqlMethods.getDateTime(row, EdRecordValues.DB_VALUES_DATE); recordField.ItemValue = EvStatics.getDateAsString(dtValue); this.LogDebug("recordField.ItemValue: {0}.", recordField.ItemValue); break; } case Evado.Model.EvDataTypes.Free_Text: { recordField.ItemText = EvSqlMethods.getString(row, EdRecordValues.DB_VALUES_TEXT); this.LogDebug("recordField.ItemValue: {0}.", recordField.ItemText); break; } default: { if (recordField.isReadOnly == true) { break; } recordField.ItemValue = EvSqlMethods.getString(row, EdRecordValues.DB_VALUES_STRING); this.LogDebug("recordField.ItemValue: {0}.", recordField.ItemValue); break; } } } //ENR record iteration loop. } //ENd using statement // // Add the last field to the list. // if (recordField.Guid != Guid.Empty) { recordFieldList.Add(recordField); } // // Return the formfields list. // return(recordFieldList); }//END getRecordFieldList method.
}//END generateGroupTestCases method // ================================================================================== /// <summary> /// This method creates page group test cases. /// </summary> // ---------------------------------------------------------------------------------- private void generateGroupTestCases ( ) { this.LogMethod ( "generateGroupTestCases" ); // // Initialise the methods variables and objects. // EutAction action = new EutAction ( ); // // Create test case for page group object title. // foreach ( Group group in this._ClientData.Page.GroupList ) { action = new EutAction ( ); action.Action = EutCommand.Test_Group_Title; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, group.Title ); this._TestCaseList.Add ( action ); // // Create test case for group object status. // action = new EutAction ( ); action.Action = EutCommand.Test_Group_Edit_Status; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, group.EditAccess.ToString ( ) ); this._TestCaseList.Add ( action ); // // Create test case for group object layout. // action = new EutAction ( ); action.Action = EutCommand.Test_Group_Layout_Setting; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, group.Layout.ToString ( ) ); // // Create test case for group object type. // action = new EutAction ( ); action.Action = EutCommand.Test_Group_Type_Setting; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, group.GroupType.ToString ( ) ); this._TestCaseList.Add ( action ); // // Create test case for group object type. // action = new EutAction ( ); action.Action = EutCommand.Test_Group_Command_Layout_Setting; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, group.CmdLayout.ToString ( ) ); this._TestCaseList.Add ( action ); // // Create test case for group parameters // foreach ( Parameter prm in group.Parameters ) { action = new EutAction ( ); action.Action = EutCommand.Test_Group_Parameter_Value; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Parameter_Name, prm.Name ); action.setParameter ( EutCommandParameters.Value, prm.Value ); this._TestCaseList.Add ( action ); }//END parameter interation loop. // // Generat the group fields test cases. // this.generateGroupFieldsTestCases ( group ); this.generateGroupCommandTestCases ( group ); }//END iteration loop }//END generateGroupTestCases method
}//END updateField method // ===================================================================================== /// <summary> /// This class update fields on formfield table using formfield object. /// </summary> /// <param name="SqlUpdateStatement">StringBuilder: containing the SQL update statemenet</param> /// <param name="ParmList">list of SqlParameter objects</param> /// <param name="RecordField">EvFormField: a formfield data object</param> /// <param name="ColumnId">String: column identifier</param> /// <param name="Row">Row: row index</param> // ------------------------------------------------------------------------------------- private void updateSingleValueField( StringBuilder SqlUpdateStatement, List <SqlParameter> ParmList, EdRecordField RecordField, String ColumnId, int Row) { this.LogMethod("updateField method. "); this.LogDebug("ValueCount: " + _ValueCount); // // Define the record field Guid // SqlParameter prm = new SqlParameter(EdRecordValues.PARM_FIELD_GUID + "_" + this._ValueCount, SqlDbType.UniqueIdentifier); prm.Value = RecordField.FieldGuid; ParmList.Add(prm); // // Define the record field Guid // prm = new SqlParameter(EdRecordValues.PARM_VALUE_GUID + "_" + this._ValueCount, SqlDbType.UniqueIdentifier); prm.Value = RecordField.Guid; ParmList.Add(prm); // // Define the record column identifier // prm = new SqlParameter(EdRecordValues.PARM_VALUE_COLUMN_ID + "_" + this._ValueCount, SqlDbType.NVarChar, 10); prm.Value = ColumnId; ParmList.Add(prm); // // Define the record field Guid // prm = new SqlParameter(EdRecordValues.PARM_VALUE_ROW + "_" + this._ValueCount, SqlDbType.SmallInt); prm.Value = Row; ParmList.Add(prm); switch (RecordField.TypeId) { case EvDataTypes.Yes_No: case EvDataTypes.Boolean: { string value = "0"; bool bValue = EvStatics.getBool(RecordField.ItemValue); if (bValue == true) { value = "1"; } prm = new SqlParameter(EdRecordValues.PARM_VALUE_NUMERIC + "_" + this._ValueCount, SqlDbType.Float); prm.Value = value; ParmList.Add(prm); // // Create the add query . // SqlUpdateStatement.AppendLine(" INSERT INTO ED_RECORD_VALUES " + "(" + EdRecordValues.DB_RECORD_GUID + ", " + EdRecordValues.DB_FIELD_GUID + ", " + EdRecordValues.DB_VALUES_GUID + ", " + EdRecordValues.DB_VALUES_COLUMN_ID + ", " + EdRecordValues.DB_VALUES_ROW + ", " + EdRecordValues.DB_VALUES_NUMERIC + " ) "); SqlUpdateStatement.AppendLine("VALUES ("); SqlUpdateStatement.AppendLine( " " + EdRecordValues.PARM_RECORD_GUID + ", " + EdRecordValues.PARM_FIELD_GUID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_GUID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_COLUMN_ID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_ROW + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_NUMERIC + "_" + +this._ValueCount + " );\r\n"); break; } case EvDataTypes.Numeric: { prm = new SqlParameter(EdRecordValues.PARM_VALUE_NUMERIC + "_" + this._ValueCount, SqlDbType.Float); prm.Value = RecordField.ItemValue; ParmList.Add(prm); // // Create the add query . // SqlUpdateStatement.AppendLine(" INSERT INTO ED_RECORD_VALUES " + "(" + EdRecordValues.DB_RECORD_GUID + ", " + EdRecordValues.DB_FIELD_GUID + ", " + EdRecordValues.DB_VALUES_GUID + ", " + EdRecordValues.DB_VALUES_COLUMN_ID + ", " + EdRecordValues.DB_VALUES_ROW + ", " + EdRecordValues.DB_VALUES_NUMERIC + " ) "); SqlUpdateStatement.AppendLine("VALUES ("); SqlUpdateStatement.AppendLine( " " + EdRecordValues.PARM_RECORD_GUID + ", " + EdRecordValues.PARM_FIELD_GUID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_GUID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_COLUMN_ID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_ROW + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_NUMERIC + "_" + +this._ValueCount + " );\r\n"); break; } case EvDataTypes.Date: { if (RecordField.ItemValue == String.Empty) { RecordField.ItemValue = EvStatics.CONST_DATE_NULL.ToString("dd-MMM-yyyy"); } prm = new SqlParameter(EdRecordValues.PARM_VALUE_DATE + "_" + this._ValueCount, SqlDbType.DateTime); prm.Value = RecordField.ItemValue; ParmList.Add(prm); // // Create the add query . // SqlUpdateStatement.AppendLine(" INSERT INTO ED_RECORD_VALUES " + "(" + EdRecordValues.DB_RECORD_GUID + ", " + EdRecordValues.DB_FIELD_GUID + ", " + EdRecordValues.DB_VALUES_GUID + ", " + EdRecordValues.DB_VALUES_COLUMN_ID + ", " + EdRecordValues.DB_VALUES_ROW + ", " + EdRecordValues.DB_VALUES_DATE + " ) "); SqlUpdateStatement.AppendLine("VALUES ("); SqlUpdateStatement.AppendLine( " " + EdRecordValues.PARM_RECORD_GUID + ", " + EdRecordValues.PARM_FIELD_GUID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_GUID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_COLUMN_ID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_ROW + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_DATE + "_" + this._ValueCount + " );\r\n"); break; } case EvDataTypes.Free_Text: { prm = new SqlParameter(EdRecordValues.PARM_VALUE_TEXT + "_" + this._ValueCount, SqlDbType.NText); prm.Value = RecordField.ItemText; ParmList.Add(prm); // // Create the add query . // SqlUpdateStatement.AppendLine(" INSERT INTO ED_RECORD_VALUES " + "(" + EdRecordValues.DB_RECORD_GUID + ", " + EdRecordValues.DB_FIELD_GUID + ", " + EdRecordValues.DB_VALUES_GUID + ", " + EdRecordValues.DB_VALUES_COLUMN_ID + ", " + EdRecordValues.DB_VALUES_ROW + ", " + EdRecordValues.DB_VALUES_TEXT + " ) "); SqlUpdateStatement.AppendLine("VALUES ("); SqlUpdateStatement.AppendLine( " " + EdRecordValues.PARM_RECORD_GUID + ", " + EdRecordValues.PARM_FIELD_GUID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_GUID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_COLUMN_ID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_ROW + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_TEXT + "_" + this._ValueCount + " );\r\n"); break; } default: { prm = new SqlParameter(EdRecordValues.PARM_VALUE_STRING + "_" + this._ValueCount, SqlDbType.NVarChar, 100); prm.Value = RecordField.ItemValue; ParmList.Add(prm); // // Create the add query . // SqlUpdateStatement.AppendLine(" INSERT INTO ED_RECORD_VALUES " + "(" + EdRecordValues.DB_RECORD_GUID + ", " + EdRecordValues.DB_FIELD_GUID + ", " + EdRecordValues.DB_VALUES_GUID + ", " + EdRecordValues.DB_VALUES_COLUMN_ID + ", " + EdRecordValues.DB_VALUES_ROW + ", " + EdRecordValues.DB_VALUES_STRING + " ) "); SqlUpdateStatement.AppendLine("VALUES ("); SqlUpdateStatement.AppendLine( " " + EdRecordValues.PARM_RECORD_GUID + ", " + EdRecordValues.PARM_FIELD_GUID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_GUID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_COLUMN_ID + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_ROW + "_" + this._ValueCount + ", " + EdRecordValues.PARM_VALUE_STRING + "_" + this._ValueCount + " );\r\n"); break; } } //End switch statement } //END method.
}//END generateGroupTestCases method // ================================================================================== /// <summary> /// This method creates page group test cases. /// </summary> // ---------------------------------------------------------------------------------- private void generateGroupCommandTestCases ( Group group ) { this.LogMethod ( "generateGroupCommandTestCases" ); // // Initialise the methods variables and objects. // EutAction action = new EutAction ( ); // // Create test case for page field title. // for ( int i = 0; i < group.CommandList.Count; i++ ) { Command command = group.CommandList [ i ]; action = new EutAction ( ); action.Action = EutCommand.Test_Group_Command_Index; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, i .ToString() ); string title = command.Title; title = title.Replace ( "\r", String.Empty ); title = title.Replace ( "\n", String.Empty ); action = new EutAction ( ); action.Action = EutCommand.Test_Group_Command_Title; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, title ); this._TestCaseList.Add ( action ); // // Create test case for field status. // action = new EutAction ( ); action.Action = EutCommand.Test_Group_Command_Type; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, command.Type.ToString ( ) ); this._TestCaseList.Add ( action ); // // Create test case for field layout. // action = new EutAction ( ); action.Action = EutCommand.Test_Group_Command_Application; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, command.ApplicationId ); // // Create test case for field data type. // action = new EutAction ( ); action.Action = EutCommand.Test_Group_Command_Object; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, command.Object ); this._TestCaseList.Add ( action ); // // Create test case for field is mandatory setting // action = new EutAction ( ); action.Action = EutCommand.Test_Group_Command_Method; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Value, command.Method.ToString ( ) ); this._TestCaseList.Add ( action ); // // Create test case for group parameters // foreach ( Parameter prm in command.Parameters ) { action = new EutAction ( ); action.Action = EutCommand.Test_Group_Command_Parameter_Value; action.Description = EvStatics.enumValueToString ( action.Action ); action.setParameter ( EutCommandParameters.Parameter_Name, prm.Name ); action.setParameter ( EutCommandParameters.Value, prm.Value ); this._TestCaseList.Add ( action ); }//END parameter interation loop. }//END iteration loop }//END generateGroupTestCases method
}//END Method #endregion // ===================================================================================== /// <summary> /// This method generates the commands associated with the selected menu item. /// </summary> /// <param name="MenuItem">The menu object</param> /// <returns>ClientClientDataObjectEvado.Model.UniForm.Command object.</returns> // ------------------------------------------------------------------------------------ public Evado.Model.UniForm.Command getMenuItemCommandObject ( EvMenuItem MenuItem ) { this.resetAdapterLog ( ); this.LogMethod ( "getMenuCommandObject" ); this.LogDebug ( "PageId: {0}, Title: {1}, Group: ", MenuItem.PageId, MenuItem.Title, MenuItem.Group ); Evado.Model.UniForm.Command pageCommand = new Evado.Model.UniForm.Command ( "Title", Evado.Model.UniForm.CommandTypes.Normal_Command, EuAdapter.ADAPTER_ID, String.Empty, Evado.Model.UniForm.ApplicationMethods.Get_Object ); EdStaticPageIds pageId = EdStaticPageIds.Null; if ( EvStatics.tryParseEnumValue<EdStaticPageIds> ( MenuItem.PageId, out pageId ) == true ) { #region Admin menu items // // Administration page commands // switch ( pageId ) { case EdStaticPageIds.Application_Profile: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Application_Properties.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Database_Version: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Application_Properties.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( EdStaticPageIds.Database_Version ); return pageCommand; } case EdStaticPageIds.Email_Templates_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Email_Templates.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Application_Event_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Events.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Application_Event: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Events.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); // // Add the groupCommand parameters. // pageCommand.SetGuid ( this.Session.MenuItem.Guid ); return pageCommand; } case EdStaticPageIds.Organisation_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Organisations.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Organisation_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Organisations.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); // // Add the groupCommand parameters. // pageCommand.SetGuid ( this.Session.MenuItem.Guid ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.User_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Users.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.User_Profile_Update_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Users.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Menu_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Menu.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } }//END admin page switch statement //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region applilcation configuration // // Project configuration menu commands. // switch ( pageId ) { case EdStaticPageIds.Alert_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Alert.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Binary_File_List_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Binary_File.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Selection_List_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Selection_Lists.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Selection_List_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Selection_Lists.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Record_Layout_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Record_Layouts.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Entity_Layout_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entity_Layouts.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } }//END admin page switch statement //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region project analysis and reporting menu items. // // Project analysis and reporting menu commands. // switch ( pageId ) { case EdStaticPageIds.Data_Charting_Page: { this.LogValue ( MenuItem.PageId + " ADDED" ); pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Analysis.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Record_Query_Page: { this.LogValue ( MenuItem.PageId + " ADDED" ); pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Analysis.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Audit_Configuration_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Application_Properties.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Audit_Records_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Application_Properties.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Audit_Record_Items_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Application_Properties.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region reporting menu items. // // Project analysis and reporting menu commands. // switch ( pageId ) { case EdStaticPageIds.Report_Template_View: { this.LogValue ( MenuItem.PageId + " ADDED" ); pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.ReportTemplates.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Report_Template_Page: { this.LogValue ( MenuItem.PageId + " ADDED" ); pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.ReportTemplates.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Operational_Report_List: { this.LogValue ( MenuItem.PageId + " ADDED" ); pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Reports.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Operational_Report_Page: { this.LogValue ( MenuItem.PageId + " ADDED" ); pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Reports.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } }//END switch statement //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region record menu items. // // Project records menu commands. // switch ( pageId ) { // ------------------------------------------------------------------------------ // milestone ancillary records pages. // case EdStaticPageIds.Ancillary_Record_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Ancillary_Record.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Records_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Record_Export_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Record_Admin_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Record_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Records.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); pageCommand.SetGuid ( this.Session.Record.Guid ); if ( this.Session.Entity != null ) { pageCommand.AddParameter ( EdRecord.RecordFieldNames.TypeId, this.Session.Entity.TypeId ); } return pageCommand; } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion #region Entity commands // // Entitity menu commands // case EdStaticPageIds.Entity_View: case EdStaticPageIds.Entity_Query_View: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Entity_Export_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Entity_Admin_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.Model.UniForm.ApplicationMethods.List_of_Objects ); pageCommand.SetPageId ( MenuItem.PageId ); return pageCommand; } case EdStaticPageIds.Entity_Page: { pageCommand = new Model.UniForm.Command ( MenuItem.Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.Model.UniForm.ApplicationMethods.Get_Object ); pageCommand.SetPageId ( MenuItem.PageId ); pageCommand.SetGuid ( this.Session.Entity.Guid ); if ( this.Session.Entity != null ) { pageCommand.AddParameter ( EdRecord.RecordFieldNames.TypeId, this.Session.Entity.TypeId ); } return pageCommand; } }//END switch } //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #endregion return null; }//END convertMenuItem method