Exemplo n.º 1
0
        public static MailCommand GetMailCommand(MailCommandDataSet mailCommandDataSet, string command)
        {
            MailCommand result = new MailCommand();

            DataRow[] dr = mailCommandDataSet.Tables[0].Select("Command='" + command + "'");

            if (dr.Length == 0)
            {
                throw new Exception("No command found for " + command);
            }

            if (dr.Length > 1)
            {
                throw new Exception("Too many command found for " + command);
            }


            result.Command        = dr[0]["Command"].ToString();
            result.Connection     = dr[0]["Connection"].ToString();
            result.Description    = dr[0]["Description"].ToString();
            result.SqlCommandText = dr[0]["SqlCommandText"].ToString();
            result.CommandType    = CommandType.MailCommand;

            return(result);
        }
Exemplo n.º 2
0
        public static MailCommandDataSet GetMailCommandDataSet()
        {
            MailCommandDataSet result   = new MailCommandDataSet();
            string             filePath = Helper.GetMailCommandListFileName();

            result.ReadXml(filePath);

            return(result);
        }