コード例 #1
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         foreach (DataGridViewRow dgvRow in dgvChangeProductTax.Rows)
         {
             if (dgvRow.Cells["dgvtxtSelect"].Value != null)
             {
                 if ((bool)(dgvRow.Cells["dgvtxtSelect"].Value))
                 {
                     int inProductId = Convert.ToInt32(dgvChangeProductTax.Rows[dgvRow.Index].Cells["dgvtxtProductId"].Value.ToString());
                     ProductSP spProduct = new ProductSP();
                     ProductInfo infoProduct = new ProductInfo();
                     infoProduct.TaxId = Convert.ToInt32(cmbNewTaxType.SelectedValue.ToString());
                     infoProduct.ProductId = inProductId;
                     spProduct.ChangeProductTaxSave(infoProduct);
                     isDefault = false;
                 }
             }
         }
         Messages.SavedMessage();
         cmbSearchBy.Focus();
         Clear();
     }
     catch (Exception ex)
     {
         MessageBox.Show("CPT 2 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }