Exemplo n.º 1
0
        public ActionResult DeleteSensor(FormCollection fc)
        {
            string[] ids = fc["tid"].Split(',');

            var result = SensorBLL.DeleteSensor(ids);

            base.DoLog(OperationTypeEnum.Delete, result, fc["tid"]);
            return(Json(result));
        }
Exemplo n.º 2
0
        public ActionResult GetSensorInfo(SensorSearchModel model, int searchPage)
        {
            SearchDataWithPagedDatas <SensorSearchModel, SensorListModels> result =
                new SearchDataWithPagedDatas <SensorSearchModel, SensorListModels>();

            result.SearchModel = model;
            result.PagedDatas  = SensorBLL.GetPagedSensor(model, searchPage, this.PageSize);
            return(PartialView("_SensorPagedGrid", result));
        }
Exemplo n.º 3
0
        // #region   查询
        // public ActionResult SeachSensorType()
        // {
        //     SearchDataWithPagedDatas<SensorSearchModel, SensorListModels> model =
        //         new SearchDataWithPagedDatas<SensorSearchModel, SensorListModels>();

        //     model.SearchModel = new SensorSearchModel();
        //     model.PagedDatas = SensorBLL.GetPagedSensor(model.SearchModel, 1, this.PageSize);
        //     return PartialView("_SeachSensorType", model);
        // }

        // [AsiatekSubordinateFunction("SeachSensorType")]
        // public ActionResult GetSensorInfo(SensorSearchModel model, int searchPage)
        // {
        //     SearchDataWithPagedDatas<SensorSearchModel, SensorListModels> result =
        //new SearchDataWithPagedDatas<SensorSearchModel, SensorListModels>();
        //     result.SearchModel = model;
        //     result.PagedDatas = SensorBLL.GetPagedSensor(model, searchPage, this.PageSize);
        //     return PartialView("_SensorPagedGrid", result);
        // }
        // #endregion

        // #region   新增
        // [AsiatekSubordinateFunction("SeachSensorType")]
        // public ActionResult AddSensorTypes()
        // {
        //     return PartialView("_AddSensorType");
        // }

        // [HttpPost, ValidateAntiForgeryToken]
        // [AsiatekSubordinateFunction("SeachSensorType")]
        // public ActionResult AddSensorTypes(SensorAddModel model)
        // {
        //     if (ModelState.IsValid)
        //     {
        //         var result = SensorBLL.AddSensorType(model,base.UserIDForLog);
        //         base.DoLog(OperationTypeEnum.Add, result, "SensorCode:" + model.SensorCode);
        //         return Json(result);
        //     }
        //     else
        //     {
        //         return PartialView("_AddSensorType", model);
        //     }
        // }

        // [HttpPost, AsiatekSubordinateFunction("SeachSensorType")]
        // public ActionResult CheckAddTypeNameExists(string SensorName)
        // {
        //     return Json(!SensorBLL.CheckTypeNameExists(SensorName));
        // }

        // [HttpPost, AsiatekSubordinateFunction("SeachSensorType")]
        // public ActionResult CheckAddSensorCodeExists(string sensorCode)
        // {
        //     return Json(!SensorBLL.CheckAddSensorCodeExists(sensorCode));
        // }
        // #endregion

        // #region   编辑
        //  [AsiatekSubordinateFunction("SeachSensorType")]
        // public ActionResult EditSensorTypes(int id)
        // {
        //     var result = SensorBLL.GetSensorTypeID(id);
        //     if (result.DataResult == null)
        //     {
        //         return Content(result.Message);
        //     }
        //     var model = result.DataResult;
        //     return PartialView("_EditSensorType", model);
        // }

        // [HttpPost, ValidateAntiForgeryToken]
        // [AsiatekSubordinateFunction("SeachSensorType")]
        // public ActionResult EditSensorTypes(SensorEditModel model)
        // {
        //     if (ModelState.IsValid)
        //     {
        //         var result = SensorBLL.EditSensorType(model,base.UserIDForLog);
        //         base.DoLog(OperationTypeEnum.Edit, result, "TypeID:" + model.TypeID);
        //         return Json(result);
        //     }
        //     else
        //     {
        //         return PartialView("_EditSensorType", model);
        //     }
        // }

        // [HttpPost, AsiatekSubordinateFunction("SeachSensorType")]
        // public ActionResult CheckEditTypeNameExists(string SensorName)
        // {
        //     return Json(!SensorBLL.CheckTypeNameExists(SensorName));
        // }
        // #endregion

        // #region   删除
        // [HttpPost, ValidateAntiForgeryToken]
        // [AsiatekSubordinateFunction("SeachSensorType")]
        // public ActionResult DeleteSensor(FormCollection fc)
        // {
        //     string[] ids = fc["tid"].Split(',');

        //     var result = SensorBLL.DeleteSensor(ids);

        //     base.DoLog(OperationTypeEnum.Delete, result, fc["tid"]);
        //     return Json(result);
        // }
        // #endregion



        #region   查询
        public ActionResult SeachSensorType()
        {
            SearchDataWithPagedDatas <SensorSearchModel, SensorListModels> model =
                new SearchDataWithPagedDatas <SensorSearchModel, SensorListModels>();

            model.SearchModel = new SensorSearchModel();
            model.PagedDatas  = SensorBLL.GetPagedSensor(model.SearchModel, 1, this.PageSize);
            return(PartialView("_SeachSensorType", model));
        }
Exemplo n.º 4
0
        public ActionResult EditSensorTypes(int id)
        {
            var result = SensorBLL.GetSensorTypeID(id);

            if (result.DataResult == null)
            {
                return(Content(result.Message));
            }
            var model = result.DataResult;

            return(PartialView("_EditSensorType", model));
        }
Exemplo n.º 5
0
 public ActionResult EditSensorTypes(SensorEditModel model)
 {
     if (ModelState.IsValid)
     {
         var result = SensorBLL.EditSensorType(model, base.UserIDForLog);
         base.DoLog(OperationTypeEnum.Edit, result, "SensorName:" + model.SensorName);
         return(Json(result));
     }
     else
     {
         return(PartialView("_EditSensorType", model));
     }
 }
Exemplo n.º 6
0
 public ActionResult AddSensorTypes(SensorAddModel model)
 {
     if (ModelState.IsValid)
     {
         var result = SensorBLL.AddSensorType(model, base.UserIDForLog);
         base.DoLog(OperationTypeEnum.Add, result, "SensorCode:" + model.SensorCode);
         return(Json(result));
     }
     else
     {
         return(PartialView("_AddSensorType", model));
     }
 }
Exemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            Series ser = chart1.Series[0];

            ser.Points.Clear();
            ser.ChartType   = SeriesChartType.Line;
            ser.BorderWidth = 2;
            ser.Color       = Color.Red;
            ser.LegendText  = "层";
            ser.XValueType  = ChartValueType.Date;

            List <SensorInfo> data = new List <SensorInfo>(SensorBLL.GetDataByDatetime(dateTimePicker1.Value, dateTimePicker2.Value));


            foreach (SensorInfo a in data)
            {
                ser.Points.AddXY(Convert.ToDateTime(a.Time), a.Data);
            }
        }
Exemplo n.º 8
0
        private void Movimento()
        {
            GravidadeBLL.Gravidade2D(personagemDTO);
            var distanciaDireita = SensorBLL.Detectar(SensorDireito, "player");

            if (distanciaDireita != null)
            {
                if (TimerDireita.IsStopped())
                {
                    TimerDireita.Start();
                }
                if (distanciaDireita < 30)
                {
                    personagemDTO.Direcao = new Vector2(-1, 0);
                    MovimentoKinematicoBLL.Move2D(personagemDTO);
                    return;
                }
            }

            var distanciaEsquerda = SensorBLL.Detectar(SensorEsquerdo, "player");

            if (distanciaEsquerda != null)
            {
                if (TimerEsquerda.IsStopped())
                {
                    TimerEsquerda.Start();
                }
                if (distanciaEsquerda < 30)
                {
                    personagemDTO.Direcao = new Vector2(1, 0);
                    MovimentoKinematicoBLL.Move2D(personagemDTO);
                    return;
                }
            }
            personagemDTO.Direcao = new Vector2(0, 0);
        }
Exemplo n.º 9
0
 public ActionResult CheckEditTypeNameExists(string SensorName)
 {
     return(Json(!SensorBLL.CheckTypeNameExists(SensorName)));
 }
Exemplo n.º 10
0
 public ActionResult CheckAddSensorCodeExists(string sensorCode)
 {
     return(Json(!SensorBLL.CheckAddSensorCodeExists(sensorCode)));
 }