Пример #1
0
        public int DeleteCalculoDetalle(int idCalculoDetalle)
        {
            try
            {
                using (var Conexion = new EntityOperaciones())
                {
                    TBL_CALCULO_DETALLE obj = Conexion.TBL_CALCULO_DETALLE.Where(x => x.ID_CALCULO_DETALLE == idCalculoDetalle).FirstOrDefault();

                    Conexion.Entry(obj).State = EntityState.Deleted;

                    return(Conexion.SaveChanges());
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
        public int UpdateCalculoDetalle(string codigo, double ringWidth, double ringThickness, double ringDiameter, double ringGap, int idCalculoDetalle)
        {
            try
            {
                using (var Conexion = new EntityOperaciones())
                {
                    TBL_CALCULO_DETALLE obj = Conexion.TBL_CALCULO_DETALLE.Where(x => x.ID_CALCULO_DETALLE == idCalculoDetalle).FirstOrDefault();

                    obj.CODIGO         = codigo;
                    obj.RING_WIDTH     = ringWidth;
                    obj.RING_THICKNESS = ringThickness;
                    obj.RING_DIAMETER  = ringDiameter;
                    obj.RING_GAP       = ringGap;

                    Conexion.Entry(obj).State = EntityState.Modified;

                    return(Conexion.SaveChanges());
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #3
0
        public int InsertCalculoDetalle(string codigo, double ringWidth, double ringThickness, double ringDiameter, double ringGap)
        {
            try
            {
                using (var Conexion = new EntityOperaciones())
                {
                    TBL_CALCULO_DETALLE obj = new TBL_CALCULO_DETALLE();

                    obj.CODIGO         = codigo;
                    obj.RING_WIDTH     = ringWidth;
                    obj.RING_THICKNESS = ringThickness;
                    obj.RING_DIAMETER  = ringDiameter;
                    obj.RING_GAP       = ringGap;

                    Conexion.TBL_CALCULO_DETALLE.Add(obj);

                    return(Conexion.SaveChanges());
                }
            }
            catch (Exception)
            {
                throw;
            }
        }