Пример #1
0
        private void addHarvestingJob()
        {
            HarvestingJob hj = new HarvestingJob();

            hj.Description  = textBox1.Text;
            hj.SowingJob_id = Convert.ToInt32(cbSoj.Text);
            string idStr = cbFarm.Text.Split('.')[0];

            hj.Farm_id = int.Parse(idStr);
            string idStr1 = cbCrop.Text.Split('.')[0];

            hj.Crop_id = int.Parse(idStr1);
            string idStr2 = cbVehicle.Text.Split('.')[0];

            hj.Vehicle_id         = int.Parse(idStr2);
            hj.Est_quantity       = int.Parse(numericUpDown1.Text);
            hj.Harvested_quantity = int.Parse(numericUpDown2.Text);
            string idStr3 = cbEmployee.Text.Split('.')[0];

            hj.Employee_id = int.Parse(idStr3);
            hj.Date_start  = Convert.ToDateTime(dtpStart1.Value);
            hj.Date_end    = Convert.ToDateTime(dtpEnd.Value);

            InsertSQL hdl = new InsertSQL();

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