Exemplo n.º 1
0
 /// <summary>
 /// 添加违停
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int AddWtajs(case_wtajs model)
 {
     using (Entities db = new Entities())
     {
         db.case_wtajs.Add(model);
         db.SaveChanges();
         return(model.wtid);
     }
 }
Exemplo n.º 2
0
 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());
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 添加违停
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int AddWtajs(case_wtajs model)
 {
     return(dal.AddWtajs(model));
 }
Exemplo n.º 4
0
        public string AddWTByCamera(dynamic obj)
        {
            try
            {
                string szCameraId = Convert.ToString(obj.szCameraId);
                string szCarNum   = Convert.ToString(obj.szCarNum);
                if (!string.IsNullOrEmpty(szCameraId))
                {
                    fi_cameras camera = cameraBll.GetCameraDetails(szCameraId);
                    if (camera != null)
                    {
                        case_wtajs wt = new case_wtajs();
                        wt.car_num       = szCarNum;
                        wt.wt_address    = camera.cameraname;
                        wt.x84           = camera.x84 == null ? 0 : camera.x84.Value;
                        wt.y84           = camera.y84 == null ? 0 : camera.y84.Value;
                        wt.wt_time       = DateTime.Now;
                        wt.car_type      = "1";
                        wt.processstatus = "0";
                        wt.wfxw          = "不按规定停放机动车,影响其他车辆和行人通行的";
                        wt.cjdw          = "秀洲区综合行政执法局";
                        wt.isphone       = 0;
                        wt.reporttime    = DateTime.Now;
                        int wtid = bll.AddWtajs(wt);//插入违停案件

                        // List<FileClass> List_FC = new List<FileClass>();
                        string OriginPath = ConfigManageClass.WTCarOriginalPath;
                        string smallPath  = ConfigManageClass.WTCarFilesPath;
                        if (obj.photo1 != null)
                        {
                            byte[]    myByte = Convert.FromBase64String(Convert.ToString(obj.photo1));
                            FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                            // List_FC.Add(FC);
                            AddWTFiles(wtid, FC);
                        }
                        if (obj.photo2 != null)
                        {
                            byte[]    myByte = Convert.FromBase64String(Convert.ToString(obj.photo2));
                            FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                            // List_FC.Add(FC);
                            AddWTFiles(wtid, FC);
                        }
                        if (obj.photo3 != null)
                        {
                            byte[]    myByte = Convert.FromBase64String(Convert.ToString(obj.photo3));
                            FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                            // List_FC.Add(FC);
                            AddWTFiles(wtid, FC);
                        }
                        if (obj.photo4 != null)
                        {
                            byte[]    myByte = Convert.FromBase64String(Convert.ToString(obj.photo4));
                            FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                            // List_FC.Add(FC);
                            AddWTFiles(wtid, FC);
                        }
                        if (obj.photo5 != null)
                        {
                            byte[]    myByte = Convert.FromBase64String(Convert.ToString(obj.photo5));
                            FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                            //  List_FC.Add(FC);
                            AddWTFiles(wtid, FC);
                        }
                        if (obj.photo6 != null)
                        {
                            byte[]    myByte = Convert.FromBase64String(Convert.ToString(obj.photo6));
                            FileClass FC     = FileFactory.FileUpload(myByte, ".jpg", OriginPath, smallPath, 100, 100);
                            // List_FC.Add(FC);
                            AddWTFiles(wtid, FC);
                        }
                    }
                }
                return("1");
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }
Exemplo n.º 5
0
        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
                });
            }
        }