示例#1
0
        public static List <AccountDialInTemplateModel> CheckAccountDialInTemplates(CygnusAutomationModel loadConfig, string accountTemplateName)
        {
            List <AccountDialInTemplateModel> tagList = new List <AccountDialInTemplateModel>();

            SqlConnection cnn = new SqlConnection(loadConfig.DnrDbConnectionString);

            cnn.Open();

            String sql = Queries.GetAccountDialInTemplates(accountTemplateName);

            SqlCommand    cmd      = new SqlCommand(sql, cnn);
            SqlDataReader dtReader = cmd.ExecuteReader();

            while (dtReader.Read())
            {
                AccountDialInTemplateModel tm = new AccountDialInTemplateModel();

                tm.UfkTag           = dtReader.GetValue(0).ToString();
                tm.GroupDisplayName = dtReader.GetValue(1).ToString();
                tm.DiscUrn          = dtReader.GetValue(2).ToString();
                tm.Type             = dtReader.GetValue(3).ToString();
                tm.UfkUser          = dtReader.GetValue(4).ToString();
                tagList.Add(tm);
            }
            cnn.Close();

            return(tagList);
        }
示例#2
0
        public static List <AccountDialInTemplateModel> GetExistingEmailAddress(CygnusAutomationModel loadConfig)
        {
            List <AccountDialInTemplateModel> email = new List <AccountDialInTemplateModel>();

            SqlConnection cnn = new SqlConnection(loadConfig.DbConnectionString);

            cnn.Open();

            String sql = Queries.GetExistingEmailAndUfkUser(loadConfig.AccountName);

            SqlCommand    cmd      = new SqlCommand(sql, cnn);
            SqlDataReader dtReader = cmd.ExecuteReader();

            while (dtReader.Read())
            {
                AccountDialInTemplateModel tm = new AccountDialInTemplateModel();

                tm.EmailAddress = dtReader.GetValue(0).ToString();
                tm.UfkUser      = dtReader.GetValue(1).ToString();
                email.Add(tm);
            }
            cnn.Close();

            return(email);
        }