Base solution for your next web application

Activities of "mgcode"

Hi, with the following snippet of code I have implemented a customAppService method (SubmitQuestionnaireForm) in which I retrieve the object quesionnaire from questionnaireRepository and I set the status property to "UploadedByClient" value.

Then I call the CreateOrEdit default method in which I try to enforce some logic using the previous and new values. In real time, I realised that both questionnaire and input had the new value.

Please advice on which is the proper way to achieve this functionality and perform validation and notifications logic prior to update.

        public async Task<bool> SubmitQuestionnaireForm(object obj, int id)
        {
            var questionnaire = await _questionnaireRepository.GetAsync(id);
            questionnaire.Status = QuestionnaireStatus.UploadedByClient;

            CreateOrEditQuestionnaireDto questionnaireDto = new CreateOrEditQuestionnaireDto();
            questionnaireDto = ObjectMapper.Map<CreateOrEditQuestionnaireDto>(questionnaire);
            await _questionnairesAppService.CreateOrEdit(questionnaireDto);

            return true;
        }    
  
  
  public async Task CreateOrEdit(CreateOrEditQuestionnaireDto input)
         {
            if(input.Id == null){
				await Create(input);
			}
			else{
				await Update(input);
			}
         }
         
         

        private async Task Update(CreateOrEditQuestionnaireDto input)
        {
            var questionnaire = await _questionnaireRepository.FirstOrDefaultAsync((int)input.Id);
            
            bool sendIMS_Questionnaire_Update_Status_QuestionnaireUploadedNotification = false;

            if (questionnaire.Status != QuestionnaireStatus.UploadedByClient && input.Status == QuestionnaireStatus.UploadedByClient)
            {
                sendIMS_Questionnaire_Update_Status_QuestionnaireUploadedNotification = true;
            }

            ObjectMapper.Map(input, questionnaire);

            if (sendIMS_Questionnaire_Update_Status_QuestionnaireUploadedNotification)
            {
                await _appNotifier.IMS_Questionnaire_Update_Status_QuestionnaireUploaded(questionnaire);
            }
        }

Thank you in advance for your time and help

Hello,

I have three user roles: administrators, supervisors and agents. I have set their role permissions so that supervisors have access to the agents and actions entities.

What is the proper way to limit the supervisors' access only to their agents and the actions their agents have conducted?

Thank you in advance for your time and help,

PS. Agents entity has a property SupervisorID and a property UserID and the Actions entity has a property AgentID

Best Regards,

Hello,

I have been assigned a project and my client has not decided on the application name yet. I have to develop a demo application, deploy it in the cloud (Azure), demonstrate it to my client, and, if the client is satisfied, deploy the live version of my project and get paid.

With that in mind, please advice on what is the best way to do it.

  1. Will I be able to achieve the above-mentioned requirements by generating a demo project? What are the actual limitations of a demo project?
  2. Is there a simple way or tool to migrate my code from the demo project with the "whatever" name to my live generated project with the right name?
  3. If I go with one name to generate a live project can I change the name later?

Thank you in advance for your time and help,

Best Regards,

Hello velu, thanks for sending your project. Since my project uses ASP.NET Core and jQuery, I would greatly appreciate it if you (or anyone in the community) could provide a project using these technologies instead of ASP.NET Core and Angular.

Thank you once more for your time and help,

Vasilis, [email protected]

Hello velu,

I am also interested in learning how you implemented the integration with devexpress reporting.

I would appreciate it, if you could share your link with me, as well.

Thank you in advance. Vasilis, [email protected]

Showing 11 to 15 of 15 entries