Example #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try {
                if (txtNorma.Text.Trim().Length > 0)
                {
                    if (oList.Find(item => item.Color.Id == int.Parse(cboColores.SelectedValue.ToString())) == null)
                    {
                        NormaBE Obj = new NormaBE();
                        Obj.Id           = 0;
                        Obj.Color.Id     = int.Parse(cboColores.SelectedValue.ToString());
                        Obj.Color.Nombre = cboColores.Text;
                        Obj.Norma        = int.Parse(txtNorma.Text);
                        oList.Add(Obj);

                        gvDatos.DataSource = null;
                        gvDatos.DataSource = oList;
                    }
                    else
                    {
                        RadMessageBox.Show("Ye se ha agregado el reflejante seleccionado", this.Text, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                    }
                }
                else
                {
                    RadMessageBox.Show("Es necesario capturar la norma", this.Text, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                }
            } catch (Exception ex) {
                RadMessageBox.Show("OcurriĆ³ un error al agregar los datos\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
            }
        }
Example #2
0
 public InyeccionBE()
 {
     Id        = 0;
     OP        = string.Empty;
     Operador  = string.Empty;
     Muestra   = 0;
     Color     = new ColoresBE();
     Detalle   = new InyeccionDetalleBE();
     Norma     = new NormaBE();
     IdUsuario = 0;
     Fecha     = DateTime.Today;
 }
Example #3
0
        public List <NormaBE> CAL_ReflejantesNorma_Obtener()
        {
            List <NormaBE> oList = new List <NormaBE>();

            try {
                using (SqlConnection conn = new SqlConnection(RecuperarCadenaDeConexion("coneccionSQL"))) {
                    conn.Open();
                    using (SqlCommand cmd = new SqlCommand(CONS_USP_CAL_REFLEJANTESNORMA_OBTENER, conn)) {
                        cmd.CommandType = CommandType.StoredProcedure;

                        using (SqlDataReader reader = cmd.ExecuteReader()) {
                            while (reader.Read())
                            {
                                NormaBE Obj = new NormaBE();

                                Obj.Id                   = int.Parse(reader["NOR_Id"].ToString());
                                Obj.Color.Id             = int.Parse(reader["COL_Id"].ToString());
                                Obj.Color.Nombre         = reader["COL_Nombre"].ToString();
                                Obj.Norma                = int.Parse(reader["NOR_Norma"].ToString());
                                Obj.Cav1                 = decimal.Parse(reader["NOR_Cav1"].ToString());
                                Obj.Cav2                 = decimal.Parse(reader["NOR_Cav2"].ToString());
                                Obj.Cav3                 = decimal.Parse(reader["NOR_Cav3"].ToString());
                                Obj.Cav4                 = decimal.Parse(reader["NOR_Cav4"].ToString());
                                Obj.Cav5                 = decimal.Parse(reader["NOR_Cav5"].ToString());
                                Obj.Cav6                 = decimal.Parse(reader["NOR_Cav6"].ToString());
                                Obj.Cav7                 = decimal.Parse(reader["NOR_Cav7"].ToString());
                                Obj.Cav8                 = decimal.Parse(reader["NOR_Cav8"].ToString());
                                Obj.DatosUsuario.Estatus = bool.Parse(reader["NOR_Estatus"].ToString());

                                oList.Add(Obj);
                            }
                        }
                    }
                }
                return(oList);
            } catch (Exception ex) {
                throw ex;
            }
        }