コード例 #1
0
        public void ShearhName(DataGridView dgv, string nombre)
        {
            MotivoModel  objMod = new MotivoModel();
            MotivoEntity objEnt = new MotivoEntity();

            objEnt.Nombre = nombre;
            objMod.BuscarMotivo(dgv, nombre);
        }
コード例 #2
0
        public void Update(MotivoEntity objEnt)
        {
            con = objCon.Conectar();
            con.Open();

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "SP_UPD_MOTIVO";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection  = con;

            cmd.Parameters.Add("@ID", SqlDbType.Int).Value             = objEnt.IdMotivo;
            cmd.Parameters.Add("@NOMBRE", SqlDbType.VarChar, 50).Value = objEnt.Nombre;

            try
            {
                cmd.ExecuteNonQuery();
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #3
0
        public DataTable ListDetMotPorIdMotivo(MotivoEntity objEnt)
        {
            con = objCon.Conectar();
            con.Open();
            DataTable dt = new DataTable();

            try
            {
                SqlDataAdapter da = new SqlDataAdapter("SP_LIST_DET_MOT_POR_ID_MOTIVO", con);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                da.SelectCommand.Parameters.Add("@ID", SqlDbType.Int).Value = objEnt.IdMotivo;



                da.Fill(dt);
            }
            catch (Exception)
            {
                dt = null;
            }


            return(dt);
        }
コード例 #4
0
        public void Delete(MotivoEntity objEnt)
        {
            MotivoModel objMod = new MotivoModel();

            objMod.Delete(objEnt);
        }
コード例 #5
0
        public void Update(MotivoEntity objEnt)
        {
            MotivoModel objMod = new MotivoModel();

            objMod.Update(objEnt);
        }
コード例 #6
0
        public void Add(MotivoEntity objEnt)
        {
            MotivoModel objMod = new MotivoModel();

            objMod.Insert(objEnt);
        }
コード例 #7
0
        public void ListOficina(DataGridView dgv, MotivoEntity objEnt)
        {
            var tabla = this.ListDetMotPorIdMotivo(objEnt);

            this.LIstarGrid(dgv, tabla);
        }
コード例 #8
0
 public void ListDetMotPorIdMot(DataGridView dgv, MotivoEntity objEnt)
 {
     objDetMot.ListOficina(dgv, objEnt);
 }