Exemplo n.º 1
0
 /// <summary>
 /// 修改问卷分类
 /// </summary>
 /// <param name="model">问卷分类</param>
 public bool EditPaperSort(Survey_ExampaperCategory model)
 {
     using (var conn = OpenConnection())
     {
         const string sqlwhere =
             @"update Survey_ExampaperCategory set CategoryName=@CategoryName where CategoryId=@CategoryId";
         var param = new
         {
             model.CategoryName,
             model.CategoryId
         };
         var result = conn.Execute(sqlwhere, param);
         return(result > 0);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 增加问卷分类
 /// </summary>
 /// <param name="model">问卷分类实体</param>
 public bool AddPaperSort(Survey_ExampaperCategory model)
 {
     using (var conn = OpenConnection())
     {
         const string sqlwhere =
             @"insert into Survey_ExampaperCategory (CategoryName,ParentId,IsDelete) values (@CategoryName,@ParentId,@IsDelete) SELECT @@Identity as Id";
         var param = new
         {
             model.CategoryName,
             model.ParentId,
             model.IsDelete
         };
         var id = conn.Query <decimal>(sqlwhere, param).FirstOrDefault();
         model.CategoryId = decimal.ToInt32(id);
         return(model.CategoryId > 0);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 修改问卷分类
 /// </summary>
 /// <param name="model">问卷分类</param>
 public bool EditPaperSort(Survey_ExampaperCategory model)
 {
     return(Sdb.EditPaperSort(model));
 }