Exemplo n.º 1
0
        public void InsertWC(WorkingCart123 p)
        {
            try
            {
                command.CommandText = "INSERT INTO Workingcard(id_WorkingCard, [Begin], [End], WorkingTask, [Status], [Taskdescription], [Username]) VALUES ("
                                      +

                                      p.id_WorkingCart + "," + "'" + p.begin + "'" + "," + "'" + p.end + "'" + "," + p.taskName + "," +
                                      "'" + p.status + "'" + "," + "'" + p.description + "'" + "," + "'" + p.username + "')";
                command.CommandType = CommandType.Text;
                connection.Open();
                command.ExecuteNonQuery();
            }
            catch (Exception)
            {
                //throw;
                MessageBox.Show("Некоректни данни! Моля въведете отново!");
            }
            finally
            {
                if (connection != null)
                {
                    connection.Close();
                }
            }
        }
Exemplo n.º 2
0
 private void button4_Click(object sender, EventArgs e)
 {
     WorkingCart123 p = new WorkingCart123();
     //p.id_WorkingCart = textBox1.Text;
     //p.begin = dateTimePicker1.Text;
     //p.end = dateTimePicker2.Text;
     //p.status = comboBox2.Text;
     //p.description = textBox4.Text;
     //p.username = textBox5.Text;
     //b.UpdateWC(p);
 }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            WorkingCart123 p = new WorkingCart123();

            p.id_WorkingCart = textBox1.Text;
            p.begin          = dateTimePicker1.Text;
            p.end            = dateTimePicker2.Text;
            p.taskName       = comboBox1.Text;
            p.status         = comboBox2.Text;
            p.description    = textBox4.Text;
            p.username       = comboBox3.Text;
            b.InsertWC(p);
        }
Exemplo n.º 4
0
 public void UpdateWC(WorkingCart123 p)
 {
     try
     {
         //command.CommandText = "UPDATE Employee SET Username='******'" + p.FirstName + "," + " LastName=" + "'" + p.LastName + "," + " Position=" + "'" + p.Position + "," + " Lastaction=" + "'" + p.Lastaction + "'" + " WHERE Username="******"Некоректни данни! Моля въведете отново!");
     }
     finally
     {
         if (connection != null)
         {
             connection.Close();
         }
     }
 }