public static void AddCallbackCustomer(CallbackCustomer callbackCustomer) { SQLDataAccess.ExecuteNonQuery( "INSERT INTO [Module].[" + _moduleName + "] ([Name], [Phone], [DateAdded], [Comment], [AdminComment], [Processed]) VALUES (@Name, @Phone, GETDATE(), @Comment, @AdminComment, @Processed)", CommandType.Text, new SqlParameter("@Name", callbackCustomer.Name), new SqlParameter("@Phone", callbackCustomer.Phone), new SqlParameter("@Comment", callbackCustomer.Comment ?? ""), new SqlParameter("@AdminComment", callbackCustomer.AdminComment ?? ""), new SqlParameter("@Processed", callbackCustomer.Processed)); }
public static void UpdateCallbackCustomer(CallbackCustomer callbackCustomer) { SQLDataAccess.ExecuteNonQuery( "update [Module].[" + _moduleName + "] set [Name]=@Name, [Phone]=@Phone, [Comment]=@Comment, [AdminComment]=@AdminComment, [Processed]=@Processed where id=@id", CommandType.Text, new SqlParameter("@id", callbackCustomer.ID), new SqlParameter("@Name", callbackCustomer.Name), new SqlParameter("@Phone", callbackCustomer.Phone), new SqlParameter("@Comment", callbackCustomer.Comment ?? ""), new SqlParameter("@AdminComment", callbackCustomer.AdminComment ?? ""), new SqlParameter("@Processed", callbackCustomer.Processed)); }
public static void SendEmail(CallbackCustomer callbackCustomer) { string email = ModuleSettingsProvider.GetSettingValue <string>("email4notify", _moduleName); string subject = ModuleSettingsProvider.GetSettingValue <string>("emailSubject", _moduleName); string format = ModuleSettingsProvider.GetSettingValue <string>("emailFormat", _moduleName); format = format.Replace("#NAME#", callbackCustomer.Name) .Replace("#PHONE#", callbackCustomer.Phone) .Replace("#COMMENT#", callbackCustomer.Comment); Mails.SendMail.SendMailNow(email, subject, format, true); }