Beispiel #1
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList   pkArray = null;
            VDCameraBLL bll     = null;

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

                pkArray = GvHelper.GetPKValueByChk(this.GvList, 0, "cbxSelect", 0);

                foreach (object key in pkArray)
                {
                    bll.Delete(new VDCamera {
                        ID = key.ToString()
                    });
                }

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        private void BindData()
        {
            VDCameraBLL bll       = null;
            DataPage    dp        = new DataPage();
            VDCamera    condition = new VDCamera();
            string      postionID = Request.QueryString["postionID"];

            try
            {
                bll = BLLFactory.CreateBLL <VDCameraBLL>();
                this.hiPostionID.Value = postionID;
                condition.PostionID    = postionID;
                condition.CameraCode   = this.CameraCode.Text;
                condition.CameraName   = this.CameraName.Text;

                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);

                List <VDCamera> list = dp.Result as List <VDCamera>;
                this.GvList.DataSource = list;
                this.GvList.DataBind();

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["ID"].ToString());

                    (this.GvList.Rows[i].Cells[5].Controls[0] as WebControl).Attributes.Add("onclick", click);
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #3
0
        protected void btSave_Click(object sender, EventArgs e)
        {
            VDCamera    info = new VDCamera();
            VDCameraBLL bll  = null;

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

                bll            = BLLFactory.CreateBLL <VDCameraBLL>();
                info.PostionID = this.PostionID.Value;
                if (this.hiID.Value == "")
                {
                    bll.Insert(info);
                }
                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.refreshData();parent.closeAppWindow1();", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #4
0
        private void BindData()
        {
            string      id        = Request.QueryString["id"];
            VDCameraBLL bll       = null;
            VDCamera    info      = new VDCamera();
            string      postionID = Request.QueryString["postionID"];

            try
            {
                bll = BLLFactory.CreateBLL <VDCameraBLL>();
                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.PostionID.Value    = info.PostionID;
                }
                else
                {
                    info = new VDCamera();
                    this.PostionID.Value = postionID;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsPostBack == false)
            {
                VDCamera    camera = null;
                VDCameraBLL cbll   = BLLFactory.CreateBLL <VDCameraBLL>();
                camera = cbll.Get(new VDCamera {
                    ID = Request.QueryString["id"]
                });

                this.hiCamera.Value = LAF.Common.Serialization.JsonConvertHelper.GetSerializes(camera);
            }
        }
Beispiel #6
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;
            }
        }