示例#1
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            ProductTypeForm frm = new ProductTypeForm();
            DialogResult    dr  = frm.ShowDialog(this);

            if (dr == DialogResult.OK)
            {
                _productoController.SaveType(new ProveedorType()
                {
                    Code = frm.retType.Code, Descripcion = frm.retType.Descripcion
                });
            }
            else if (dr == DialogResult.Cancel)
            {
                frm.Close();
            }
            CargarTypes();
        }
示例#2
0
 private void editType()
 {
     if (dgvDescripcion.DataSource != null)
     {
         ProveedorType   typeSelected = (ProveedorType)dgvDescripcion.CurrentRow.DataBoundItem;
         ProductTypeForm frm          = new ProductTypeForm(typeSelected.Code);
         frm.retType.Descripcion = typeSelected.Descripcion;
         DialogResult dr = frm.ShowDialog(this);
         if (dr == DialogResult.OK)
         {
             _productoController.SaveType(new ProveedorType()
             {
                 Code = frm.retType.Code, Descripcion = frm.retType.Descripcion
             });
             CargarTypes();
         }
         else if (dr == DialogResult.Cancel)
         {
             frm.Close();
         }
     }
 }