Example #1
0
        /// <summary>
        /// Borra un remitente por medio del id
        /// </summary>
        /// <param name="id">El id del remitente que se desea borrar</param>
        public int Delete(int id)
        {
            Remitente remitente = new Remitente();

            remitente = FindById(id);

            remitentes remitenteTable = new remitentes
            {
                id_remitente = remitente.GetId(),
                nombre_remitente = remitente.GetNombre(),
                apellido_paterno_remitente = remitente.GetApellidoPaterno(),
                apellido_materno_remitente = remitente.GetApellidoMaterno()
            };


            DAODataContext contexto = new DAODataContext();
            contexto.remitentes.Attach(remitenteTable);
            contexto.remitentes.DeleteOnSubmit(remitenteTable);
            contexto.SubmitChanges();

            return 0;
        }
Example #2
0
        /// <summary>
        /// Inserta un remitente al proporcionar los parĂ¡metros adecuados, el id es autogenerado
        /// </summary>
        /// <param name="nombre"></param>
        /// <param name="apellido_paterno"></param>
        /// <param name="apellido_materno"></param>
        /// <returns>string, string, string</returns>
        public int Insert(string nombre, string apellido_paterno, string apellido_materno)
        {

            remitentes remitenteTable = new remitentes
            {
                nombre_remitente = nombre,
                apellido_paterno_remitente = apellido_paterno,
                apellido_materno_remitente = apellido_materno
            };


            DAODataContext contexto = new DAODataContext();
            contexto.remitentes.InsertOnSubmit(remitenteTable);
            contexto.SubmitChanges();

            return 0;
        }
Example #3
0
        /// <summary>
        /// Inserta un objeto remitente
        /// </summary>
        /// <param name="remitente"></param>
        public int Insert(Remitente remitente)
        {

            remitentes remitenteTable = new remitentes
            {
                nombre_remitente = remitente.GetNombre(),
                apellido_paterno_remitente = remitente.GetApellidoPaterno(),
                apellido_materno_remitente = remitente.GetApellidoMaterno()
            };


            DAODataContext contexto = new DAODataContext();
            contexto.remitentes.InsertOnSubmit(remitenteTable);
            contexto.SubmitChanges();
            return 0;
        }
Example #4
0
 partial void Deleteremitentes(remitentes instance);
Example #5
0
 partial void Updateremitentes(remitentes instance);
Example #6
0
 partial void Insertremitentes(remitentes instance);