Esempio n. 1
0
 private void Edit_DeviceClass(object sender, RoutedEventArgs e)
 {
     EditDeviceClass editDeviceClass =new EditDeviceClass();
     // MessageBox.Show(add_Equ.Children.Contains(equipmentDetails).ToString());
     RoomClass rc = new RoomClass();
     var a = this.deviceData.SelectedItem;
     var b = a as DataRowView;
     int typeId = Convert.ToInt32(b.Row[0]);
     MySqlDataReader reader = rc.getTypeInfor(typeId);
     
     if (reader.Read())
     {
         editDeviceClass.typeName.Text = reader["TYPE_NAME"].ToString();
         editDeviceClass.createUser.Content = reader["CREATE_USER"];
         editDeviceClass.createTime.Content = Convert.ToDateTime(reader["CREATE_TIME"]).ToString(BaseRequest.DATE_MS_FORMAT);
         editDeviceClass.id.Content = reader["ID"];
     }
     editDeviceClass.Owner = Window.GetWindow(this);
     editDeviceClass.ShowDialog();
 }
Esempio n. 2
0
        private void Edit_DeviceClass(object sender, RoutedEventArgs e)
        {
            EditDeviceClass editDeviceClass = new EditDeviceClass();
            // MessageBox.Show(add_Equ.Children.Contains(equipmentDetails).ToString());
            RoomClass       rc     = new RoomClass();
            var             a      = this.deviceData.SelectedItem;
            var             b      = a as DataRowView;
            int             typeId = Convert.ToInt32(b.Row[0]);
            MySqlDataReader reader = rc.getTypeInfor(typeId);

            if (reader.Read())
            {
                editDeviceClass.typeName.Text      = reader["TYPE_NAME"].ToString();
                editDeviceClass.createUser.Content = reader["CREATE_USER"];
                editDeviceClass.createTime.Content = Convert.ToDateTime(reader["CREATE_TIME"]).ToString(BaseRequest.DATE_MS_FORMAT);
                editDeviceClass.id.Content         = reader["ID"];
            }
            editDeviceClass.Owner = Window.GetWindow(this);
            editDeviceClass.ShowDialog();
        }