Exemple #1
0
        private void btnAd_Click(object sender, EventArgs e)
        {
            CommodityModel newCommodityModel = new CommodityModel();

            using (AddUpdateCommdityFrm NewCommodityFrm = new AddUpdateCommdityFrm(MaintainType.New, newCommodityModel))
            {
                var dialogResult = NewCommodityFrm.ShowDialog();
                if (dialogResult == DialogResult.OK)
                {
                    this.InitControls();
                }
            }
        }
Exemple #2
0
 private void btnUp_Click(object sender, EventArgs e)
 {
     if (this.dataGridView1.SelectedRows.Count > 0)
     {
         var commodity = this.dataGridView1.SelectedRows[0].Tag as CommodityModel;
         using (AddUpdateCommdityFrm upadteCommodityFrm = new AddUpdateCommdityFrm(MaintainType.Update, commodity))
         {
             var dialogResult = upadteCommodityFrm.ShowDialog();
             if (dialogResult == DialogResult.OK)
             {
                 this.InitControls();
             }
         }
     }
 }