Пример #1
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <returns></returns>
 public int Update(HRWorkLog vo)
 {
     return(conn.Execute(@"update HR_WORK_LOG SET EMP_ID=@EmpId,LOG_DATE=@LogDate,Content=@Content WHERE id = @Id",
                         new
     {
         Id = vo.Id,
         EmpId = vo.EmpId,
         LogDate = vo.LogDate,
         Content = vo.Content
     }));
 }
Пример #2
0
        // 新增
        public int Add(HRWorkLog vo)
        {
            var ret = conn.Execute(@"insert HR_WORK_LOG(ID,EMP_ID,LOG_DATE,CONTENT) values (@Id,@EmpId,@LogDate,@Content)",
                                   new[] { new { Id      = vo.Id,
                                                 EmpId   = vo.EmpId,
                                                 LogDate = vo.LogDate,
                                                 Content = vo.Content } });

            Console.WriteLine(string.Format("插入数据库成功{0}", ret));
            return(ret);
        }