コード例 #1
0
        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();
        }
コード例 #2
0
 public int UpdatePattiOut(PattiOut poObj)
 {
     using (var db = new eTempleDbDB())
     {
         return db.Update(poObj);
     }
 }
コード例 #3
0
 public void SavePattiOut(PattiOut poObj)
 {
     using (var db = new eTempleDbDB())
     {
         db.Save(poObj);
     }
 }
コード例 #4
0
 private void ShowPO(PattiOut poObj)
 {
     txtId.Text = poObj.Id.ToString();
     cmbServiceID.SelectedValue = poObj.ServiceId;
     numPattiNumbers.Value = poObj.PattiNumbers;
     numActualPackets.Value = poObj.ActualPackets;
     dtpInDate.Value = poObj.IssuedDate;
     ActualStock = poObj.ActualPackets;
     tableLayoutPanel2.Show();
 }