Exemplo n.º 1
0
 public static void InsertMailFormat(MailFormat mailFormat)
 {
     mailFormat.MailFormatID = SQLDataAccess.ExecuteScalar <int>("INSERT INTO [Settings].[MailFormat] (FormatName, FormatText, FormatType, SortOrder, Enable, AddDate, ModifyDate ) VALUES (@FormatName, @FormatText, @FormatType, @SortOrder, @Enable, GETDATE(), GETDATE()); SELECT SCOPE_IDENTITY()",
                                                                 CommandType.Text,
                                                                 new SqlParameter("@FormatName", mailFormat.FormatName),
                                                                 new SqlParameter("@FormatText", mailFormat.FormatText),
                                                                 new SqlParameter("@FormatType", (int)mailFormat.FormatType),
                                                                 new SqlParameter("@SortOrder", mailFormat.SortOrder),
                                                                 new SqlParameter("@Enable", mailFormat.Enable));
 }
Exemplo n.º 2
0
 public static void UpdateMailFormat(MailFormat mailFormat)
 {
     SQLDataAccess.ExecuteNonQuery("UPDATE [Settings].[MailFormat] SET FormatName = @FormatName, FormatText = @FormatText, FormatType = @FormatType, SortOrder = @SortOrder, Enable = @Enable, ModifyDate = GETDATE() WHERE (MailFormatID = @MailFormatID)",
                                   CommandType.Text,
                                   new SqlParameter("@MailFormatID", mailFormat.MailFormatID),
                                   new SqlParameter("@FormatName", mailFormat.FormatName),
                                   new SqlParameter("@FormatText", mailFormat.FormatText),
                                   new SqlParameter("@FormatType", (int)mailFormat.FormatType),
                                   new SqlParameter("@SortOrder", mailFormat.SortOrder),
                                   new SqlParameter("@Enable", mailFormat.Enable),
                                   new SqlParameter("@ModifyDate", DateTime.Now)
                                   );
 }
Exemplo n.º 3
0
 public static void UpdateMailFormat(MailFormat mailFormat)
 {
     SQLDataAccess.ExecuteNonQuery("UPDATE [Settings].[MailFormat] SET FormatName = @FormatName, FormatText = @FormatText, FormatType = @FormatType, SortOrder = @SortOrder, Enable = @Enable, ModifyDate = GETDATE() WHERE (MailFormatID = @MailFormatID)",
                                     CommandType.Text,
                                     new SqlParameter("@MailFormatID", mailFormat.MailFormatID),
                                     new SqlParameter("@FormatName", mailFormat.FormatName),
                                     new SqlParameter("@FormatText", mailFormat.FormatText),
                                     new SqlParameter("@FormatType", (int)mailFormat.FormatType),
                                     new SqlParameter("@SortOrder", mailFormat.SortOrder),
                                     new SqlParameter("@Enable", mailFormat.Enable),
                                     new SqlParameter("@ModifyDate", DateTime.Now)
                                     );
 }
Exemplo n.º 4
0
 public static void InsertMailFormat(MailFormat mailFormat)
 {
     mailFormat.MailFormatID = SQLDataAccess.ExecuteScalar<int>("INSERT INTO [Settings].[MailFormat] (FormatName, FormatText, FormatType, SortOrder, Enable, AddDate, ModifyDate ) VALUES (@FormatName, @FormatText, @FormatType, @SortOrder, @Enable, GETDATE(), GETDATE()); SELECT SCOPE_IDENTITY()",
                                                                 CommandType.Text,
                                                                 new SqlParameter("@FormatName", mailFormat.FormatName),
                                                                 new SqlParameter("@FormatText", mailFormat.FormatText),
                                                                 new SqlParameter("@FormatType", (int)mailFormat.FormatType),
                                                                 new SqlParameter("@SortOrder", mailFormat.SortOrder),
                                                                 new SqlParameter("@Enable", mailFormat.Enable));
 }