/// <summary> /// 获取字典model类 /// </summary> /// <param name="bianhao"></param> /// <returns></returns> public static Model.TcZidian get_zidian(int id) { var m = new Model.TcZidian(); var list = new List <Model.TcZidian>(); if (HttpContext.Current.Cache[tc_zidian] == null) { list = BLL.TcZidian.Instance.GetModelList(""); HttpContext.Current.Cache.Insert(tc_zidian, list, null, DateTime.Now.AddDays(c_day), TimeSpan.Zero); } else { list = (List <Model.TcZidian>)HttpContext.Current.Cache[tc_zidian]; } if (list.Count(p => p.ID == id) > 0) { return(list.First(p => p.ID == id)); } else { return(m); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Tc.Model.TcZidian model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Tc.Model.TcZidian model) { return(dal.Add(model)); }