Exemplo n.º 1
0
        protected void btSave_Click(object sender, EventArgs e)
        {
            VDPosition    info = new VDPosition();
            VDPositionBLL bll  = null;

            try
            {
                UIBindHelper.BindModelByControls(this.Page, info);

                bll           = BLLFactory.CreateBLL <VDPositionBLL>();
                info.ParentID = this.HiParentID.Value;
                if (this.hiID.Value == "")
                {
                    bll.Insert(info);
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.addNode('" + info.ID + "','" + info.PositionName + "');parent.closeAppWindow1();", true);
                }
                else
                {
                    info.CREATEUSER = this.HiCREATEUSER.Value;
                    info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value);
                    info.ID         = this.hiID.Value;
                    bll.Update(info);
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.editNode('" + info.ID + "','" + info.PositionName + "');parent.closeAppWindow1();", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        private void BindData()
        {
            string        id   = Request.QueryString["id"];
            VDPositionBLL bll  = null;
            VDPosition    info = new VDPosition();

            try
            {
                bll = BLLFactory.CreateBLL <VDPositionBLL>();
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.ID = id;
                    info    = bll.Get(info);

                    UIBindHelper.BindForm(this.Page, info);
                    this.hiID.Value         = info.ID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                    this.HiParentID.Value   = info.ParentID;
                }
                else
                {
                    this.HiParentID.Value = Request.QueryString["parentID"];
                    info = new VDPosition();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentEncoding = Encoding.UTF8;
            context.Response.ContentType     = "application/json";

            string id      = context.Request.QueryString["id"];
            string matCode = context.Request.QueryString["MatCode"];

            VDPositionBLL bll = BLLFactory.CreateBLL <VDPositionBLL>();

            bll.Delete(new VDPosition {
                ID = id
            });

            context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes("ok"));
        }
Exemplo n.º 4
0
        private void BindData()
        {
            VDPositionBLL     bll        = null;
            VDCameraBLL       cbll       = null;
            VDPosition        condition  = new VDPosition();
            List <VDPosition> list       = null;
            List <VDCamera>   cameraList = null;

            try
            {
                //获取位置列表
                bll  = BLLFactory.CreateBLL <VDPositionBLL>();
                list = bll.GetList();

                //获取摄像头列表
                cbll       = BLLFactory.CreateBLL <VDCameraBLL>();
                cameraList = cbll.GetList();

                //绑定摄像头
                foreach (VDPosition postion in list)
                {
                    postion.CameraList = cameraList.Where(p => p.PostionID == postion.ID).ToList <VDCamera>();
                }

                //输出位置信息

                foreach (VDPosition position in list)
                {
                    this.PositionList.Text += "<div class=\"easyui-panel\" title=\"" + position.PositionName + "\" style=\"width:500px;padding:10px;\">";

                    foreach (VDCamera camera in position.CameraList)
                    {
                        this.PositionList.Text
                            += string.Format("<a href=\"#\" onclick=\"openRTMonitor('{0}','{1}')\">{1}<a>&nbsp;&nbsp;"
                                             , camera.ID, camera.CameraName);
                    }

                    this.PositionList.Text += "</div>";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
        private void BindData()
        {
            VDPositionBLL     bll       = null;
            VDPosition        condition = new VDPosition();
            List <VDPosition> list      = null;

            try
            {
                bll = BLLFactory.CreateBLL <VDPositionBLL>();

                list = bll.GetList();

                this.hiPostionList.Value = this.GetTreeNodes(list);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }