/// <summary> /// 详情列表 /// </summary> /// <param name="wtid"></param> /// <returns></returns> public Case_WtajsModel Getcase(int wtid) { Case_WtajsModel model = new Case_WtajsModel(); using (Entities db = new Entities()) { IQueryable <Case_WtajsModel> queryable = from a in db.case_wtajs join b_join in db.base_zds on a.car_type equals b_join.zd_id into bTmp from b in bTmp.DefaultIfEmpty() join c_join in db.base_users on a.shr equals c_join.id into cTmp from c in cTmp.DefaultIfEmpty() join d_join in db.base_users on a.cjr equals d_join.id into dTmp from d in dTmp.DefaultIfEmpty() where b.zd_type == "case_type_car" && a.wtid == wtid select new Case_WtajsModel { wtid = a.wtid, car_num = a.car_num, car_type = a.car_type, processstatus = a.processstatus, wt_time = a.wt_time, wt_address = a.wt_address, wfxw = a.wfxw, cfjdsh = a.cfjdsh, cjdw = a.cjdw, cjr = a.cjr, dsr = a.dsr, dsr_phone = a.dsr_phone, dsr_address = a.dsr_address, jdr = a.jdr, jdsj = a.jdsj, shr = a.shr, shsj = a.shsj, zfreason = a.zfreason, datastatus = a.datastatus, cldw = a.cldw, fkje = a.fkje, fphm = a.fphm, processuser = a.processuser, processtime = a.processtime, jsr = a.jsr, jssj = a.jssj, isphone = a.isphone, reportuserid = a.reportuserid, reporttime = a.reporttime, x84 = a.x84, y84 = a.y84, x2000 = a.x2000, y2000 = a.y2000, car_typename = b == null ? "" : b.zd_name, shrname = c == null ? "" : c.displayname, cjrname = d == null ? "" : d.displayname, }; model = queryable.FirstOrDefault(); model.casewtfilelist = GetWtfileModel(wtid); return(model); } }
public HttpResponseMessage AddCaseSources(Case_WtajsModel model) { int success = bll.ModifyWtajs(model); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); if (success > 0) { response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html"); } return(response); }
public int ModifyWtajs(Case_WtajsModel model) { using (Entities db = new Entities()) { case_wtajs cwmodel = db.case_wtajs.FirstOrDefault(a => a.wtid == model.wtid); if (cwmodel != null) { cwmodel.processstatus = model.processstatus; cwmodel.zfreason = model.zfreason; cwmodel.shr = model.shr; cwmodel.shsj = DateTime.Now; } return(db.SaveChanges()); } }
/// <summary> /// 审核 /// </summary> /// <param name="model"></param> /// <returns></returns> public int ModifyWtajs(Case_WtajsModel model) { return(dal.ModifyWtajs(model)); }
public object AddWtajs(Case_WtajsModel model) { try { case_wtajs cwmodel = new case_wtajs(); cwmodel.wtid = model.wtid; cwmodel.car_num = model.car_num; cwmodel.car_type = model.car_type; cwmodel.processstatus = model.processstatus; cwmodel.wt_time = model.wt_time; cwmodel.wt_address = model.wt_address; cwmodel.wfxw = model.wfxw; cwmodel.cfjdsh = model.cfjdsh; cwmodel.cjdw = model.cjdw; cwmodel.cjr = model.cjr; cwmodel.dsr = model.dsr; cwmodel.dsr_phone = model.dsr_phone; cwmodel.dsr_address = model.dsr_address; cwmodel.jdr = model.jdr; cwmodel.jdsj = model.jdsj; cwmodel.shr = model.shr; cwmodel.shsj = model.shsj; cwmodel.zfreason = model.zfreason; cwmodel.datastatus = model.datastatus; cwmodel.cldw = model.cldw; cwmodel.fkje = model.fkje; cwmodel.fphm = model.fphm; cwmodel.processuser = model.processuser; cwmodel.processtime = model.processtime; cwmodel.jsr = model.jsr; cwmodel.jssj = model.jssj; cwmodel.isphone = model.isphone; cwmodel.reportuserid = model.reportuserid; cwmodel.reporttime = DateTime.Now; cwmodel.x84 = model.x84; cwmodel.y84 = model.y84; cwmodel.unitid = model.unitid; //string geometry = model.x84 + "," + model.y84; //string map2000 = new MapXYConvent().WGS84ToCGCS2000(geometry); //if (!string.IsNullOrEmpty(map2000)) //{ // cwmodel.x2000 = double.Parse(map2000.Split(',')[0]); // cwmodel.y2000 = double.Parse(map2000.Split(',')[1]); //} int wtid = bll.AddWtajs(cwmodel); #region 图片处理 List <FileClass> List_FC = new List <FileClass>(); string OriginPath = ConfigManageClass.WTCarOriginalPath; string smallPath = ConfigManageClass.WTCarFilesPath; if (model.photo1 != null && model.photo1.Length != 0) { string[] spilt = model.photo1.Split(','); if (spilt.Length > 1) { byte[] myByte = Convert.FromBase64String(spilt[1]); FileClass FC = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100); List_FC.Add(FC); } } if (model.photo2 != null && model.photo2.Length != 0) { string[] spilt = model.photo2.Split(','); if (spilt.Length > 1) { byte[] myByte = Convert.FromBase64String(spilt[1]); FileClass FC = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100); List_FC.Add(FC); } } if (model.photo3 != null && model.photo3.Length != 0) { string[] spilt = model.photo3.Split(','); if (spilt.Length > 1) { byte[] myByte = Convert.FromBase64String(spilt[1]); FileClass FC = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100); List_FC.Add(FC); } } foreach (var item in List_FC) { case_wtfiles cfilemodel = new case_wtfiles(); cfilemodel.wtid = wtid; cfilemodel.filename = item.OriginalName; cfilemodel.filepath = item.OriginalPath; cfilemodel.filetype = item.OriginalType; cfilemodel.filesize = item.size; bll.AddWtFile(cfilemodel); } #endregion #region 添加日志 SystemLogBLL slbll = new SystemLogBLL(); slbll.WriteSystemLog("违停案件", "", (int)model.reportuserid); #endregion return(new { msg = "上报成功", resCode = 1 }); } catch (Exception) { return(new { msg = "json数据不正确", resCode = 0 }); } }