public object getChunaBianhao(string id) { using (var ent = new OAtoU8DATAEntities()) { var tes = (from r in ent.RecordTable where r.Pid.Contains(id) select r).ToList(); return(tes); } }
/// <summary> /// 获取用户信息,登录 /// </summary> /// <param name="user"></param> /// <returns></returns> public userInfo getUserInfo(UserModel user) { using (var db = new OAtoU8DATAEntities()) { try { return(db.userInfo.Where(o => o.name.Equals(user.userName) && o.password.Equals(user.password)).FirstOrDefault()); } catch (Exception) { return(null); } } }
public userInfo updateUserInfo(UserModel user) { using (var db = new OAtoU8DATAEntities()) { try { var oldUser = db.userInfo.Where(o => o.name.Equals(user.userName) && o.password.Equals(user.password)).FirstOrDefault(); oldUser.password = user.newpassword; db.SaveChanges(); return(oldUser); } catch (Exception) { return(null); } } }
/// <summary> /// 获取关联的预支单(用于预支单报销) /// </summary> /// <param name="model"></param> /// <returns></returns> public List <YuzhiAttachment> getSunByattachment(ResultListModel model) { using (var db = new v3xEntities()) { using (var myent = new OAtoU8DATAEntities()) { var col_id = Convert.ToInt64(model.colId); var colBody = (from c in db.col_body join a in db.v3x_affair on c.col_id equals a.object_id join t in db.v3x_attachment on a.id equals t.genesis_id where t.reference == col_id select c).ToList(); ResultListModel models = new ResultListModel(); models.type = "上海悦目-预支单";//预支单才能冲账 models.list = new List <Detail>(); var yuzhiAttachmentList = new List <YuzhiAttachment>(); foreach (var body in colBody) { var yuzhiAttachment = new YuzhiAttachment(); yuzhiAttachment.Id = body.content; yuzhiAttachment.detailList = new List <Detail>(); yuzhiAttachment.col_id = body.col_id; models.Id = body.content;//预支单才能冲账 models.colId = body.col_id.ToString(); var t = getDetail(models); if (t != null) { //model.list.Concat(t.list);//Union去重 foreach (var de in t.list) { yuzhiAttachment.detailList.Add(de); } } yuzhiAttachment.record = myent.RecordTable.Where(o => o.Pid.Contains(models.Id)).ToList(); yuzhiAttachmentList.Add(yuzhiAttachment); } return(yuzhiAttachmentList); } } }