Exemple #1
0
        protected void btnAddProducto_Click(object sender, EventArgs e)
        {
            string err = string.Empty;

            try
            {
                if (ValidProducto(out err))
                {
                    List <DTO.PiezasArteSKUDTO> aux = Productos;

                    var arteProducto = new DTO.PiezasArteSKUDTO();

                    arteProducto.RecId      = aux.Count;
                    arteProducto.IdentifSKU = Convert.ToString(ucIdentifSKU.SelectedValue);
                    arteProducto.TipoProd   = rbTipoProd.SelectedItem.Value.ToString();
                    if (arteProducto.TipoProd != PRIMARIO)
                    {
                        arteProducto.Coeficiente = null;
                    }
                    else
                    {
                        arteProducto.Coeficiente = Convert.ToDecimal(spCoeficiente.Value);
                    }

                    aux.Add(arteProducto);

                    ucIdentifSKU.ComboBox.SelectedIndex = -1;
                    spCoeficiente.Value = null;
                    Productos           = aux;
                    RefreshAbmGrid(gvABM);
                }
                else
                {
                    throw new Exception(err);
                }
            }
            catch (Exception ex)
            {
                FormsHelper.MsgError(lblErrorProducto, ex);
            }
        }
        protected void btnAddProducto_Click(object sender, EventArgs e)
        {
            string err = string.Empty;

            try
            {
                if (ValidProducto(out err))
                {
                    List<DTO.PiezasArteSKUDTO> aux = Productos;

                    var arteProducto = new DTO.PiezasArteSKUDTO();

                    arteProducto.RecId = aux.Count;
                    arteProducto.IdentifSKU = Convert.ToString(ucIdentifSKU.SelectedValue);
                    arteProducto.TipoProd = rbTipoProd.SelectedItem.Value.ToString();
                    if (arteProducto.TipoProd != PRIMARIO)
                        arteProducto.Coeficiente = null;
                    else
                        arteProducto.Coeficiente = Convert.ToDecimal(spCoeficiente.Value);

                    aux.Add(arteProducto);

                    ucIdentifSKU.ComboBox.SelectedIndex = -1;
                    spCoeficiente.Value = null;
                    Productos = aux;
                    RefreshAbmGrid(gvABM);
                }
                else
                {
                    throw new Exception(err);
                }
            }
            catch (Exception ex)
            {
                FormsHelper.MsgError(lblErrorProducto, ex);
            }
        }