Пример #1
0
 /// <summary>
 /// Go to Device detail form
 /// </summary>
 /// <remarks>
 /// Send to device detail form: Mode = A, creator id
 /// </remarks>
 private void btnAddDevice_Click(object sender, EventArgs e)
 {
     try
     {
         ucDeviceDetail uc = new ucDeviceDetail("A", userId, "");
         Panel          p  = (this.Parent as Panel);
         p.Controls.Clear();
         p.Controls.Add(uc);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
         return;
     }
 }
Пример #2
0
        /// <summary>
        /// Go to Device detail form
        /// </summary>
        /// <remarks>
        /// Send to device detail form: Mode = E, creator id, device selected id
        /// </remarks>
        private void gridData_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                //Get deviceId in grid
                DataRowView drv        = (DataRowView)gridView1.GetFocusedRow();
                DataRow     dr         = drv.Row;
                string      deviceId   = dr[0].ToString();
                string      deviceName = dr[1].ToString();

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