Beispiel #1
0
        public DataTable GetEmailConfig(string ConfigName)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@ConfigName", ConfigName)
            };

            return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetEmailConfig, param));
        }
        public List <MenuModel> GetMenu(int menuId)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@MenuId", menuId)
            };

            return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.GetLayoutMenu, param).ToList <MenuModel>());
        }
        public DataTable DropdownList(string key)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@key", key)
            };

            return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_DropdownList, param));
        }
        public EmailSaveTemplateModel GetEmailTemplate(int templateId)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@templateId", templateId)
            };

            return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetEmailTemplateById, param).ToList <EmailSaveTemplateModel>().FirstOrDefault());
        }
Beispiel #5
0
        public List <ZodiacReportModel> GetZodiacReport(int zodiacReportId = 0)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@ZodiacReportId", zodiacReportId)
            };

            return(DataExecutor.ExecuteDataTable(Utilities.UtilityConstant.Procedures.Mst_GetZodiacReport, param).ToList <ZodiacReportModel>());
        }
        public DataTable GetUser(int userId = 0)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@UserId", userId)
            };

            return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetUsers, param));
        }
Beispiel #7
0
        public List <UserQueryModel> GetUserQuery(string status = null)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@status", status)
            };

            return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetUserQuery, param).ToList <UserQueryModel>());
        }
Beispiel #8
0
        public List <AstrologerModel> GetAstrologers(int astrologerId = 0)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@astrologerId", astrologerId)
            };

            return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetAstrologers, param).ToList <AstrologerModel>());
        }
        public List <RefLookupModel> GetReferenceLookup(string key)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@key", key)
            };

            return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetReferenceLookup, param).ToList <RefLookupModel>());
        }
        public List <DowntimeModel> GetAppDowntime(int DowntimeId = 0)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@id", DowntimeId)
            };

            return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetAppDowntime, param).ToList <DowntimeModel>());
        }
 public DowntimeModel HasAppDowntime()
 {
     try
     {
         return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_HasAppDowntime).ToList <DowntimeModel>().FirstOrDefault());
     }
     catch (Exception ex)
     {
         return(new DowntimeModel());
     }
 }
        public List <PageMenuModel> GetLayoutMenu()
        {
            List <PageMenuModel> pageMenuTemp = DataExecutor.ExecuteDataTable("GetLayoutMenu").ToList <PageMenuModel>();
            List <PageMenuModel> pageMenus    = new List <PageMenuModel>();

            pageMenus.AddRange(pageMenuTemp.Where(x => x.ParentMenu.Equals("Parent")).OrderBy(x => x.DisplayOrder).ToList());
            foreach (var parent in pageMenus)
            {
                parent.ChildMenu = new List <PageMenuModel>();
                parent.ChildMenu.AddRange(pageMenuTemp.Where(x => x.ParentMenuName == parent.MenuName).OrderBy(x => x.DisplayOrder).ToList());
            }

            return(pageMenus);
        }
Beispiel #13
0
        public List <string> GetEmailsByGroup(string groupName)
        {
            List <string> emails = null;
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@groupname", groupName)
            };
            var dtTemplate = DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetEmailGroup, param);

            if (dtTemplate != null && dtTemplate.Rows.Count > 0 && dtTemplate.Columns.Contains("Emails"))
            {
                emails = dtTemplate.Rows[0]["Emails"].ToString().Split(",").Select(x => x.Trim()).ToList();
            }
            return(emails);
        }
        public EmailTemplateModel GetEmailTemplate(EmailTemplate emailTemplate)
        {
            EmailTemplateModel emailTemplateModel       = new EmailTemplateModel();
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@mappingName", emailTemplate.ToString())
            };
            var dtTemplate = DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetEmailTemplateByMapping, param);

            if (dtTemplate != null && dtTemplate.Rows.Count > 0 && dtTemplate.Columns.Contains("EmailTemplate"))
            {
                emailTemplateModel.Template = dtTemplate.Rows[0]["EmailTemplate"].ToString();
                emailTemplateModel.Subject  = dtTemplate.Rows[0]["Subject"].ToString();
            }
            return(emailTemplateModel);
        }
Beispiel #15
0
        public string SetNewPassword(string code, string password)
        {
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@code", code),
                new KeyValuePair <string, object>("@newPassword", EncryptManager.GetHashString(password ?? string.Empty))
            };
            var result = DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Usp_SetNewPassword, param);

            if (result != null && result.Rows.Count > 0)
            {
                if (result.Columns.Count > 1)
                {
                    NewPasswordMail(new List <string>()
                    {
                        result.Rows[0]["EmailId"].ToString()
                    }, result.Rows[0]["Name"].ToString(), result.Rows[0]["AppName"].ToString());
                }
                return(result.Rows[0]["Msg"].ToString());
            }
            return(UtilityConstant.UserResponseStatus.Error);
        }
Beispiel #16
0
 public LoginTokenDataModel CheckUserCredentials(CredentialModel credentialModel)
 {
     try
     {
         LoginTokenDataModel loginTokenDataModel = new LoginTokenDataModel();
         if (credentialModel != null)
         {
             List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
             {
                 new KeyValuePair <string, object>("@username", credentialModel.UserName),
                 new KeyValuePair <string, object>("@isExternal", credentialModel.isExternal),
                 new KeyValuePair <string, object>("@password", EncryptManager.GetHashString(credentialModel.Password ?? string.Empty))
             };
             var data = DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Usp_CheckUserCredential, param);
             if (data != null && data.Columns.Count > 1)
             {
                 LoginTokenModel loginTokenModel = new LoginTokenModel()
                 {
                     ExpireTime = DateTime.Now.AddMinutes(30),
                     Message    = string.Empty,
                     SecureId   = Guid.NewGuid().ToString(),
                     UserData   = data
                 };
                 loginTokenDataModel.UserData = data;
                 loginTokenDataModel.Message  = "ValidUser";
                 loginTokenDataModel.Token    = EncryptManager.Encrypt(JsonConvert.SerializeObject(loginTokenModel), AppSetting.GetAppSettingsData(UtilityConstant.AppConfigConstant.AppVariable, UtilityConstant.AppConfigConstant.SaltKey, string.Empty));
             }
             else
             {
                 loginTokenDataModel.Message = data.Rows[0][0].ToString();
             }
         }
         return(loginTokenDataModel);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
        public EmailServiceDetails()
        {
            int _conTimeOut = 300;

            DataExecutor.ConnectionString  = Utilities.AppSetting.GetConnectionString(string.Empty, ref _conTimeOut);
            DataExecutor.ConnectionTimeout = _conTimeOut;
            var emailConfig = DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetEmailConfig);

            if (emailConfig != null && emailConfig.Rows.Count > 0)
            {
                EmailConfiguration     emailConfiguration = new EmailConfiguration();
                List <EmailConfigList> emailConfigList    = emailConfig.ToList <EmailConfigList>();
                var smtpList = emailConfigList.Where(x => x.ConfigName.ToLowerInvariant().Contains("smtp") && x.DefaultConfig).FirstOrDefault();
                var popList  = emailConfigList.Where(x => x.ConfigName.ToLowerInvariant().Contains("pop") && x.DefaultConfig).FirstOrDefault();
                if (smtpList != null)
                {
                    emailConfiguration.SmtpPassword = smtpList.Password;
                    emailConfiguration.SmtpPort     = smtpList.Port;
                    emailConfiguration.SmtpServer   = smtpList.ServerName;
                    emailConfiguration.SmtpUsername = smtpList.Username;
                }

                if (popList != null)
                {
                    emailConfiguration.PopPassword = popList.Password;
                    emailConfiguration.PopPort     = popList.Port;
                    emailConfiguration.PopServer   = popList.ServerName;
                    emailConfiguration.PopUsername = popList.Username;
                }

                emailService = new EmailService(emailConfiguration);
            }
            else
            {
                throw new Exception("Invalid Email configuration");
            }
        }
Beispiel #18
0
        public string PasswordResetCode(string username, string appName, string appUrl)
        {
            string code = EncryptManager.GetHashString($"{username}-{DateTime.Now.ToShortDateString()}");
            string link = $"{appUrl}common/signin/newpassword?txn={code}";
            List <KeyValuePair <string, object> > param = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("@username", username),
                new KeyValuePair <string, object>("@code", code)
            };
            var result = DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Usp_AddResetCode, param);

            if (result != null && result.Rows.Count > 0)
            {
                if (result.Columns.Count > 1)
                {
                    PasswordResetLinkMail(new List <string>()
                    {
                        result.Rows[0]["EmailId"].ToString()
                    }, result.Rows[0]["Name"].ToString(), link, result.Rows[0]["ResetCodeExpire"].ToString(), appName);
                }
                return(result.Rows[0]["Msg"].ToString());
            }
            return(UtilityConstant.UserResponseStatus.Error);
        }
 public DataTable GetDashboardCount()
 {
     return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetDashboardCount));
 }
Beispiel #20
0
 public List <FeedbackModel> GetFeedback()
 {
     return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetFeedback).ToList <FeedbackModel>());
 }
Beispiel #21
0
 public ContactDetailModel GetContactDetails()
 {
     return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetContactDetails).ToList <ContactDetailModel>().FirstOrDefault());
 }
Beispiel #22
0
 public List <ZodiacModel> GetZodiacList()
 {
     return(DataExecutor.ExecuteDataTable(Utilities.UtilityConstant.Procedures.Mst_GetZodiac).ToList <ZodiacModel>());
 }
Beispiel #23
0
 public DataTable GetAppSetting()
 {
     return(DataExecutor.ExecuteDataTable(UtilityConstant.Procedures.Mst_GetAppSetting));
 }