示例#1
0
 /// <summary>
 /// 增添数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public string Add(YuanXiModel model)
 {
     YuanXiData YuanXi = new YuanXiData();
     var query = YuanXi.DataList().Where(r => r.Code == model.Code);
     if (query.Count() > 0)
     {
         return JsonConvert.SerializeObject(new ResultEx(false, "院系代码已经存在"));
     }
     else
     {
         try
         {
             YuanXi.Add(model);
             return JsonConvert.SerializeObject(new ResultEx(true));
         }
         catch (Exception ex)
         {
             return JsonConvert.SerializeObject(new ResultEx(false, ex.Message));
         }
     }
 }
示例#2
0
 protected override void Add(object model)
 {
     base.Add(model);
     YuanXi = new YuanXiModel();
 }
示例#3
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int Update(YuanXiModel model)
 {
     YuanXiData YuanXi = new YuanXiData();
     return YuanXi.Update(model);
 }
示例#4
0
 /// <summary>
 /// 删除数据
 /// </summary>
 /// <param name="model"></param)>
 /// <returns></returns>
 public int Delete(List<int> ids, YuanXiModel model = null)
 {
     YuanXiData yuanxi = new YuanXiData();
     return yuanxi.Delete(ids);
 }