Beispiel #1
0
        /// <summary>
        /// Método para eliminar un registro
        /// </summary>
        /// <param name="IdLoadingGuideAnillos"></param>
        /// <returns></returns>
        public int DeleteLoadingGuideAnillos(int IdLoadingGuideAnillos)
        {
            try
            {
                using (var conexion = new EntitiesTooling())
                {
                    LoadingGuideAnillos_ obj = conexion.LoadingGuideAnillos_.Where(x => x.IdLoadingGuideAnillos == IdLoadingGuideAnillos).FirstOrDefault();

                    conexion.Entry(obj).State = System.Data.Entity.EntityState.Deleted;

                    return(conexion.SaveChanges());
                }
            }
            catch (Exception)
            {
                return(0);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Método para actualizar los valores de un registro
        /// </summary>
        /// <param name="IdLoadingGuideAnillos"></param>
        /// <param name="MedidaNominal"></param>
        /// <returns></returns>
        public int UpdateLoadingGuideAnillos(int IdLoadingGuideAnillos, string MedidaNominal)
        {
            try
            {
                using (var conexion = new EntitiesTooling())
                {
                    LoadingGuideAnillos_ obj = conexion.LoadingGuideAnillos_.Where(x => x.IdLoadingGuideAnillos == IdLoadingGuideAnillos).FirstOrDefault();

                    obj.MedidaNominal = MedidaNominal;

                    conexion.Entry(obj).State = System.Data.Entity.EntityState.Modified;

                    return(conexion.SaveChanges());
                }
            }
            catch (Exception)
            {
                return(0);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Método para insertar un nuevo registro
        /// </summary>
        /// <param name="Codigo"></param>
        /// <param name="MedidaNominal"></param>
        /// <returns></returns>
        public int SetNewLoadingGuideAnillos(string Codigo, string MedidaNominal)
        {
            try
            {
                using (var conexion = new EntitiesTooling())
                {
                    LoadingGuideAnillos_ obj = new LoadingGuideAnillos_();

                    obj.Codigo        = Codigo;
                    obj.MedidaNominal = MedidaNominal;

                    conexion.LoadingGuideAnillos_.Add(obj);

                    return(conexion.SaveChanges());
                }
            }
            catch (Exception)
            {
                return(0);
            }
        }