示例#1
0
        public void Actualizar()
        {
            try
            {
                cnGeneral = new clsDatos();

                SqlParameter[] parParameter = new SqlParameter[4];

                parParameter[0] = new SqlParameter();
                parParameter[0].ParameterName = "@opc";
                parParameter[0].SqlDbType     = SqlDbType.Int;
                parParameter[0].SqlValue      = objContacto.opc;

                parParameter[1] = new SqlParameter();
                parParameter[1].ParameterName = "@ID_P";
                parParameter[1].SqlDbType     = SqlDbType.Int;
                parParameter[1].SqlValue      = objContacto.ID_P;

                parParameter[2] = new SqlParameter();
                parParameter[2].ParameterName = "@Plato";
                parParameter[2].SqlDbType     = SqlDbType.VarChar;
                parParameter[2].Size          = 20;
                parParameter[2].SqlValue      = objContacto.Plato;

                parParameter[3] = new SqlParameter();
                parParameter[3].ParameterName = "@Telefono";
                parParameter[3].SqlDbType     = SqlDbType.VarChar;
                parParameter[3].Size          = 20;
                parParameter[3].SqlValue      = objContacto.Valor;

                cnGeneral.EjecutarSP(parParameter, "SPContacto");
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
示例#2
0
        public void Actualizar()
        {
            try
            {
                cnGeneral = new clsDatos();

                SqlParameter[] parParameter = new SqlParameter[3];

                parParameter[0] = new SqlParameter();
                parParameter[0].ParameterName = "@opc";
                parParameter[0].SqlDbType     = SqlDbType.Int;
                parParameter[0].SqlValue      = objContacto.opc;

                //parParameter[1] = new SqlParameter();
                //parParameter[1].ParameterName = "@Id";
                //parParameter[1].SqlDbType = SqlDbType.Int;
                //parParameter[1].SqlValue = objContacto.Id;

                parParameter[1] = new SqlParameter();
                parParameter[1].ParameterName = "@Nombre";
                parParameter[1].SqlDbType     = SqlDbType.VarChar;
                parParameter[1].Size          = 50;
                parParameter[1].SqlValue      = objContacto.Nombre;

                parParameter[2] = new SqlParameter();
                parParameter[2].ParameterName = "@Telefono";
                parParameter[2].SqlDbType     = SqlDbType.VarChar;
                parParameter[2].Size          = 20;
                parParameter[2].SqlValue      = objContacto.Telefono;

                cnGeneral.EjecutarSP(parParameter, "SPContacto");
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }