Exemplo n.º 1
0
        private void addStoringJob()
        {
            StoringJob sj = new StoringJob();

            sj.Description = textBox1.Text;
            string idStr = cbHarvest.Text.Split('.')[0];

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

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

            sj.Box_id   = int.Parse(idStr2);
            sj.Quantity = int.Parse(textBox5.Text);
            string idStr3 = cbVehicle.Text.Split('.')[0];

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

            sj.Employee_id = int.Parse(idStr4);
            sj.Date_start  = Convert.ToDateTime(dtpStart.Text);
            sj.Date_end    = Convert.ToDateTime(dtpEnd.Text);

            InsertSQL addHnd    = new InsertSQL();
            int       addrecord = addHnd.addNewStoringJob(sj);

            MessageBox.Show(addrecord + " Your record is added");
            this.Close();
        }