Пример #1
0
 /// <summary>
 /// 增添数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public string Add(BanJiModel model)
 {;
     BanJiData BanJi = new BanJiData();
     var query = BanJi.DataList().Where(r => r.Bjbh == model.Bjbh);
     if (query.Count() > 0)
     {
         return JsonConvert.SerializeObject(new ResultEx(false, "班级编号已经存在"));
     }
     else
     {
         try
         {
             BanJi.Add(model);
             return JsonConvert.SerializeObject(new ResultEx(true));
         }
         catch (Exception ex)
         {
             return JsonConvert.SerializeObject(new ResultEx(false,ex.Message));
         }
     }
 }
Пример #2
0
 public string BanJiSummary(string year)
 {
     BanJiData data = new BanJiData();
     List<BanJiSummaryModel> list = data.BanJiSummary(year);
     return JsonConvert.SerializeObject(list);
 }
Пример #3
0
 BanJiModel IBanJiServices.GetModelById(int id)
 {
     BanJiData BanJi = new BanJiData();
     return BanJi.GetModelById(id);
 }
Пример #4
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int Update(BanJiModel model)
 {
     BanJiData BanJi = new BanJiData();
     return BanJi.Update(model);
 }
Пример #5
0
 /// <summary>
 /// 删除数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int Delete(BanJiModel model)
 {
     BanJiData BanJi = new BanJiData();
     return BanJi.Delete(model.Id);
 }
Пример #6
0
 /// <summary>
 /// 删除数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int Delete(List<int> ids, BanJiModel model = null)
 {
     BanJiData BanJi = new BanJiData();
     return BanJi.Delete(ids);
 }
Пример #7
0
 /// <summary>
 /// 获取数据表数据列表
 /// </summary>
 string IBanJiServices.TableQuery()
 {
     BanJiData BanJi = new BanJiData();
     List<BanJiModel> list = BanJi.DataList();
     return JsonConvert.SerializeObject(list);
 }
Пример #8
0
 /// <summary>
 /// 获取数据列表
 /// </summary>
 string IBanJiServices.Query()
 {
     BanJiData BanJi = new BanJiData();
     DataTable list = BanJi.SelectQuery();
     return JsonConvert.SerializeObject(list);
 }