Exemplo n.º 1
0
        private void addFertiliser()
        {
            FertilisingJob fj = new FertilisingJob();

            fj.Description = textBox1.Text;
            string idStr = cbFertiliser.Text.Split('.')[0];

            fj.Fertiliser_id = int.Parse(idStr);
            fj.Quantity_kg   = int.Parse(textBox3.Text);
            string idStr1 = cbSoj.Text.Split('.')[0];

            fj.SowingJob_id = int.Parse(idStr1);
            string idStr2 = cbFarm.Text.Split('.')[0];

            fj.Farm_id = int.Parse(idStr2);
            string idStr3 = cbVehicle.Text.Split('.')[0];

            fj.Vehicle_id = int.Parse(idStr3);
            string idStr4 = cbCrop.Text.Split('.')[0];

            fj.Crop_id = int.Parse(idStr4);
            string idStr5 = cbEmployee.Text.Split('.')[0];

            fj.Employee_id = int.Parse(idStr5);
            fj.Date_start  = this.dtpStart.Value;
            fj.Date_end    = this.dtpEnd.Value;

            InsertSQL add       = new InsertSQL();
            int       addrecord = add.addNewFertilisingJob(fj);

            MessageBox.Show("Success!!");
            this.Close();
        }