using System; using System.Collections.Generic; using System.Linq; using System.Text; using EAS.Services; using SOH.Entities; using SOH.Data; namespace SOH.BLL { [ServiceObject("常见结果模块")] [ServiceBind(typeof(It_jgwh))] public class t_jgwhBll : It_jgwh { public List GetAlljgwh(int zdxh) { using (DbEntities db = new DbEntities()) { return db.t_jgwhs.Where(t => t.zdxh == zdxh).OrderBy(t => t.xssx).ToList(); } } public String GetAllJgwhStr(int zdxh) { using (DbEntities db = new DbEntities()) { var data = db.t_jgwhs.Where(t => t.zdxh == zdxh).OrderBy(t => t.xssx).Select(t => new { jcjg = t.jcjg }); return Newtonsoft.Json.JsonConvert.SerializeObject(data); } } public Data.OperationResult Update(Entities.t_jgwh jgwh) { OperationResult or = new OperationResult(); using (DbEntities db = new DbEntities()) { try { db.t_jgwhs.OrmAccessor.Update(jgwh); } catch (Exception ex) { or.Message = ex.ToString(); } } or.State = 1; or.Message = "更新成功"; or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(jgwh); return or; } public Data.OperationResult Insert(Entities.t_jgwh jgwh) { OperationResult or = new OperationResult(); using (DbEntities db = new DbEntities()) { db.t_jymss.OrmAccessor.Insert(jgwh); } or.State = 1; or.Message = "添加成功"; or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(jgwh); return or; } public OperationResult Del(t_jgwh jgwh) { OperationResult or = new OperationResult(); using (DbEntities db = new DbEntities()) { db.t_jymss.OrmAccessor.Delete(jgwh); } or.State = 1; or.Message = "删除成功"; or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(jgwh); return or; } } }