コード例 #1
0
        private void frmAgregarEditarTarea_Load(object sender, EventArgs e)
        {
            tarea = new Tarea();

            if(flagEditar)
            {
                tarea.IdTarea = idTarea;
                tarea.getDatos();

                this.txtDescripcion.Text = tarea.DescripcionTarea.ToUpper();
                this.txtCosto.Text = tarea.Costo.ToString();
                this.txtDuracion.Text = tarea.Duracion.ToString(@"hh\:mm");
            }
        }
コード例 #2
0
        private void llenarListBox()
        {
            ArrayList colTareas = new ArrayList();
            Tarea objTareaLocal = new Tarea();

            tarea.Filtro = textFiltro.Text;

            colTareas = tarea.coleccion();

            this.dataGridTarea.Rows.Clear();

            for (int i = 0; i < colTareas.Count; i++)
            {
                objTareaLocal = (Tarea)colTareas[i];

                if (colTareasDetalle.IndexOf(objTareaLocal.IdTarea) < 0)
                {
                    this.dataGridTarea.Rows.Add();
                    this.dataGridTarea.Rows[i].Cells["idtarea"].Value = objTareaLocal.IdTarea;
                    this.dataGridTarea.Rows[i].Cells["descripciontarea"].Value = objTareaLocal.DescripcionTarea;
                    this.dataGridTarea.Rows[i].Cells["costo"].Value = objTareaLocal.Costo;
                    this.dataGridTarea.Rows[i].Cells["duracion"].Value = objTareaLocal.Duracion.ToString(@"hh\:mm");

                    this.dataGridTarea.ClearSelection();
                }
                else
                {
                    colTareas.RemoveAt(i);
                    i--;
                }
            }

            if (this.dataGridTarea.Rows.Count == 0)
            {
                this.dataGridTarea.Rows.Add();
                this.dataGridTarea.Rows[0].Cells["descripciontarea"].Value = "No hay tareas disponibles.";
                this.dataGridTarea.Enabled = false;
            }
        }
コード例 #3
0
ファイル: Tarea.cs プロジェクト: gaboblanch/sistema_taller
        /// <summary>
        /// Consulta de todas las tareas disponibles
        /// </summary>
        public virtual ArrayList coleccion()
        {
            string SQL_p;
            MySqlDataReader Reader;
            ArrayList colTareas = new ArrayList();

            SQL_p = "SELECT * FROM tarea WHERE descripciontarea LIKE '%"+Filtro+"%' ORDER BY descripciontarea";

            Reader = Conector.consultar(SQL_p);

            while (Reader.Read())
            {
                Tarea objTareaLocal = new Tarea();

                objTareaLocal.IdTarea = Reader.GetInt32("idtarea");
                objTareaLocal.DescripcionTarea = Reader.GetString("descripciontarea");
                objTareaLocal.Costo = Reader.GetDouble("costo");
                objTareaLocal.Duracion = Reader.GetTimeSpan("duracion");

                colTareas.Add(objTareaLocal);
            }
            Reader.Close();
            return colTareas;
        }
コード例 #4
0
        private void llenarDataGrid()
        {
            this.buttonEditar.Enabled = false;
            this.buttonEliminar.Enabled = false;

            ArrayList colTarea = new ArrayList();
            colTarea = tarea.coleccion();

            this.dataGridTarea.Rows.Clear();

            for (int i = 0; i < colTarea.Count; i++)
            {
                Tarea objTareaLocal = new Tarea();

                objTareaLocal = (Tarea)colTarea[i];

                this.dataGridTarea.Rows.Add();
                this.dataGridTarea.Rows[i].Cells["idtarea"].Value = objTareaLocal.IdTarea;
                this.dataGridTarea.Rows[i].Cells["descripciontarea"].Value = objTareaLocal.DescripcionTarea;
                this.dataGridTarea.Rows[i].Cells["costo"].Value = objTareaLocal.Costo;
                this.dataGridTarea.Rows[i].Cells["duracion"].Value = objTareaLocal.Duracion.ToString(@"hh\:mm");
            }

            this.dataGridTarea.ClearSelection();
        }
コード例 #5
0
 private void frmGestionTarea_Load(object sender, EventArgs e)
 {
     tarea = new Tarea();
     llenarDataGrid();
 }