Esempio n. 1
0
        public ActionResult SetWatchResult(string officeId, string frequencyId, string pointId, string workDate, string watchTimes, string usedTime, string arriveLa, string arriveLo, string arriveTime, string startTime)
        {
            StatusReport sr = new StatusReport();

            if (string.IsNullOrEmpty(officeId) || string.IsNullOrEmpty(frequencyId) || string.IsNullOrEmpty(pointId) || string.IsNullOrEmpty(workDate) ||
                string.IsNullOrEmpty(watchTimes) || string.IsNullOrEmpty(usedTime) || string.IsNullOrEmpty(arriveLa) || string.IsNullOrEmpty(arriveLo) ||
                string.IsNullOrEmpty(arriveTime) || string.IsNullOrEmpty(arriveTime))
            {
                sr.status = "Fail";
                sr.result = "数据不完整";
                return(Json(sr));
            }
            sr = WatchResultDal.SetWatchResult(officeId, frequencyId, pointId, workDate, watchTimes, usedTime, arriveLa, arriveLo, arriveTime, startTime);
            return(Json(sr));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            WatchResult wr = new WatchResult()
            {
                OfficeId    = Convert.ToInt32(Request["officeId"]),    //管理处Id
                FrequencyId = Convert.ToInt32(Request["frequencyId"]), //班次Id
                PointId     = Convert.ToInt32(Request["pointId"]),     //巡更点Id
                WorkDate    = Request["workDate"],                     //工作日期
                watchTimes  = Convert.ToInt32(Request["watchTimes"]),  //当次序次
                usedTime    = Convert.ToInt32(Request["usedTime"]),    //已用时间
                arriveLa    = Convert.ToDouble(Request["arriveLa"]),   //扫码时经度
                arriveLo    = Convert.ToDouble(Request["arriveLo"]),   //扫码时纬度
                arriveTime  = Request["arriveTime"]                    //到达时间
            };
            StatusReport sr       = WatchResultDal.SetWatchResult(wr);
            string       srString = JsonConvert.SerializeObject(sr);

            Response.Write(srString);
        }
Esempio n. 3
0
        //public ActionResult GetWatchInfo(string officeId, string date)
        //{
        //    StatusReport sr = new StatusReport();
        //    if (string.IsNullOrEmpty(officeId) || string.IsNullOrEmpty(date))
        //    {
        //        sr.status = "Fail";
        //        sr.result = "数据不完整";
        //        return Json(sr);
        //    }
        //    sr = WatchResultDal.GetWatchInfo(officeId, date);
        //    return Json(sr);
        //}

        public ActionResult SetWatchImages()
        {
            StatusReport sr = new StatusReport();

            if (Request.Files.Count == 0)
            {
                sr.status = "Fail";
                sr.result = "没有图片";
                return(Json(sr));
            }
            string imagePath    = "D:\\WYYTNET\\wb iis\\wb iis\\wximages\\";
            string sqlImagePath = "\\wximages\\";

            imagePath    += Request.Files.AllKeys[0];
            sqlImagePath += Request.Files.AllKeys[0];
            HttpPostedFileBase uploadImage = Request.Files[0];

            uploadImage.SaveAs(imagePath);
            string id   = Request.Form["id"];
            string func = Request.Form["func"];

            sr = WatchResultDal.SetWatchImage(id, func, sqlImagePath);
            return(Json(sr));
        }