예제 #1
0
        public List <RepairView> ShowRepairsNotFinishForDS(string nameProcedure)
        {
            List <RepairView> repairsView = new List <RepairView>();

            com             = new SqlCommand(nameProcedure, con);
            com.CommandType = CommandType.StoredProcedure;
            con.Open();
            SqlDataReader r = com.ExecuteReader();

            while (r.Read())
            {
                RepairView repairView = new RepairView();

                repairView.IdRepair   = r.GetInt32(0);
                repairView.Date       = r.GetDateTime(1);
                repairView.NameClient = r.GetString(2);
                repairView.Contact    = r.GetString(3);
                repairView.Phone      = r.GetString(4);
                repairView.Device     = r.GetString(5);
                repairView.SN         = r.GetString(6);
                repairView.TypeRepair = r.GetString(7);
                repairView.Defect     = r.GetString(8);
                repairView.KitView    = r.GetString(9);
                repairView.Engineer   = r.GetString(10);
                repairView.Result     = r.GetString(11);
                repairView.Price      = r.GetInt32(12);
                repairView.Status     = r.GetString(13);

                repairsView.Add(repairView);
            }
            con.Close();
            return(repairsView);
        }
예제 #2
0
 private void dataGridView1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     try
     {
         RepairView rep = (RepairView)dataGridView1.SelectedItem;
         (new EditRepairWindow(rep.IdRepair)).ShowDialog();
     }
     catch
     {
         MessageBox.Show("Выберите ремонт");
     }
     loadWindowMain();
 }
예제 #3
0
 private void MenuItem_Click_9(object sender, RoutedEventArgs e)
 {
     try
     {
         RepairView rep = (RepairView)dataGridView1.SelectedItem;
         (new EditRepairWindow(rep.IdRepair)).ShowDialog();
     }
     catch
     {
         MessageBox.Show("Выберите ремонт");
     }
     loadWindowMain();
 }
예제 #4
0
        public List <RepairView> ShowRepairByNumber(int idRepair)
        {
            List <RepairView> repairsView = new List <RepairView>();

            com             = new SqlCommand("ShowRepairByNumber", con);
            com.CommandType = CommandType.StoredProcedure;
            SqlParameter param = com.Parameters.AddWithValue("@idRepair", idRepair);

            param.Direction = System.Data.ParameterDirection.Input;
            con.Open();
            SqlDataReader r = com.ExecuteReader();

            while (r.Read())
            {
                RepairView repairView = new RepairView();

                repairView.IdRepair   = r.GetInt32(0);
                repairView.Date       = r.GetDateTime(1);
                repairView.NameClient = r.GetString(2);
                repairView.Contact    = r.GetString(3);
                repairView.Phone      = r.GetString(4);
                repairView.Device     = r.GetString(5);
                repairView.SN         = r.GetString(6);
                repairView.TypeRepair = r.GetString(7);
                repairView.Defect     = r.GetString(8);
                repairView.KitView    = r.GetString(9);
                repairView.Engineer   = r.GetString(10);
                repairView.Result     = r.GetString(11);
                repairView.Price      = r.GetInt32(12);
                repairView.Status     = r.GetString(13);

                repairsView.Add(repairView);
            }
            con.Close();
            return(repairsView);
        }