Exemplo n.º 1
0
        private void dataGridType_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int id = Convert.ToInt32(dataGridType.Rows[e.RowIndex].Cells[0].Value);

            selectedType  = db.Task_types.Find(id);
            typeName.Text = selectedType.task_type_name;
            typeRate.Text = selectedType.task_type_rate.ToString();
        }
Exemplo n.º 2
0
        private void addType_Click(object sender, EventArgs e)
        {
            var item = new Task_types();

            item.task_type_name = typeName.Text;
            item.task_type_rate = Convert.ToDouble(typeRate.Text);
            db.Task_types.Add(item);
            db.SaveChanges();
            fillType();
        }