示例#1
0
        /// <summary>
        /// Add new door
        /// </summary>
        /// <remarks>
        /// Mode = A, send user login id and id of door what user choose
        /// </remarks>
        private void btnAddDoor_Click(object sender, EventArgs e)
        {
            ucDoorDetail uc = new ucDoorDetail("A", userId, "");
            Panel        p  = (this.Parent as Panel);

            p.Controls.Clear();
            p.Controls.Add(uc);
        }
示例#2
0
        /// <summary>
        /// Show door detail
        /// </summary>
        /// <remarks>
        /// Mode = E, send user login id and id of door what user choose
        /// </remarks>
        private void gridData_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                //Get doorId in grid
                DataRowView drv      = (DataRowView)gridView1.GetFocusedRow();
                DataRow     dr       = drv.Row;
                string      doorId   = dr[0].ToString();
                string      doorName = dr[1].ToString();

                //Show detail device
                ucDoorDetail uc = new ucDoorDetail("E", userId, doorId);
                Common.GoBack(uc, this);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }