Beispiel #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));
 }
Beispiel #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)
                                   );
 }
 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)
                                     );
 }
 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));
 }