示例#1
0
 public int Save(MobalegEntity data)
 {
     try
     {
         return(Connection.Db.Query <int>("spMobalegSet",
                                          new
         {
             ID = data.Id,
             FirstName = data.FirstName,
             LastName = data.LastName,
             ComName = data.ComName,
             CodeMeli = data.CodeMeli,
             Tel = data.Tel,
             Email = data.Email,
             City = data.City,
             DateStart = data.DateStart,
             DateEnd = data.DateEnd,
             Description = data.Description,
             Send = data.Send,
             Checked = data.Checked,
             InaertDate = data.InaertDate,
         }, commandType: CommandType.StoredProcedure).SingleOrDefault());
     }
     catch (Exception ex)
     {
         Tools.SaveLog.Save(ex);
         return(-1);
     }
 }
示例#2
0
 public List <MobalegEntity> Search(MobalegEntity data)
 {
     try
     {
         return(Connection.Db.Query <MobalegEntity>("spMobalegSearch",
                                                    new
         {
             ID = data.Id,
             FirstName = "%" + data.FirstName + "%",
             LastName = "%" + data.LastName + "%",
             ComName = "%" + data.ComName + "%",
             CodeMeli = "%" + data.CodeMeli + "%",
             Tel = "%" + data.Tel + "%",
             Email = "%" + data.Email + "%",
             City = "%" + data.City + "%",
             DateStart = "%" + data.DateStart + "%",
             DateEnd = "%" + data.DateEnd + "%",
             Description = "%" + data.Description + "%",
             Send = data.Send,
             Checked = data.Checked,
             InaertDate = "%" + data.InaertDate + "%",
         }, commandType: CommandType.StoredProcedure).ToList());
     }
     catch (Exception ex)
     {
         Tools.SaveLog.Save(ex);
         return(new List <MobalegEntity>());
     }
 }