}//END getObject method // ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="ClientDataObject">Evado.UniForm.Model.AppData object.</param> // ------------------------------------------------------------------------------ private void getDataObject_MUP_Page ( Evado.UniForm.Model.AppData ClientDataObject ) { this.LogMethod ( "getDataObject_MUP_Page" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( ); Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( ); Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); // // set the client ResultData object properties // ClientDataObject.Id = this.Session.UserProfile.Guid; ClientDataObject.Page.Id = this.Session.UserProfile.Guid; ClientDataObject.Title = EdLabels.User_Profile_Page_Title + this.Session.UserProfile.CommonName; ClientDataObject.Page.Title = ClientDataObject.Title; ClientDataObject.Page.PageId = Evado.Digital.Model.EdStaticPageIds.User_Profile_Page.ToString ( ); ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled; this.LogDebug ( "clientDataObject status: " + ClientDataObject.Page.EditAccess ); this.getDataObject_MUP_GeneralGroup ( ClientDataObject.Page ); this.getDataObject_MUP_DetailsGroup ( ClientDataObject.Page ); this.getDataObject_MUP_OrganisationGroup ( ClientDataObject.Page ); this.getDataObject_MUP_PersonaliseGroup ( ClientDataObject.Page ); this.LogMethodEnd ( "getDataObject_MUP_Page" ); }//END getclientDataObject Method
// ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="Page">Evado.UniForm.Model.Page object.</param> // ------------------------------------------------------------------------------ private void getDataObject_UserGroupCommands ( Evado.UniForm.Model.Group PageGroup ) { this.LogMethod ( "getDataObject_UserGroupCommands" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( ); // // Add the save groupCommand // groupCommand = PageGroup.addCommand ( EdLabels.User_Profile_Save_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Users.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Save_Object ); groupCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.My_User_Profile_Update_Page ); // // Define the save and delete groupCommand parameters // groupCommand.SetGuid ( this.Session.UserProfile.Guid ); this.LogMethodEnd ( "getDataObject_UserGroupCommands" ); }//END getDataObject_GroupCommands method.
}//END getclientDataObject Method // ============================================================================== /// <summary> /// This method adds the user generation group. /// </summary> /// <param name="Page">Evado.UniForm.Model.Page object.</param> // ------------------------------------------------------------------------------ private void getDataObject_MUP_GeneralGroup ( Evado.UniForm.Model.Page Page ) { this.LogMethod ( "getDataObject_MUP_GeneralGroup" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( ); Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( ); List<EvOption> optionList = new List<EvOption> ( ); // // create the page pageMenuGroup // pageGroup = Page.AddGroup ( EdLabels.UserProfile_General_Field_Group_Title ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.EditAccess = Evado.UniForm.Model.EditAccess.Disabled; // // Create the user id object // groupField = pageGroup.createTextField ( String.Empty, EdLabels.User_Profile_Identifier_Field_Label, this.Session.UserProfile.UserId, 80 ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.EditAccess = Evado.UniForm.Model.EditAccess.Enabled; this.LogMethodEnd ( "getDataObject_MUP_GeneralGroup" ); }//END getDataObject_MUP_GeneralGroup Method
}//ENd getFilteredList_SelectionGroup method // ============================================================================== /// <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="FieldName">EdOrganisation.FieldNames enumerated list value</param> // ------------------------------------------------------------------------------ private void getQueryList_StaticOrgFilter ( Evado.UniForm.Model.Group PageGroup, EdOrganisation.FieldNames FieldName ) { this.LogMethod ( "getQueryList_StaticOrgFilter" ); this.LogDebug ( "FieldName: {0}. ", FieldName ); // // Initialise the methods variables and objects. // List<EvOption> optionList = new List<EvOption> ( ); optionList.Add ( new EvOption ( ) ); // // Select the field to be displayed. // switch ( FieldName ) { case EdOrganisation.FieldNames.Address_Country: { optionList = this.AdapterObjects.GetOrganisationFilterList ( EdOrganisation.FieldNames.Address_Country, true ); var field = PageGroup.createSelectionListField ( FieldName, EdLabels.Organisation_Address_Country_Field_Label, this.Session.SelectedCountry, optionList ); field.Layout = EuAdapter.DefaultFieldLayout; field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); break; } case EdOrganisation.FieldNames.Address_Post_Code: { optionList = this.AdapterObjects.GetOrganisationFilterList ( EdOrganisation.FieldNames.Address_Post_Code, true ); var field = PageGroup.createSelectionListField ( FieldName, EdLabels.Organisation_Address_PostCode_Field_Label, this.Session.SelectedPostCode, optionList ); field.Layout = EuAdapter.DefaultFieldLayout; field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); break; } case EdOrganisation.FieldNames.Address_City: { optionList = this.AdapterObjects.GetOrganisationFilterList ( EdOrganisation.FieldNames.Address_City, true ); var field = PageGroup.createSelectionListField ( FieldName, EdLabels.Organisation_Address_City_Field_Label, this.Session.SelectedCity, optionList ); field.Layout = EuAdapter.DefaultFieldLayout; field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); break; } } this.LogMethodEnd ( "getQueryList_StaticOrgFilter" ); }
}//END create_ResetPasswordEmail_Group Method // ============================================================================== /// <summary> /// This method creates the password change group objectt. /// </summary> /// <param name="PageObject">Evado.UniForm.Model.Page object.</param> // ------------------------------------------------------------------------------ private void create_PasswordChangeEmail_Group ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "create_PasswordChangeEmail_Group" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( ); Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( ); // // create the page pageMenuGroup // Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup ( EdLabels.UserAdmin_Password_Confirmation_Group_Title, Evado.UniForm.Model.EditAccess.Inherited ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; // // Add the group comands // this.addGroupCommands ( pageGroup ); if ( this._displayPage == true ) { this.create_Display_Group ( pageGroup, this.AdapterObjects.ContentTemplates.PasswordConfirmationEmail_Title, this.AdapterObjects.ContentTemplates.PasswordConfirmationEmail_Body ); return; } // // Create the home page title // pageField = pageGroup.createTextField ( EvStaticContentTemplates.ClassFieldNames.Password_Confirmation_Email_Title, EdLabels.UserAdmin_Email_Title_Field_Label, this.AdapterObjects.ContentTemplates.PasswordConfirmationEmail_Title, 80 ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the home page title // pageField = pageGroup.createFreeTextField ( EvStaticContentTemplates.ClassFieldNames.Password_Confirmation_Email_Body, EdLabels.UserAdmin_Email_Body_Field_Label, this.AdapterObjects.ContentTemplates.PasswordConfirmationEmail_Body, 80, 20 ); pageField.Layout = EuAdapter.DefaultFieldLayout; pageField.Description = EdLabels.UserAdmin_PasswordChange_Body_Description_Field_Label ; }//END create_PasswordChangeEmail_Group Method
}//END create_PasswordChangeEmail_Group Method // ============================================================================== /// <summary> /// This method add the group commands to the passed group. /// </summary> /// <param name="PageObject">Evado.UniForm.Model.Page object.</param> // ------------------------------------------------------------------------------ private void addGroupCommands ( Evado.UniForm.Model.Group PageGroup ) { // // Initialise the methods variables and objects. // Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( ); if ( this._displayPage == true ) { // // Add the display groupCommand // pageCommand = PageGroup.addCommand ( EdLabels.UserAdmin_Edit_Page_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Email_Templates.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); pageCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.AddParameter ( EuStaticContentTemplates.CONST_DISPLAY_PAGE, "false" ); pageCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Email_Templates_Page ); return; } else { // // Add the display groupCommand // pageCommand = PageGroup.addCommand ( EdLabels.UserAdmin_Display_Page_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Email_Templates.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); pageCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.Get_Object ); pageCommand.AddParameter ( EuStaticContentTemplates.CONST_DISPLAY_PAGE, "true" ); pageCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Email_Templates_Page ); } // // Add the save groupCommand // if ( this._displayPage == false ) { pageCommand = PageGroup.addCommand ( EdLabels.UserAdmin_Save_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Email_Templates.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Save_Object ); } }
}//END getSelectionGroup method // ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="PageObject">Evado.UniForm.Model.Page object.</param> /// <returns>ClientApplicationData object</returns> // ------------------------------------------------------------------------------ public void getListGroup ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getListGroup" ); try { // // Create the new pageMenuGroup. // Evado.UniForm.Model.Group listGroup = PageObject.AddGroup ( EdLabels.ApplicationEvent_List_Group_Title, Evado.UniForm.Model.EditAccess.Inherited ); listGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; listGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Vertical_Orientation; // // generate the page links. // foreach ( EvApplicationEvent applicationEvent in this.Session.ApplicationEventList ) { if ( applicationEvent.UserId != this.Session.EventUserName && this.Session.EventUserName != String.Empty) { continue; } // // Add the trial applicationEvent to the list of applicationEvents as a groupCommand. // Evado.UniForm.Model.Command command = listGroup.addCommand ( applicationEvent.LinkText, EuAdapter.ADAPTER_ID, EuAdapterClasses.Events.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); command.SetGuid ( applicationEvent.Guid ); }//END trial applicationEvent list iteration loop this.LogValue ( "command count: " + listGroup.CommandList.Count ); } catch ( Exception Ex ) { // // Create the error message to be displayed to the user. // this.ErrorMessage = EdLabels.ApplicationEvent_List_Error_Message; // // Generate the log the error event. // this.LogException ( Ex ); } }//END getListObject method.
}//END getDataObject_DetailsGroup Method //================================================================================ /// <summary> /// This method add the group commands to the grop. /// </summary> /// <param name="PageGroup">Evado.UniForm.Model.Group object.</param> // ------------------------------------------------------------------------------ private void getDataObject_GroupCommands ( Evado.UniForm.Model.Group PageGroup ) { this.LogMethod ( "getDataObject_GroupCommands" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( ); // // Add the save groupCommand // if ( PageGroup.EditAccess == Evado.UniForm.Model.EditAccess.Enabled ) { pageCommand = PageGroup.addCommand ( EdLabels.Organisation_Save_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Organisations.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Save_Object ); // // Define the save and delete groupCommand parameters // pageCommand.SetGuid ( this.Session.AdminOrganisation.Guid ); pageCommand.AddParameter ( Evado.Digital.Model.EvcStatics.CONST_SAVE_ACTION, EdOrganisation.ActionCodes.Save.ToString ( ) ); this.LogDebug ( "Org GUid {0}.", this.Session.AdminOrganisation.Guid ); this.LogDebug ( "OrgType {0}.", this.Session.AdminOrganisation.OrgType ); // // Delete command // if ( this.Session.AdminOrganisation.Guid != EvStatics.CONST_NEW_OBJECT_ID && this.Session.AdminOrganisation.OrgType != EdAdapterSettings.EVADO_ORGANISATION ) { pageCommand = PageGroup.addCommand ( EdLabels.Organisation_Delete_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Organisations.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Save_Object ); // // Define the save and delete groupCommand parameters // pageCommand.SetGuid ( this.Session.AdminOrganisation.Guid ); pageCommand.AddParameter ( Evado.Digital.Model.EvcStatics.CONST_SAVE_ACTION, EdOrganisation.ActionCodes.Delete_Object.ToString ( ) ); } } this.LogMethodEnd ( "getDataObject_GroupCommands" ); }//END getDataObject_GroupCommands Method
}//END getOrganisationSelection method // ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="PageObject">Evado.UniForm.Model.Page object.</param> /// <returns>ClientApplicationData object</returns> // ------------------------------------------------------------------------------ public void getListGroup ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getListGroup" ); // // Create the new pageMenuGroup. // Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup ( EdLabels.Organisation_List_Group_Title ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Vertical_Orientation; // // Add the save groupCommand // Evado.UniForm.Model.Command groupCommand = pageGroup.addCommand ( EdLabels.Organisation_New_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Organisations.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Create_Object ); // // Define the save and delete groupCommand parameters // groupCommand.AddParameter ( EuOrganisations.CONST_NEW_FIELD_ID, "true" ); groupCommand.SetBackgroundColour ( Evado.UniForm.Model.CommandParameters.BG_Default, Evado.UniForm.Model.Background_Colours.Purple ); // // generate the page links. // foreach ( EdOrganisation organisation in this.Session.AdminOrganisationList ) { // // Add the trial organisation to the list of organisations as a groupCommand. // Evado.UniForm.Model.Command command = pageGroup.addCommand ( organisation.LinkText, EuAdapter.ADAPTER_ID, EuAdapterClasses.Organisations.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); command.Id = organisation.Guid; command.SetGuid ( organisation.Guid ); }//END organisation list iteration loop this.LogValue ( "pageGroup.CommandList.Count {0}. ", pageGroup.CommandList.Count ); this.LogMethodEnd ( "getListGroup" ); }//END getListGroup method.
}//END getProperties_GeneralPageGroup Method // ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="Page">Evado.UniForm.Model.AppData object.</param> // ------------------------------------------------------------------------------ private void getPropertiesPage_SectionsGroup ( Evado.UniForm.Model.Page Page ) { this.LogMethod ( "getProperties_SectionsPageGroup" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); Evado.UniForm.Model.Command groupCommand = 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 ( ); String stFieldList = String.Empty; // // Define the section properties pageMenuGroup.. // pageGroup = Page.AddGroup ( EdLabels.Form_Properties_Sections_Group_Title ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Vertical_Orientation; // // Add the new form section object. groupCommand = pageGroup.addCommand ( EdLabels.Form_Section_New_Section_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entity_Layouts.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); groupCommand.AddParameter ( EdRecordSection.FormSectionClassFieldNames.Sectn_No.ToString ( ), "-1" ); groupCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Form_Properties_Section_Page ); groupCommand.SetBackgroundDefaultColour ( Evado.UniForm.Model.Background_Colours.Purple ); this.LogValue ( "No of form sections: " + this.Session.EntityLayout.Design.FormSections.Count ); // // Iterate through the sections. // foreach ( EdRecordSection formSection in this.Session.EntityLayout.Design.FormSections ) { groupCommand = pageGroup.addCommand ( formSection.LinkText, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entity_Layouts.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); groupCommand.AddParameter ( EdRecordSection.FormSectionClassFieldNames.Sectn_No.ToString ( ), formSection.No ); groupCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Form_Properties_Section_Page ); } this.LogValue ( "After No of form sections: " + this.Session.EntityLayout.Design.FormSections.Count ); this.LogMethodEnd ( "getProperties_SectionsPageGroup" ); }//END getProperties_SectionsPageGroup Method
}//END create_PasswordChangeEmail_Group Method // ============================================================================== /// <summary> /// This method creates the password change group objectt. /// </summary> /// <param name="PageObject">Evado.UniForm.Model.Page object.</param> // ------------------------------------------------------------------------------ private void create_DemonRegistration_Group ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "create_DemonRegistration_Group" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( ); Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( ); // // create the page pageMenuGroup // Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup ( EdLabels.UserAdmin_Demo_Registration_Group_Title, Evado.UniForm.Model.EditAccess.Inherited ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; // // Add the group comands // this.addGroupCommands ( pageGroup ); // // Create instructions field // pageField = pageGroup.createFreeTextField ( EvStaticContentTemplates.ClassFieldNames.DemoRegistrationInstuctions, EdLabels.UserAdmin_Demo_Registration_Instructions_Field_Label, this.AdapterObjects.ContentTemplates.DemoRegistrationInstuctions, 80, 20 ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create instructions field // pageField = pageGroup.createFreeTextField ( EvStaticContentTemplates.ClassFieldNames.DemoRegistrationConfirmation, EdLabels.UserAdmin_Demo_Registration_Confirmation_Field_Label, this.AdapterObjects.ContentTemplates.DemoRegistrationConfirmation, 80, 20 ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create instructions field // pageField = pageGroup.createFreeTextField ( EvStaticContentTemplates.ClassFieldNames.DemoRegistrationError, EdLabels.UserAdmin_Demo_Registration_Error_Field_Label, this.AdapterObjects.ContentTemplates.DemoRegistrationError, 80, 20 ); pageField.Layout = EuAdapter.DefaultFieldLayout; }//END create_PasswordChangeEmail_Group Method
}//END createViewCommandList method // ============================================================================== /// <summary> /// This method appends the milestone groupCommand to the page milestone list pageMenuGroup /// </summary> /// <param name="CommandEntity">EvForm object</param> /// <param name="PageGroup"> Evado.UniForm.Model.Group</param> // ----------------------------------------------------------------------------- private Evado.UniForm.Model.Command getGroupListCommand ( EdRecord CommandEntity, Evado.UniForm.Model.Group PageGroup, EdRecord.LinkContentSetting ParentLinkSetting ) { this.LogMethod ( "getGroupListCommand" ); this.LogDebug ( "CommandEntity.EntityId: " + CommandEntity.EntityId ); this.LogDebug ( "LinkContentSetting: " + CommandEntity.Design.LinkContentSetting ); this.LogDebug ( "TypeId: " + CommandEntity.TypeId ); this.LogDebug ( "ParentLinkSetting: " + ParentLinkSetting ); // // Set the link setting. // if ( CommandEntity.Design.LinkContentSetting == EdRecord.LinkContentSetting.Null && ParentLinkSetting != EdRecord.LinkContentSetting.Null ) { CommandEntity.Design.LinkContentSetting = ParentLinkSetting; } this.LogDebug ( "FINAL: LinkContentSetting: " + CommandEntity.Design.LinkContentSetting ); this.LogDebug ( "CommandTitle: " + CommandEntity.CommandTitle ); this.LogDebug ( "getFirstTextField: " + CommandEntity.getFirstTextField ( ) ); // // Define the pageMenuGroup groupCommand. // Evado.UniForm.Model.Command groupCommand = PageGroup.addCommand ( CommandEntity.CommandTitle, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities, Evado.UniForm.Model.ApplicationMethods.Get_Object ); groupCommand.Id = CommandEntity.Guid; groupCommand.SetGuid ( CommandEntity.Guid ); groupCommand.AddParameter ( Evado.UniForm.Model.CommandParameters.Short_Title, EdLabels.Label_Record_Id + CommandEntity.RecordId ); if ( CommandEntity.ImageFileName != String.Empty ) { string relativeURL = EuAdapter.CONST_IMAGE_FILE_DIRECTORY + CommandEntity.ImageFileName; groupCommand.AddParameter ( Evado.UniForm.Model.CommandParameters.Image_Url, relativeURL ); } if ( this.Session.UserProfile.hasAdministrationAccess == true ) { groupCommand.Title = CommandEntity.EntityId + " >> " + groupCommand.Title; } return groupCommand; }//END getGroupListCommand method
}//END getOrganisationList method. // ================================================================================== /// <summary> /// This methods returns a pageMenuGroup object contains a selection of organisations. /// </summary> /// <param name="PageObject">Application</param> /// <returns>Evado.UniForm.Model.Group object</returns> // --------------------------------------------------------------------------------- public void getOrganisationSelection ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getOrganisationSelection" ); // // initialise the methods variables and objects. // List<Evado.Model.EvOption> optionList = new List<Evado.Model.EvOption> ( ); Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( ); Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup ( EdLabels.Organisation_List_Selection_Group, Evado.UniForm.Model.EditAccess.Enabled ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; // // get the list of organisations. // optionList = this.AdapterObjects.Settings.GetOrgTypeList ( true ); // // Set the selection to the current site org id. // groupField = pageGroup.createSelectionListField ( EdOrganisation.FieldNames.Org_Type, EdLabels.Config_OrgType_List_Field_Label, this.Session.SelectedOrganisationType.ToString ( ), optionList ); 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 = pageGroup.addCommand ( EdLabels.Organisation_Selection_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Organisations.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); // // Set the custom groupCommand parameter. // customCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); this.LogMethodEnd ( "getOrganisationSelection" ); }//END getOrganisationSelection method
}//END getclientDataObject_Commands Method // ============================================================================== /// <summary> /// This method creates the demonstration user registration instructions. /// </summary> /// <param name="Page">Evado.UniForm.Model.Page object.</param> // ------------------------------------------------------------------------------ private void getDataObject_InstructionsGroup ( Evado.UniForm.Model.Page Page ) { this.LogMethod ( "getDataObject_InstructionsGroup" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); // // create the page pageMenuGroup // pageGroup = Page.AddGroup ( String.Empty, Evado.UniForm.Model.EditAccess.Disabled ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; // // Define the markdown options. // MarkdownSharp.MarkdownOptions markDownOptions = new MarkdownSharp.MarkdownOptions ( ); markDownOptions.AutoHyperlink = true; markDownOptions.AutoNewlines = true; markDownOptions.EmptyElementSuffix = "/>"; markDownOptions.EncodeProblemUrlCharacters = true; markDownOptions.LinkEmails = true; markDownOptions.StrictBoldItalic = true; // // Initialise the markdown class // MarkdownSharp.Markdown markDown = new MarkdownSharp.Markdown ( markDownOptions ); // // perform the html body transformation. // string description = markDown.Transform ( this.AdapterObjects.ContentTemplates.DemoRegistrationInstuctions ); pageGroup.Description = description; // // Add a streamed video if exists. // this.getStreamedVideoField ( pageGroup ); this.LogMethodEnd ( "getDataObject_InstructionsGroup" ); }
}//END addPageCommands method // ============================================================================== /// <summary> /// This method creates the introductory email grop /// </summary> /// <param name="PageObject">Evado.UniForm.Model.Page object.</param> // ------------------------------------------------------------------------------ private void create_Display_Group ( Evado.UniForm.Model.Group PageGroup, String Title, String Body ) { this.LogMethod ( "create_Display_Group" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( ); Title = Title.Replace ( "\r\n\r\n", "\r\n \r\n" ); Title = Title.Replace ( EvcStatics.TEXT_SUBSITUTION_FIRST_NAME, "First" ); Title = Title.Replace ( EvcStatics.TEXT_SUBSITUTION_FAMILY_NAME, "Family" ); Title = Title.Replace ( EvcStatics.TEXT_SUBSITUTION_ADAPTER_TITLE, "Customer name" ); Body = Body.Replace ( "\r\n\r\n", "\r\n \r\n" ); Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_FIRST_NAME, "First" ); Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_FAMILY_NAME, "Family" ); Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_EMAIL_ADDRESS, "*****@*****.**" ); Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_USER_ID, "userId" ); Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_PASSWORD, "password" ); Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_ORG_ID, "org ID" ); Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_ORG_NAME, "Org Name" ); Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_ADAPTER_TITLE, "Customer name" ); Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_PASSWORD_RESET_URL, "https://www1evado.com/reset" ); Body = Body.Replace ( EvcStatics.TEXT_SUBSITUTION_DATE_STAMP, DateTime.Now.ToLongDateString ( ) + " at " + DateTime.Now.ToShortTimeString ( ) ); // // Create the home page title // pageField = PageGroup.createReadOnlyTextField ( String.Empty, EdLabels.UserAdmin_Email_Title_Field_Label, Title ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the home page title // pageField = PageGroup.createReadOnlyTextField ( String.Empty, EdLabels.UserAdmin_Email_Body_Field_Label, Body ); pageField.Layout = EuAdapter.DefaultFieldLayout; }//END create_Display_Group method
// ============================================================================== /// <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="FieldName">EdOrganisation.FieldNames enumerated list value</param> // ------------------------------------------------------------------------------ private void getQueryList_StaticUserFilter ( Evado.UniForm.Model.Group PageGroup, EdUserProfile.FieldNames FieldName ) { this.LogMethod ( "getQueryList_StaticUserFilter" ); this.LogDebug ( "FieldName: {0}. ", FieldName ); // // Initialise the methods variables and objects. // String userSelectionList = this.AdapterObjects.Settings.UserCategoryList; List<EvOption> optionList = new List<EvOption> ( ); optionList.Add ( new EvOption ( ) ); // // Select the field to be displayed. // switch ( FieldName ) { case EdUserProfile.FieldNames.User_Category: { optionList = this.AdapterObjects.getSelectionOptions ( userSelectionList, String.Empty, true, true ); var field = PageGroup.createSelectionListField ( FieldName, EdLabels.UserProfile_User_Category_Field_Label, this.Session.SelectedUserCategory, optionList ); field.Layout = EuAdapter.DefaultFieldLayout; field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); break; } case EdUserProfile.FieldNames.User_Type: { optionList = this.AdapterObjects.getSelectionOptions ( userSelectionList, String.Empty, false, true ); var field = PageGroup.createSelectionListField ( FieldName, EdLabels.UserProfile_User_Type_Field_Label, this.Session.SelectedUserType, optionList ); field.Layout = EuAdapter.DefaultFieldLayout; field.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); break; } } this.LogMethodEnd ( "getQueryList_StaticUserFilter" ); }
// ================================================================================= /// <summary> /// This method generates the streamed video form field object as html markup. /// </summary> /// <param name="GroupField">Evado.UniForm.Model.PageGroup object.</param> // --------------------------------------------------------------------------------- private void getStreamedVideoField ( Evado.UniForm.Model.Group PageGroup ) { this.LogMethod ( "getStreamedVideoField" ); // // if there is not video donot create the video field. // if ( this.AdapterObjects.Settings.DemoRegistrationVideoUrl == String.Empty ) { return; } // // Initialise local variables. // Evado.UniForm.Model.Field groupField = PageGroup.createField ( ); groupField.Type = Evado.Model.EvDataTypes.Streamed_Video; groupField.Value = this.AdapterObjects.Settings.DemoRegistrationVideoUrl; groupField.Description = String.Empty; int iWidth = 800; int iHeight = 0; this.LogDebug ( "iWidth: " + iWidth ); this.LogDebug ( "iHeight: " + iHeight ); if ( iWidth > 0 ) { groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Width, iWidth.ToString ( ) ); } if ( iHeight > 0 ) { groupField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Height, iHeight.ToString ( ) ); } this.LogDebug ( "Value: " + groupField.Value ); return; }//END getStreamedVideoField method.
}//END getDataObject_FieldGroup Method // ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="Page">Evado.UniForm.Model.Page object.</param> // ------------------------------------------------------------------------------ private void getDataObject_GroupCommands ( Evado.UniForm.Model.Group PageGroup ) { this.LogMethod ( "getDataObject_GroupCommands" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( ); // // Add the save groupCommand // groupCommand = PageGroup.addCommand ( EdLabels.Demo_Registration_Save_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.User_Registration.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); groupCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.Get_Object ); groupCommand.SetPageId ( Evado.Digital.Model.EdStaticPageIds.Demo_User_Exit_Page ); this.LogMethodEnd ( "getDataObject_GroupCommands" ); }//END getDataObject_GroupCommands 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 getDataObject_GroupCommands Method // ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="PageObject">Evado.UniForm.Model.AppData object.</param> /// <returns>ClientApplicationData object</returns> // ------------------------------------------------------------------------------ private void getDataObject_DetailsGroup ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getDataObject_DetailsGroup" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( ); List<EvOption> optionList = new List<EvOption> ( ); Evado.UniForm.Model.EditAccess adminAccess = Evado.UniForm.Model.EditAccess.Disabled; if ( this.Session.UserProfile.hasAdministrationAccess == true ) { adminAccess = Evado.UniForm.Model.EditAccess.Enabled; } // // create the page pageMenuGroup // Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup ( String.Empty ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.EditAccess = Evado.UniForm.Model.EditAccess.Enabled; // // Add the group commands // this.getDataObject_GroupCommands ( pageGroup ); // // Create the customer id object // pageField = pageGroup.createTextField ( EdOrganisation.FieldNames.OrgId.ToString ( ), EdLabels.Label_Organisation_Id, String.Empty, this.Session.AdminOrganisation.OrgId, 10 ); pageField.EditAccess = Evado.UniForm.Model.EditAccess.Disabled; pageField.Layout = EuAdapter.DefaultFieldLayout; pageField.EditAccess = adminAccess; // // get the org type selection list. // optionList = this.AdapterObjects.Settings.GetOrgTypeList ( true ); // // Generate the organisation type radio button list field object. // pageField = pageGroup.createSelectionListField ( EdOrganisation.FieldNames.Org_Type.ToString ( ), EdLabels.Organisation_Type_Field_Label, EdLabels.Organisation_Type_Field_Description, this.Session.AdminOrganisation.OrgType, optionList ); pageField.Layout = EuAdapter.DefaultFieldLayout; pageField.Mandatory = true; pageField.EditAccess = adminAccess; if ( this.Session.AdminOrganisation.OrgType == String.Empty ) { pageField.setBackgroundColor ( Evado.UniForm.Model.FieldParameterList.BG_Mandatory, Evado.UniForm.Model.Background_Colours.Red ); } // // Create the customer name object // pageField = pageGroup.createTextField ( EdOrganisation.FieldNames.Name.ToString ( ), EdLabels.Organisation_Name_Field_Label, this.Session.AdminOrganisation.Name, 50 ); pageField.Layout = EuAdapter.DefaultFieldLayout; pageField.Mandatory = true; pageField.setBackgroundColor ( Evado.UniForm.Model.FieldParameterList.BG_Mandatory, Evado.UniForm.Model.Background_Colours.Red ); // // Create the customer name object // if ( this.AdapterObjects.Settings.hasHiddenOrganisationField ( EdOrganisation.FieldNames.Image_File_Name ) == false ) { pageField = pageGroup.createImageField ( EdOrganisation.FieldNames.Image_File_Name.ToString ( ), EdLabels.Organisation_ImageFileame_Field_Label, this.Session.AdminOrganisation.ImageFileName, 300, 200 ); pageField.Layout = EuAdapter.DefaultFieldLayout; try { String stTargetPath = this.UniForm_BinaryFilePath + this.Session.AdminOrganisation.ImageFileName; String stImagePath = this.UniForm_ImageFilePath + this.Session.AdminOrganisation.ImageFileName; this.LogDebug ( "Target path {0}.", stTargetPath ); this.LogDebug ( "Image path {0}.", stImagePath ); // // copy the file into the image directory. // System.IO.File.Copy ( stImagePath, stTargetPath, true ); } catch { } } else { this.Session.Organisation.ImageFileName = String.Empty; } // // Create the street address 1 // if ( this.AdapterObjects.Settings.hasHiddenOrganisationField ( EdOrganisation.FieldNames.Address_1 ) == false ) { pageField = pageGroup.createTextField ( EdOrganisation.FieldNames.Address_1, EdLabels.Organisation_Address_Street_Field_Label, this.Session.AdminOrganisation.AddressStreet_1, 50 ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the street address 2 // pageField = pageGroup.createTextField ( EdOrganisation.FieldNames.Address_2, EdLabels.Organisation_Address_Street_Field_Label, this.Session.AdminOrganisation.AddressStreet_2, 50 ); pageField.Layout = EuAdapter.DefaultFieldLayout; } // // Create the street address city // if ( this.AdapterObjects.Settings.hasHiddenOrganisationField ( EdOrganisation.FieldNames.Address_City ) == false ) { pageField = pageGroup.createTextField ( EdOrganisation.FieldNames.Address_City, EdLabels.Organisation_Address_City_Field_Label, this.Session.AdminOrganisation.AddressCity, 50 ); pageField.Layout = EuAdapter.DefaultFieldLayout; } // // Create the street address state // if ( this.AdapterObjects.Settings.hasHiddenOrganisationField ( EdOrganisation.FieldNames.Address_State ) == false ) { pageField = pageGroup.createTextField ( EdOrganisation.FieldNames.Address_State, EdLabels.Organisation_Address_State_Field_Label, this.Session.AdminOrganisation.AddressState, 10 ); pageField.Layout = EuAdapter.DefaultFieldLayout; } // // Create the street address 1 // if ( this.AdapterObjects.Settings.hasHiddenOrganisationField ( EdOrganisation.FieldNames.Address_Post_Code ) == false ) { pageField = pageGroup.createTextField ( EdOrganisation.FieldNames.Address_Post_Code, EdLabels.Organisation_Address_City_Field_Label, this.Session.AdminOrganisation.AddressPostCode, 50 ); pageField.Layout = EuAdapter.DefaultFieldLayout; } // // Create the street address 1 // if ( this.AdapterObjects.Settings.hasHiddenOrganisationField ( EdOrganisation.FieldNames.Address_Country ) == false ) { pageField = pageGroup.createTextField ( EdOrganisation.FieldNames.Address_Country, EdLabels.Organisation_Address_Country_Field_Label, this.Session.AdminOrganisation.AddressCountry, 50 ); pageField.Layout = EuAdapter.DefaultFieldLayout; } // // Create the organisation telephone number object // if ( this.AdapterObjects.Settings.hasHiddenOrganisationField ( EdOrganisation.FieldNames.Telephone ) == false ) { pageField = pageGroup.createTelephoneNumberField ( EdOrganisation.FieldNames.Telephone.ToString ( ), EdLabels.Organisation_Telephone_Field_Label, this.Session.AdminOrganisation.Telephone ); pageField.Layout = EuAdapter.DefaultFieldLayout; } // // Create the organisation fax number object // if ( this.AdapterObjects.Settings.hasHiddenOrganisationField ( EdOrganisation.FieldNames.Email_Address ) == false ) { pageField = pageGroup.createEmailAddressField ( EdOrganisation.FieldNames.Email_Address.ToString ( ), EdLabels.Organisation_Email_Field_Label, this.Session.AdminOrganisation.EmailAddress ); pageField.Layout = EuAdapter.DefaultFieldLayout; } this.LogMethodEnd ( "getDataObject_DetailsGroup" ); }//END getDataObject_DetailsGroup Method
}//END getRecordExport_ListObject method // ============================================================================== /// <summary> /// This method creates the record view pageMenuGroup containing a list of commands to /// open the form record. /// </summary> /// <param name="Page">Evado.Model.Uniform.Page object to add the pageMenuGroup to.</param> // ------------------------------------------------------------------------------ private void getRecordExport_DownloadGroup ( Evado.UniForm.Model.Page Page ) { this.LogMethod ( "getRecordExport_DownloadGroup" ); this.LogDebug ( "FormRecords_IncludeFreeTextData: " + this.Session.FormRecords_IncludeFreeTextData ); this.LogDebug ( "FormRecords_IncludeDraftRecords: " + this.Session.FormRecords_IncludeDraftRecords ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( ); EvFormRecordExport exportRecords = new EvFormRecordExport ( ); EvExportParameters exportParameters = new EvExportParameters ( ); EdQueryParameters queryParameters = new EdQueryParameters ( ); int exportRecordFileLimit = 250; this.LogDebug ( "exportRecordFileLimit: " + exportRecordFileLimit ); // // IF there are not parameters then exit. // if ( this.Session.Selected_EntityLayoutId == String.Empty ) { this.LogDebug ( " Form {0}. ", this.Session.Selected_EntityLayoutId ); this.LogMethodEnd ( "getRecordExport_DownloadGroup" ); return; } exportParameters = new EvExportParameters ( EvExportParameters.ExportDataSources.Project_Record, this.Session.Selected_EntityLayoutId ); exportParameters.IncludeTestSites = false; exportParameters.IncludeFreeTextData = this.Session.FormRecords_IncludeFreeTextData; exportParameters.IncludeDraftRecords = this.Session.FormRecords_IncludeDraftRecords; queryParameters = new EdQueryParameters ( ); queryParameters.LayoutId = this.Session.Selected_EntityLayoutId; queryParameters.States.Add ( EdRecordObjectStates.Withdrawn ); queryParameters.States.Add ( EdRecordObjectStates.Draft_Record ); queryParameters.States.Add ( EdRecordObjectStates.Empty_Record ); queryParameters.States.Add ( EdRecordObjectStates.Completed_Record ); if ( exportParameters.IncludeDraftRecords == true ) { queryParameters.States.Add ( EdRecordObjectStates.Withdrawn ); } queryParameters.NotSelectedState = true; queryParameters.IncludeSummary = true; queryParameters.IncludeRecordValues = false; queryParameters.IncludeComments = false; // // Create the export ResultData file. // int inResultCount = this._Bll_Entities.geyEntityCount ( queryParameters ); this.LogClass ( this._Bll_Entities.Log ); this.LogDebug ( "inResultCount: " + inResultCount ); // // Create the record display pageMenuGroup. // pageGroup = Page.AddGroup ( EdLabels.Record_Export_Download_Group_Title, Evado.UniForm.Model.EditAccess.Enabled ); pageGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Vertical_Orientation; pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; if ( inResultCount == 0 ) { LogDebug ( "Record Count is 0." ); pageGroup.Description = EdLabels.Form_Record_Export_Empty_List_Error_Message; this.LogMethodEnd ( "getRecordExport_DownloadGroup" ); return; } // // If the record list is less thant the exportrecord limit output. // if ( inResultCount <= exportRecordFileLimit ) { // // export the ResultData. // this.exportRecordData ( pageGroup, 0, exportParameters, this.Session.Selected_EntityLayoutId ); } else { // // Initialise the output loop parameters. int iRecordRangeStart = 0; int iRecordRangeFinish = exportRecordFileLimit; int iterations = ( inResultCount / exportRecordFileLimit ) + 1; this.LogValue ( "iterations: " + iterations ); for ( int iLoop = 0; iLoop < iterations && iRecordRangeFinish <= inResultCount; iLoop++ ) { // // export the ResultData. // var result = this.exportRecordData ( pageGroup, iLoop, exportParameters, this.Session.Selected_EntityLayoutId ); if ( result != EvEventCodes.Ok ) { this.LogDebug ( "Result {0}.", result ); this.LogMethodEnd ( "getRecordExport_DownloadGroup" ); return; } // // Increment the start and finish for then next loop // iRecordRangeStart = iRecordRangeFinish + 1; if ( ( iRecordRangeFinish + exportRecordFileLimit ) < inResultCount ) { iRecordRangeFinish += exportRecordFileLimit; } else { iRecordRangeFinish = inResultCount; } }//END loop iteration statement. } this.LogMethodEnd ( "getRecordExport_DownloadGroup" ); return; }//END getRecordExport_DownloadGroup method
}//END getRecordExport_DownloadGroup method //=================================================================================== /// <summary> /// Thie method exports the record list to a export form. /// </summary> /// <param name="pageGroup">Evado.UniForm.Model.Group object</param> /// <param name="iteration">int: iteration loop</param> /// <param name="exportParameters">EvExportParameters object.</param> /// <param name="FormId">String form identifier</param> /// <returns>True export generated.</returns> //----------------------------------------------------------------------------------- private EvEventCodes exportRecordData ( Evado.UniForm.Model.Group pageGroup, int iteration, EvExportParameters exportParameters, String FormId ) { this.LogMethod ( "exportRecordData" ); // // Initialise the methods variables and objects. // String csvDownload = String.Empty; String csvFileName = String.Empty; EvFormRecordExport exportRecords = new EvFormRecordExport ( this.ClassParameters ); // // Generate the export download CSV ResultData file. // csvDownload = exportRecords.exportRecords ( exportParameters, this.Session.UserProfile ); if ( exportRecords.EventCode != EvEventCodes.Ok ) { this.LogDebug ( "EventCode: " + exportRecords.EventCode ); if ( exportRecords.EventCode == EvEventCodes.Data_Export_Empty_Record_List ) { this.ErrorMessage = EdLabels.Form_Record_Export_Empty_List_Error_Message; } this.LogMethodEnd ( "exportRecordData" ); return exportRecords.EventCode; } this.LogClass ( exportRecords.Log ); // // Create the export file name. // csvFileName = FormId + "-Records-" + DateTime.Now.ToString ( "yy-MM-dd" ) + ".csv"; if ( iteration > 0 ) { csvFileName = FormId + "-Records-" + iteration + "-" + DateTime.Now.ToString ( "yy-MM-dd" ) + ".csv"; } this.LogValue ( "csvDownload length: " + csvDownload.Length ); this.LogValue ( "csvFileName: " + csvFileName ); bool result = Evado.Digital.Model.EvcStatics.Files.saveFile ( this.UniForm_BinaryFilePath, csvFileName, csvDownload ); if ( result == false ) { this.ErrorMessage = EdLabels.Record_Export_Error_Message; this.LogDebugClass ( Evado.Digital.Model.EvcStatics.Files.DebugLog ); this.LogDebug ( "ReturnedEventCode: " + Evado.Digital.Model.EvcStatics.Files.ReturnedEventCode ); this.LogDebug ( this.ErrorMessage ); this.LogMethodEnd ( "exportRecordData" ); return Evado.Digital.Model.EvcStatics.Files.ReturnedEventCode; } Evado.UniForm.Model.Field groupField = pageGroup.createHtmlLinkField ( String.Empty, csvFileName, this.UniForm_BinaryServiceUrl + csvFileName ); this.LogMethodEnd ( "exportRecordData" ); return EvEventCodes.Ok; }//END exportRecordData method.
}//END getStreamedVideoField method. // ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="Page">Evado.UniForm.Model.Page object.</param> // ------------------------------------------------------------------------------ private void getDataObject_FieldGroup ( Evado.UniForm.Model.Page Page ) { this.LogMethod ( "getDataObject_FieldGroup" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Field groupField = new Evado.UniForm.Model.Field ( ); Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( ); // // create the page pageMenuGroup // pageGroup = Page.AddGroup ( String.Empty, Evado.UniForm.Model.EditAccess.Inherited ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.EditAccess = Evado.UniForm.Model.EditAccess.Enabled; pageGroup.SetCommandBackBroundColor ( Evado.UniForm.Model.GroupParameterList.BG_Mandatory, Evado.UniForm.Model.Background_Colours.Red ); // // Add the groups commands. // this.getDataObject_GroupCommands ( pageGroup ); // // Create the user id object // groupField = pageGroup.createTextField ( Evado.Digital.Model.EdUserProfile.FieldNames.UserId.ToString ( ), EdLabels.User_Profile_Identifier_Field_Label, this.Session.AdminUserProfile.UserId, 80 ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.EditAccess = Evado.UniForm.Model.EditAccess.Disabled; // // Create the comon name object // groupField = pageGroup.createTextField ( Evado.Digital.Model.EdUserProfile.FieldNames.CommonName, EdLabels.Dem_Registration_CommonName_Field_Label, this.Session.AdminUserProfile.CommonName, 80 ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.Mandatory = true; // // Create the user's email address object // groupField = pageGroup.createTelephoneNumberField ( Evado.Digital.Model.EdUserProfile.FieldNames.Telephone.ToString ( ), EdLabels.UserProfile_Telephone_Field_Label, this.Session.AdminUserProfile.Telephone ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.Mandatory = true; // // Create the user's email address object // groupField = pageGroup.createEmailAddressField ( Evado.Digital.Model.EdUserProfile.FieldNames.Email_Address.ToString ( ), EdLabels.UserProfile_Email_Field_Label, this.Session.AdminUserProfile.EmailAddress ); groupField.Layout = EuAdapter.DefaultFieldLayout; groupField.Mandatory = true; groupField.setBackgroundColor ( Evado.UniForm.Model.FieldParameterList.BG_Mandatory, Evado.UniForm.Model.Background_Colours.Red ); }//END getDataObject_FieldGroup Method
// ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="PageObject">Evado.UniForm.Model.Page object.</param> /// <returns>ClientApplicationData object</returns> // ------------------------------------------------------------------------------ private void getSelectionListGroup ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getSelectionListGroup" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( ); List<EvOption> optionList = new List<EvOption> ( ); EvOption option = new EvOption ( ); // // Define the selection group object. // Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup ( EdLabels.Menu_Selection, Evado.UniForm.Model.EditAccess.Enabled ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; // // Add the platform selection list // optionList.Add ( new EvOption ( EuMenus.CONST_ADMIN_APPLICATION_IDENTIFIER, EdLabels.Menu_Admin_Platform_Option_Description ) ); optionList.Add ( new EvOption ( EuMenus.CONST_PRODUCTION_APPLICATION_IDENTIFIER, EdLabels.Menu_Production_Platform_Option_Description ) ); pageField = pageGroup.createSelectionListField ( EvMenuItem.MenuFieldNames.Platform.ToString ( ), EdLabels.Menu_Platform_Field_Label, this.Session.MenuPlatformId, optionList ); pageField.Layout = EuAdapter.DefaultFieldLayout; pageField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // Create the pageMenuGroup selection list. // List<Evado.Model.EvOption> groupList = this.GetGroupList ( ); if ( groupList.Count > 1 ) { pageField = pageGroup.createSelectionListField ( EuSession.CONST_MENU_GROUP_ID, EdLabels.Menu_Group_ID, this.Session.MenuGroupIdentifier, groupList ); pageField.Layout = EuAdapter.DefaultFieldLayout; pageField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); } // // Add the selection command // Evado.UniForm.Model.Command selectionCommand = pageGroup.addCommand ( EdLabels.Menu_Selection_Menu, EuAdapter.ADAPTER_ID, EuAdapterClasses.Menu.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); // // Set the custom groupCommand parametet. // selectionCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); }
}//END getObject method // ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="ClientDataObject">Evado.UniForm.Model.AppData object.</param> /// <returns>ClientApplicationData object</returns> // ------------------------------------------------------------------------------ private void getDataObject ( Evado.UniForm.Model.AppData ClientDataObject ) { this.LogMethod ( "getDataObject" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( ); Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( ); ClientDataObject.Id = this._ApplicationEvent.Guid; ClientDataObject.Title = EdLabels.ApplicationEvent_Page_Title; ClientDataObject.Page.Id = ClientDataObject.Id; ClientDataObject.Page.Title = ClientDataObject.Title; ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled; // // Add the help button if the help url is defined. // if ( this.AdapterObjects.HelpUrl != String.Empty ) { Evado.UniForm.Model.Command helpCommand = ClientDataObject.Page.addCommand ( EdLabels.Label_Help_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Events.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); helpCommand.Type = Evado.UniForm.Model.CommandTypes.Http_Link; helpCommand.AddParameter ( Evado.UniForm.Model.CommandParameters.Link_Url, EvcStatics.createHelpUrl ( this.AdapterObjects.HelpUrl, Evado.Digital.Model.EdStaticPageIds.Application_Event ) ); } // // create the page pageMenuGroup // Evado.UniForm.Model.Group pageGroup = ClientDataObject.Page.AddGroup ( String.Empty, String.Empty, Evado.UniForm.Model.EditAccess.Inherited ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.EditAccess = Evado.UniForm.Model.EditAccess.Enabled; // // Create the customer id object // pageField = pageGroup.createReadOnlyTextField ( String.Empty, EdLabels.ApplicationEvent_Date_Time_Field_Label, this._ApplicationEvent.DateTime.ToString ( "dd MMM yyyy HH:mm:ss" ) ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the event id object // { if ( this._ApplicationEvent.EventId == 0 || this._ApplicationEvent.EventId == 1 ) { this._ApplicationEvent.EventId = (int) EvEventCodes.Ok; } EvEventCodes code = (EvEventCodes) this._ApplicationEvent.EventId; String content = this._ApplicationEvent.EventId.ToString ( "000000" ) + " > " + Evado.Model.EvStatics.enumValueToString ( code ); pageField = pageGroup.createReadOnlyTextField ( String.Empty, EdLabels.ApplicationEvent_Event_Id_Field_Label, content ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the type id object // pageField = pageGroup.createReadOnlyTextField ( String.Empty, EdLabels.ApplicationEvent_Type_Field_Label, Evado.Model.EvStatics.enumValueToString ( this._ApplicationEvent.Type ) ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the Category id object // pageField = pageGroup.createReadOnlyTextField ( String.Empty, EdLabels.ApplicationEvent_Category_Field_Label, this._ApplicationEvent.Category ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the description object // pageField = pageGroup.createFreeTextField ( String.Empty, EdLabels.ApplicationEvent_Description_Field_Label, this._ApplicationEvent.Description, 80, 40 ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the user object // pageField = pageGroup.createReadOnlyTextField ( String.Empty, EdLabels.ApplicationEvent_UserName_Field_Label, this._ApplicationEvent.UserId ); pageField.Layout = EuAdapter.DefaultFieldLayout; }//END Method
// ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="PageObject">Evado.UniForm.Model.Page object.</param> /// <param name="GroupId">string: group identifier.</param> /// <returns>ClientApplicationData object</returns> // ------------------------------------------------------------------------------ private void getList_Menu_List_Group ( Evado.UniForm.Model.Page PageObject, String GroupId ) { this.LogMethod ( "getListGroup" ); this.LogValue ( "GroupId: " + GroupId ); try { // // initialise the methods variables and objects. // List<EvMenuItem> menuList = new List<EvMenuItem> ( ); Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( ); // // Create the list pageMenuGroup object. // Evado.UniForm.Model.Group pageGroup = PageObject.AddGroup ( EdLabels.Menu_Item_List, Evado.UniForm.Model.EditAccess.Inherited ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Vertical_Orientation; pageGroup.Title = EdLabels.Menu_Item_List; // // Display a message if the pageMenuGroup has not been selected. // if ( GroupId == String.Empty ) { pageGroup.Description = EdLabels.Menu_List_Group_Not_Selected_Message; return; } // // Add the save groupCommand // groupCommand = pageGroup.addCommand ( EdLabels.Menu_New_Item_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Menu.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Create_Object ); groupCommand.SetBackgroundDefaultColour ( Evado.UniForm.Model.Background_Colours.Purple ); // // get the list of customers. // foreach ( EvMenuItem item in this.AdapterObjects.MenuList ) { if ( item.Group.ToLower ( ) == GroupId.ToLower ( ) ) { menuList.Add ( item ); } } // // generate the page links. // foreach ( EvMenuItem menuItem in menuList ) { this.LogValue ( "P: " + menuItem.PageId + ", T: " + menuItem.Title + ", R: " + menuItem.RoleList ); // // Add the Menu Field to the list of organisations as a groupCommand. // groupCommand = pageGroup.addCommand ( menuItem.LinkText, EuAdapter.ADAPTER_ID, EuAdapterClasses.Menu.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Get_Object ); groupCommand.SetGuid ( menuItem.Guid ); }//END Menu Field list iteration loop this.LogValue ( " command object count: " + pageGroup.CommandList.Count ); } catch ( Exception Ex ) { // // Create the error message to be displayed to the user. // this.ErrorMessage = "Error raised when generating a list of trial sites."; // // Generate the log the error event. // this.LogException ( Ex ); } }//END getListObject method.
}//END getListObject method. // ============================================================================== /// <summary> /// This method creates the record view pageMenuGroup containing a list of commands to /// open the form record. /// </summary> /// <param name="Page">Evado.Model.Uniform.Page object to add the pageMenuGroup to.</param> // ------------------------------------------------------------------------------ private void getRecordExport_SelectionGroup ( Evado.UniForm.Model.Page Page ) { this.LogMethod ( "getRecordExport_SelectionGroup" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); Evado.UniForm.Model.Command command = new Evado.UniForm.Model.Command ( ); Evado.UniForm.Model.Field selectionField = new Evado.UniForm.Model.Field ( ); List<EvOption> optionList = new List<EvOption> ( ); // // If the issued form list is empty fill it with the currently issued form selection objects. // if ( this.Session.IssueFormList.Count == 0 ) { this.LogDebug ( "Issued Forms is empty so create list." ); EdRecordLayouts forms = new EdRecordLayouts ( this.ClassParameters ); this.Session.IssueFormList = forms.getList ( EdRecordTypes.Null, EdRecordObjectStates.Form_Issued, false ); } this.LogDebug ( "Issued Forms list count {0}.", this.Session.IssueFormList.Count ); // // Create the new pageMenuGroup for query selection. // pageGroup = Page.AddGroup ( EdLabels.Record_Selection_Group_Title, Evado.UniForm.Model.EditAccess.Enabled ); pageGroup.GroupType = Evado.UniForm.Model.GroupTypes.Default; pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.AddParameter ( Evado.UniForm.Model.GroupParameterList.Offline_Hide_Group, true ); // // Add the selection pageMenuGroup. // selectionField = pageGroup.createSelectionListField ( EdRecord.FieldNames.Layout_Id, EdLabels.Label_Form_Id, this.Session.Selected_EntityLayoutId, this.Session.IssueFormList ); selectionField.Layout = EuAdapter.DefaultFieldLayout; // // Define the include draft record selection option. // selectionField = pageGroup.createBooleanField ( EuEntities.CONST_INCLUDE_DRAFT_RECORDS, EdLabels.Record_Export_Include_Draft_Record_Field_Title, this.Session.FormRecords_IncludeDraftRecords ); selectionField.Layout = EuAdapter.DefaultFieldLayout; // // Define the include free text ResultData selection option. // selectionField = pageGroup.createBooleanField ( EuEntities.CONST_INCLUDE_FREE_TEXT_DATA, EdLabels.Record_Export_Include_FreeText_data_Field_Title, this.Session.FormRecords_IncludeFreeTextData ); selectionField.Layout = EuAdapter.DefaultFieldLayout; // // Add the selection groupCommand // command = pageGroup.addCommand ( EdLabels.Record_Export_Selection_Group_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); command.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); }//END getRecordExport_ListObject method
// ============================================================================== /// <summary> /// This method returns a client application ResultData object /// </summary> /// <param name="ClientDataObject">Evado.UniForm.Model.AppData object.</param> /// <returns>ClientApplicationData object</returns> // ------------------------------------------------------------------------------ private void getClientData ( Evado.UniForm.Model.AppData ClientDataObject ) { this.LogMethod ( "getDataObject" ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Command pageCommand = new Evado.UniForm.Model.Command ( ); Evado.UniForm.Model.Field pageField = new Evado.UniForm.Model.Field ( ); List<EvOption> optionList = new List<EvOption> ( ); EvOption option = new EvOption ( ); ClientDataObject.Id = this.Session.MenuItem.Guid; ClientDataObject.Title = EdLabels.Menu_Item; ClientDataObject.Page.Id = ClientDataObject.Id; ClientDataObject.Page.Title = ClientDataObject.Title; ClientDataObject.Page.EditAccess = Evado.UniForm.Model.EditAccess.Enabled; // // create the page pageMenuGroup // Evado.UniForm.Model.Group pageGroup = ClientDataObject.Page.AddGroup ( EdLabels.Menu_General_Group_Title, Evado.UniForm.Model.EditAccess.Inherited ); pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; // // Add the platform selection list // optionList.Add ( new EvOption ( EuMenus.CONST_ADMIN_APPLICATION_IDENTIFIER, EdLabels.Menu_Admin_Platform_Option_Description ) ); optionList.Add ( new EvOption ( EuMenus.CONST_PRODUCTION_APPLICATION_IDENTIFIER, EdLabels.Menu_Production_Platform_Option_Description ) ); pageField = pageGroup.createSelectionListField ( String.Empty, EdLabels.Menu_Platform_Field_Label, this.Session.MenuPlatformId, optionList ); pageField.EditAccess = Evado.UniForm.Model.EditAccess.Disabled; // // Create the customer id object // optionList = this.AdapterObjects.PageIdentifiers; Evado.Digital.Model.EvcStatics.sortOptionListValues ( optionList ); pageField = pageGroup.createSelectionListField ( EvMenuItem.MenuFieldNames.Page_Id.ToString ( ), EdLabels.Menu_Page_Id_Field_Label, this.Session.MenuItem.PageId.ToString ( ), optionList ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the customer name object // pageField = pageGroup.createTextField ( EvMenuItem.MenuFieldNames.Title.ToString ( ), EdLabels.Menu_Title_Field_Label, String.Empty, this.Session.MenuItem.Title, 20 ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the customer name object // pageField = pageGroup.createNumericField ( EvMenuItem.MenuFieldNames.Order.ToString ( ), EdLabels.Menu_Order_Field_Label, this.Session.MenuItem.Order, 0, 200 ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Create the customer name object // optionList = this.AdapterObjects.Settings.GetRoleOptionList ( false ); string roles = this.Session.MenuItem.RoleList; pageField = pageGroup.createCheckBoxListField ( EvMenuItem.MenuFieldNames.Role_List.ToString ( ), EdLabels.Menu_Role_List_Field_Label, roles, optionList ); pageField.Layout = EuAdapter.DefaultFieldLayout; pageField.Description = EdLabels.Menu_Role_List_Field_Description; // // Create the customer name object // pageField = pageGroup.createTextField ( EvMenuItem.MenuFieldNames.Parameters.ToString ( ), EdLabels.Menu_Parameters_Field_Label, String.Empty, this.Session.MenuItem.Parameters, 20 ); pageField.Layout = EuAdapter.DefaultFieldLayout; // // Add the save groupCommand // pageCommand = pageGroup.addCommand ( EdLabels.Menu_Save_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Menu.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Save_Object ); // // Define the save and delete groupCommand parameters // pageCommand.SetGuid ( ClientDataObject.Id ); // // Add the delete groupCommand object. // pageCommand = pageGroup.addCommand ( EdLabels.Menu_Delete_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Menu.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Save_Object ); // // Define the save and delete groupCommand parameters // pageCommand.SetGuid ( ClientDataObject.Id ); pageCommand.AddParameter ( Evado.Digital.Model.EvcStatics.CONST_SAVE_ACTION, EuMenus.CONST_DELETE_ACTION ); }//END Method
}//END getListObject method. // ============================================================================== /// <summary> /// This method creates the record view pageMenuGroup containing a list of commands to /// open the form record. /// </summary> /// <param name="PageObject">Evado.Model.Uniform.Page object to add the pageMenuGroup to.</param> // ------------------------------------------------------------------------------ private void getList_SelectionGroup ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getList_SelectionGroup" ); this.LogDebug ( "IssuedEntityLayouts.Count {0}. ", this.AdapterObjects.IssuedEntityLayouts.Count ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); List<EvOption> optionList; Evado.UniForm.Model.Field selectionField; if ( this._HideSelectionGroup == true ) { this.LogMethodEnd ( "getList_SelectionGroup" ); return; } // // Create the new pageMenuGroup for record selection. // pageGroup = PageObject.AddGroup ( EdLabels.Entities_Selection_Group_Title, Evado.UniForm.Model.EditAccess.Enabled ); pageGroup.GroupType = Evado.UniForm.Model.GroupTypes.Default; pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; pageGroup.AddParameter ( Evado.UniForm.Model.GroupParameterList.Offline_Hide_Group, true ); // // Add the record state selection option // optionList = new List<EvOption> ( ); optionList.Add ( new EvOption ( ) ); foreach ( EdRecord layout in this.AdapterObjects.IssuedEntityLayouts ) { optionList.Add ( new EvOption ( layout.LayoutId, String.Format ( "{0} - {1}", layout.LayoutId, layout.Title ) ) ); } selectionField = pageGroup.createSelectionListField ( EdRecord.FieldNames.Layout_Id, EdLabels.Label_Form_Id, this.Session.Selected_EntityLayoutId, optionList ); selectionField.Layout = EuAdapter.DefaultFieldLayout; selectionField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // Add the record state selection option // optionList = EdRecord.getRecordStates ( false ); selectionField = pageGroup.createSelectionListField ( EdRecord.FieldNames.Status.ToString ( ), EdLabels.Record_State_Selection, this.Session.EntityStateSelection, optionList ); selectionField.Layout = EuAdapter.DefaultFieldLayout; selectionField.AddParameter ( Evado.UniForm.Model.FieldParameterList.Snd_Cmd_On_Change, 1 ); // // Add the selection groupCommand // Evado.UniForm.Model.Command selectionCommand = pageGroup.addCommand ( EdLabels.Select_Records_Command_Title, EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities.ToString ( ), Evado.UniForm.Model.ApplicationMethods.Custom_Method ); selectionCommand.setCustomMethod ( Evado.UniForm.Model.ApplicationMethods.List_of_Objects ); }//ENd getList_SelectionGroup method
}//END executeRecordQuery method. // ============================================================================== /// <summary> /// This method creates the record view pageMenuGroup containing a list of commands to /// open the form record. /// </summary> /// <param name="PageObject">Evado.Model.Uniform.Page object to add the pageMenuGroup to.</param> /// <param name="RecordList">List of EvForm: form record objects.</param> // ------------------------------------------------------------------------------ private void getEntity_ListGroup ( Evado.UniForm.Model.Page PageObject ) { this.LogMethod ( "getEntity_ListGroup" ); this.LogDebug ( "PageObject.EditAccess {0}.", PageObject.EditAccess ); this.LogDebug ( "this.Session.EntityLayout.Title {0}.", this.Session.EntityLayout.Title ); // // Initialise the methods variables and objects. // Evado.UniForm.Model.Group pageGroup = new Evado.UniForm.Model.Group ( ); Evado.UniForm.Model.Command groupCommand = new Evado.UniForm.Model.Command ( ); // // Create the record display pageMenuGroup. // pageGroup = PageObject.AddGroup ( EdLabels.Entity_List_Group_Title ); pageGroup.CmdLayout = Evado.UniForm.Model.GroupCommandListLayouts.Vertical_Orientation; pageGroup.Layout = Evado.UniForm.Model.GroupLayouts.Full_Width; if ( this.Session.EntityLayout.Title != String.Empty ) { pageGroup.Title = String.Format ( EdLabels.Entity_List_Title_Group_Title, this.Session.EntityLayout.Title ); } if ( this.Session.EntityList.Count > 0 ) { pageGroup.Title += EdLabels.List_Count_Label + this.Session.EntityList.Count; } // // Add a create record command. // if ( this.Session.Selected_EntityLayoutId != String.Empty && this.Session.PageId != Evado.Digital.Model.EdStaticPageIds.Entity_Filter_View.ToString ( ) && pageGroup.EditAccess == Evado.UniForm.Model.EditAccess.Enabled && ( this.Session.EntityLayout.Design.ParentEntities.Contains ( this.ParentLayoutId ) == true || this.Session.EntityLayout.Design.ParentEntities == String.Empty ) ) { groupCommand = pageGroup.addCommand ( String.Format ( EdLabels.Entity_Create_New_List_Command_Title, this.Session.EntityLayout.Title ), EuAdapter.ADAPTER_ID, EuAdapterClasses.Entities, Evado.UniForm.Model.ApplicationMethods.Create_Object ); groupCommand.SetBackgroundDefaultColour ( Evado.UniForm.Model.Background_Colours.Purple ); groupCommand.AddParameter ( Evado.Digital.Model.EdRecord.FieldNames.Layout_Id, this.Session.Selected_EntityLayoutId ); groupCommand.AddParameter ( EdRecord.FieldNames.ParentGuid, this.Session.Entity.Guid ); groupCommand.SetGuid ( this.Session.Entity.Guid ); } this.LogDebug ( "EntityList.Count: " + this.Session.EntityList.Count ); // // Iterate through the record list generating a groupCommand to access each record // then append the groupCommand to the record pageMenuGroup view's groupCommand list. // foreach ( Evado.Digital.Model.EdRecord entity in this.Session.EntityList ) { this.LogDebug ( "LCD {0}, LT {1}, FC {2}", entity.Design.LinkContentSetting, entity.CommandTitle, entity.Fields.Count ); // // Create the group list groupCommand object. // this.getGroupListCommand ( entity, pageGroup, this.Session.EntityLayout.Design.LinkContentSetting ); }//END iteration loop this.LogValue ( "Group command count: " + pageGroup.CommandList.Count ); this.LogMethodEnd ( "getRecord_ListGroup" ); }//END createViewCommandList method