Ejemplo n.º 1
0
        private void submitOT()
        {
            double overtimeAmount;

            try
            {
                overtimeAmount = Convert.ToDouble(txtOvertime.Text);
            }
            catch
            {
                overtimeAmount = 0;
            }

            Overtime o = new Overtime();

            o.updateOT(_selectedDate, _department, overtimeAmount);
        }
Ejemplo n.º 2
0
        private void btn_update_Click(object sender, EventArgs e)
        {
            //update each line here to add new overtime, even if it hasnt been changed then it should not matter because it pulls the current overtime into that cell
            using (SqlConnection CONNECT = new SqlConnection(connectionStrings.ConnectionString))
            {
                string sql = "";
                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    Overtime o = new Overtime();
                    o.updateOT(Convert.ToDateTime(dataGridView1.Rows[i].Cells[1].Value), dept, Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value));

                    if (dataGridView1.Rows[i].Cells[0].Value.ToString() == dateID.ToString())
                    {
                        overtimeForSD = Convert.ToInt32(dataGridView1.Rows[i].Cells[2].Value);
                    }
                }
            }
            this.Close();
        }