Exemplo n.º 1
0
        public IActionResult Create([FromBody] Cmssetup contentModel)
        {
            try
            {
                CurrentUser cUser = new CurrentUser(HttpContext, _configuration);
                contentModel.CreatedBy = cUser.UserId;
                string insertQuery = @"INSERT INTO [dbo].[Cmssetup]([TypeCode]
                                      ,[TypeName]
                                      ,[Descriptions]
                                      ,[TypeText]
                                        ,[TypeOrder]
                                        ,[CreatedBy]) 
                                        VALUES 
                                        (@TypeCode, @TypeName, @Descriptions, @TypeText, @TypeOrder, @CreatedBy)";

                using (var conn = con.MasterCon())
                {
                    return(Ok(conn.Execute(insertQuery, contentModel)));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public IActionResult Update([FromBody] Cmssetup contentModel)
        {
            string updateQuery = @"UPDATE [dbo].[Cmssetup] SET 
                                    TypeCode = @TypeCode,
                                    TypeName = @TypeName, 
                                    Descriptions = @Descriptions, 
                                    TypeText = @TypeText,
                                    TypeOrder = @TypeOrder,
                                    Active = @Active 
                                    WHERE Cmsid = @Cmsid";

            using (var conn = con.MasterCon())
            {
                return(Ok(conn.Execute(updateQuery, contentModel)));
            }
        }
Exemplo n.º 3
0
        public async Task <dynamic> PrepareUserPasswordNotification(string UserName, string UserEmail, string Password, string BaseUrl)
        {
            EmailViewModel emailViewModel         = new EmailViewModel();
            List <EmailAttributesViewModel> eavms = new List <EmailAttributesViewModel>();
            EmailAttributesViewModel        eavm  = new EmailAttributesViewModel
            {
                Name    = UserName,
                EmailId = UserEmail
            };

            eavms.Add(eavm);
            emailViewModel.ToEmailList = eavms;
            emailViewModel.Subject     = "Account Password";
            Cmssetup cmssetup = await cmsRepo.GetContentByTypeCode("O_UPN");

            string EmailBody = cmssetup.TypeText.Replace("$@USER_NAME@$", UserName).Replace("$@USER_EMAIL@$", UserEmail).Replace("$@USER_PASSWORD@$", Password).Replace("$@SIGN_IN_URL@$", BaseUrl);

            emailViewModel.Body = EmailBody;

            return(await emailService.SendInvite(emailViewModel));;
        }
Exemplo n.º 4
0
        public async Task <dynamic> PrepareUserEmailNotification(string UserName, string UserEmail, string ActivationURL)
        {
            EmailViewModel emailViewModel         = new EmailViewModel();
            List <EmailAttributesViewModel> eavms = new List <EmailAttributesViewModel>();
            EmailAttributesViewModel        eavm  = new EmailAttributesViewModel
            {
                Name    = UserName,
                EmailId = UserEmail
            };

            eavms.Add(eavm);
            emailViewModel.ToEmailList = eavms;
            emailViewModel.Subject     = "Account Activation";
            Cmssetup cmssetup = await cmsRepo.GetContentByTypeCode("O_UA");

            string EmailBody = cmssetup.TypeText.Replace("$@USER_NAME@$", UserName).Replace("$@USER_EMAIL@$", UserEmail).Replace("$@USER_MAIL_ACTIVATION_URL@$", ActivationURL);

            emailViewModel.Body = EmailBody;

            return(await emailService.SendInvite(emailViewModel));;
        }