TG.WXCRM.V4/BLL/Sms/SMS_FROMEMAIL_BL.cs

26 lines
773 B
C#

using System.Linq;
using WX.CRM.BLL.Base;
using WX.CRM.IBLL.Sms;
using WX.CRM.Model.Entity;
namespace WX.CRM.BLL.Sms
{
public class SMS_FROMEMAIL_BL : ISMS_FROMEMAIL
{
public void Insert(SMS_FROMEMAIL model)
{
using (var db = new WX.CRM.Model.Entity.crmContext())
{
var o = db.SMS_FROMEMAIL.FirstOrDefault(p => p.TRADECODE == model.TRADECODE);
if (o != null)
return;
if (string.IsNullOrEmpty(model.TRADECODE) || string.IsNullOrEmpty(model.TRADEPWD))
return;
model.PKID = new SEQUENCES_BL().Seq_base_get();
db.SMS_FROMEMAIL.Add(model);
db.SaveChanges();
}
}
}
}