private void btnSubmit_Click(object sender, EventArgs e)
        {
            //MessageBox.Show(ActualStock.ToString());
            var sdDao = new StockDetailsDao();
            int serviceId = (cmbServiceID.SelectedItem as Service).Id;
            string serviceName = (cmbServiceID.SelectedItem as Service).Name;
            int stockVal = Convert.ToInt32(numActualPackets.Text) - ActualStock;
            stockVal = -(stockVal);
            sdDao.UpdateStockDetail(stockVal, serviceId);

            int poId = 0;
            int.TryParse(txtId.Text, out poId);
            var poObj = new PattiOut
            {
                Id = poId,
                ServiceId = (cmbServiceID.SelectedItem as Service).Id,
                PattiNumbers = Convert.ToInt32(numPattiNumbers.Text),
                ActualPackets = Convert.ToInt32(numActualPackets.Text),
                IssuedDate = Convert.ToDateTime(dtpInDate.Value),
                EnteredOn = DateTime.Now,
                EnteredBy = 1
            };

            var poDao = new PattiOutDao();
            poDao.SavePattiOut(poObj);
            ShowPattiOut();
        }
 private void ShowPattiOut()
 {
     var poDao = new PattiOutDao();
     dgvPattiOut.AutoGenerateColumns = false;
     String dt = String.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(currentDateTimePicker.Value));
     dgvPattiOut.DataSource = poDao.GetAllPattiOut(dt);
     tableLayoutPanel2.Hide();
 }