public static void Create(COMPRA_RECEPCION c_r)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaCompraRecepcion.InsertOnSubmit(c_r);
         ctx.SubmitChanges();
     }
 }
Exemple #2
0
 public static void Create(DEVOLUCION_MATERIAL dev_mat_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaDevolucionMaterial.InsertOnSubmit(dev_mat_new);
         ctx.SubmitChanges();
     }
 }
 public static void Create(DETALLE_SOLICITUD_MATERIAL sol_mat_det_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaSolicitudMaterialDetalle.InsertOnSubmit(sol_mat_det_new);
         ctx.SubmitChanges();
     }
 }
 public static void Create(ENTREGA_MATERIAL entrg_mat_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaEntregaMaterial.InsertOnSubmit(entrg_mat_new);
         ctx.SubmitChanges();
     }
 }
 public static void Create(DETALLE_RECEPCION_MATERIAL rec_mat_det_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaRecepcionMaterialDetalle.InsertOnSubmit(rec_mat_det_new);
         ctx.SubmitChanges();
     }
 }
 public static void Create(STOCK_MATERIAL_UNIDAD stockmatunidad_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaStockMaterialUnidad.InsertOnSubmit(stockmatunidad_new);
         ctx.SubmitChanges();
     }
 }
 public static void Create(SOLICITUD_COMPRA sol_comp_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaSolicitudCompra.InsertOnSubmit(sol_comp_new);
         ctx.SubmitChanges();
     }
 }
Exemple #8
0
 public static void Create(UNIDAD_CLINICA uni_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaUnidadClinica.InsertOnSubmit(uni_new);
         ctx.SubmitChanges();
     }
 }
Exemple #9
0
 public static void Create(DETALLE_DEVOLUCION_MATERIAL d_d_m_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaDevolucionMaterialDetalle.InsertOnSubmit(d_d_m_new);
         ctx.SubmitChanges();
     }
 }
Exemple #10
0
 public static void Create(ESTADO estado_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaEstado.InsertOnSubmit(estado_new);
         ctx.SubmitChanges();
     }
 }
 public static void Create(DETALLE_SOLICITUD_COMPRA det_sol_comp_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaSolicitudCompraDetalle.InsertOnSubmit(det_sol_comp_new);
         ctx.SubmitChanges();
     }
 }
Exemple #12
0
 public static void Create(MATERIAL_KIT mat_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaMaterialKit.InsertOnSubmit(mat_new);
         ctx.SubmitChanges();
     }
 }
 public static void Create(DETALLE_ENTREGA_MATERIAL det_entr_mat_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaEntregaMaterialDetalle.InsertOnSubmit(det_entr_mat_new);
         ctx.SubmitChanges();
     }
 }
Exemple #14
0
 public static void Create(DETALLE_DEVOLUCION_A_PROVEEDOR det_dev_p_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaDevolucionProveedorDetalle.InsertOnSubmit(det_dev_p_new);
         ctx.SubmitChanges();
     }
 }
Exemple #15
0
 public static void Create(USUARIO usu_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         ctx.ListaUsuario.InsertOnSubmit(usu_new);
         ctx.SubmitChanges();
     }
 }
Exemple #16
0
        public static void DeleteKit(MATERIAL mat_del)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                MATERIAL_KIT material;

                try
                {
                    material = (from mat in ctx.ListaMaterialKit
                                where mat.M_ID.Equals(mat_del.M_ID)
                                select mat).First <MATERIAL_KIT>();
                }
                catch (Exception e)
                {
                    material = null;
                }

                while (material != null)
                {
                    ctx.ListaMaterialKit.DeleteOnSubmit(material);
                    ctx.SubmitChanges();

                    try
                    {
                        material = (from mat in ctx.ListaMaterialKit
                                    where mat.M_ID.Equals(mat_del.M_ID)
                                    select mat).First <MATERIAL_KIT>();
                    }
                    catch (Exception e)
                    {
                        material = null;
                    }
                }

                MATERIAL borrar = (from mat in ctx.ListaMaterial
                                   where mat.M_ID.Equals(mat_del.M_ID)
                                   select mat).First <MATERIAL>();

                ctx.ListaMaterial.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
Exemple #17
0
 public static void Create(MATERIAL mat_new)
 {
     using (BODEXDataContext ctx = new BODEXDataContext())
     {
         mat_new.M_STOCK_IDEAL = 100;
         mat_new.M_STOCK_BAJO  = 1;
         mat_new.M_STOCK_REAL  = 0;
         ctx.ListaMaterial.InsertOnSubmit(mat_new);
         ctx.SubmitChanges();
     }
 }
        public static void Delete(DETALLE_ENTREGA_MATERIAL det_entr_mat_del)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                DETALLE_ENTREGA_MATERIAL borrar = (from det_entr_mat in ctx.ListaEntregaMaterialDetalle
                                                   where det_entr_mat.EM_ID.Equals(det_entr_mat_del.EM_ID) && det_entr_mat.M_ID.Equals(det_entr_mat_del.M_ID)
                                                   select det_entr_mat).First <DETALLE_ENTREGA_MATERIAL>();

                ctx.ListaEntregaMaterialDetalle.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
        public static void Update(DETALLE_ENTREGA_MATERIAL det_entr_mat_upd)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                DETALLE_ENTREGA_MATERIAL EntregaMaterialDetalle = (from det_entr_mat in ctx.ListaEntregaMaterialDetalle
                                                                   where det_entr_mat.EM_ID.Equals(det_entr_mat_upd.EM_ID) && det_entr_mat.M_ID.Equals(det_entr_mat_upd.M_ID)
                                                                   select det_entr_mat).First <DETALLE_ENTREGA_MATERIAL>();

                EntregaMaterialDetalle.DEM_CANTIDAD = det_entr_mat_upd.DEM_CANTIDAD;
                ctx.SubmitChanges();
            }
        }
Exemple #20
0
        public static void Delete(DETALLE_DEVOLUCION_MATERIAL d_d_m_del)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                DETALLE_DEVOLUCION_MATERIAL borrar = (from d_d_m in ctx.ListaDevolucionMaterialDetalle
                                                      where (d_d_m.M_ID.Equals(d_d_m_del.M_ID) && d_d_m.DM_ID.Equals(d_d_m_del.DM_ID))
                                                      select d_d_m).First <DETALLE_DEVOLUCION_MATERIAL>();

                ctx.ListaDevolucionMaterialDetalle.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
Exemple #21
0
        public static void Delete(ESTADO estado_del)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                ESTADO borrar = (from e in ctx.ListaEstado
                                 where e.E_ID.Equals(estado_del.E_ID)
                                 select e).First <ESTADO>();

                ctx.ListaEstado.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
        public static void Delete(SOLICITUD_COMPRA sol_comp_del)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                SOLICITUD_COMPRA borrar = (from sol_comp in ctx.ListaSolicitudCompra
                                           where sol_comp.SC_ID.Equals(sol_comp_del.SC_ID)
                                           select sol_comp).First <SOLICITUD_COMPRA>();

                ctx.ListaSolicitudCompra.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
        public static void Delete(DEVOLUCION_A_PROVEEDOR dev_pro_del)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                DEVOLUCION_A_PROVEEDOR borrar = (from dev_pro in ctx.ListaDevolucionProveedor
                                                 where dev_pro.DP_ID.Equals(dev_pro_del.DP_ID)
                                                 select dev_pro).First <DEVOLUCION_A_PROVEEDOR>();

                ctx.ListaDevolucionProveedor.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
Exemple #24
0
        public static void Delete(UNIDAD_CLINICA uni_del)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                UNIDAD_CLINICA borrar = (from uni in ctx.ListaUnidadClinica
                                         where uni.UC_ID.Equals(uni_del.UC_ID)
                                         select uni).First <UNIDAD_CLINICA>();

                ctx.ListaUnidadClinica.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
Exemple #25
0
        public static void Delete(DETALLE_DEVOLUCION_A_PROVEEDOR det_dev_p_del)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                DETALLE_DEVOLUCION_A_PROVEEDOR borrar = (from det_dev_p in ctx.ListaDevolucionProveedorDetalle
                                                         where det_dev_p.DP_ID.Equals(det_dev_p_del.DP_ID) && det_dev_p.M_ID.Equals(det_dev_p_del.M_ID)
                                                         select det_dev_p).First <DETALLE_DEVOLUCION_A_PROVEEDOR>();

                ctx.ListaDevolucionProveedorDetalle.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
Exemple #26
0
        public static void updateComprar(MATERIAL_FALTANTE mat_upd)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                MATERIAL_FALTANTE material = (from mat in CRUD_Material.getAllComprar()
                                              where mat.M_ID.Equals(mat_upd.M_ID)
                                              select mat).First <MATERIAL_FALTANTE>();

                material.M_CANTIDAD = mat_upd.M_CANTIDAD;
                ctx.SubmitChanges();
            }
        }
        public static void Delete(ENTREGA_MATERIAL entrg_mat_del)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                ENTREGA_MATERIAL borrar = (from entrg_mat in ctx.ListaEntregaMaterial
                                           where entrg_mat.EM_ID.Equals(entrg_mat_del.EM_ID)
                                           select entrg_mat).First <ENTREGA_MATERIAL>();

                ctx.ListaEntregaMaterial.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
Exemple #28
0
        public static void Delete(MATERIAL mat_del)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                MATERIAL borrar = (from mat in ctx.ListaMaterial
                                   where mat.M_ID.Equals(mat_del.M_ID)
                                   select mat).First <MATERIAL>();

                ctx.ListaMaterial.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
Exemple #29
0
        public static void Delete(USUARIO usuario)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                USUARIO borrar = (from u in ctx.ListaUsuario
                                  where u.nombre.Equals(usuario.nombre)
                                  select u).First <USUARIO>();

                ctx.ListaUsuario.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }
        public static void Delete(COMPRA_RECEPCION cr_upd)
        {
            using (BODEXDataContext ctx = new BODEXDataContext())
            {
                COMPRA_RECEPCION borrar = (from c_r in ctx.ListaCompraRecepcion
                                           where (c_r.SC_ID.Equals(cr_upd.SC_ID) && c_r.RM_ID.Equals(cr_upd.RM_ID))
                                           select c_r).First <COMPRA_RECEPCION>();

                ctx.ListaCompraRecepcion.DeleteOnSubmit(borrar);
                ctx.SubmitChanges();
            }
        }