コード例 #1
0
 public bool AnularDB(in_Producto_CG_Info info, ref string mensaje)
 {
     try
     {
         bool resultado = false;
         using (Entities_Inventario_CG Base = new Entities_Inventario_CG())
         {
             var address = Base.in_Producto_CG.FirstOrDefault(o => o.IdEmpresa == info.IdEmpresa && o.IdProducto == info.IdProducto);
             if (address != null)
             {
                 address.IdUsuarioUltAnu    = info.IdUsuarioUltAnu;
                 address.Fecha_UltAnu       = DateTime.Now;
                 address.pr_motivoAnulacion = info.pr_motivoAnulacion;
                 address.Estado             = "I";
                 address.ip     = info.ip;
                 address.nom_pc = info.nom_pc;
                 Base.SaveChanges();
                 resultado = true;
             }
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         mensaje = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.InnerException.ToString());
     }
 }
コード例 #2
0
 public bool AnularDB(in_Ing_Egr_Inven_CG_Info info)
 {
     try
     {
         bool resultado = false;
         using (Entities_Inventario_CG Base = new Entities_Inventario_CG())
         {
             var address = Base.in_Ing_Egr_Inven_CG.FirstOrDefault(o => o.IdEmpresa == info.IdEmpresa && o.IdSucursal == info.IdSucursal &&
                                                                   o.IdMovi_inven_tipo == info.IdMovi_inven_tipo && o.IdNumMovi == info.IdNumMovi);
             if (address != null)
             {
                 address.IdusuarioUltAnu = info.IdusuarioUltAnu;
                 address.Fecha_UltAnu    = DateTime.Now;
                 address.MotivoAnulacion = info.MotivoAnulacion;
                 address.Estado          = "I";
                 address.ip     = info.ip;
                 address.nom_pc = info.nom_pc;
                 Base.SaveChanges();
                 resultado = true;
             }
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string arreglo      = ToString();
         string MensajeError = string.Empty;
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         MensajeError = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
         throw new Exception(ex.InnerException.ToString());
     }
 }
コード例 #3
0
 public bool GrabarDB(in_categoria_CG_Info info, ref string mensaje)
 {
     try
     {
         bool resultado = false;
         using (Entities_Inventario_CG Base = new Entities_Inventario_CG())
         {
             in_categoria_CG address = new in_categoria_CG();
             address.IdEmpresa      = info.IdEmpresa;
             address.IdCategoria    = info.IdCategoria;
             address.sw_formulacion = info.sw_formulacion;
             address.sw_insumos     = info.sw_insumos;
             address.sw_medicamento = info.sw_medicamento;
             address.sw_vende       = info.sw_vende;
             address.Estado         = "A";
             address.IdUsuario      = info.IdUsuario;
             address.Fecha_Transac  = DateTime.Now;
             address.ip             = info.ip;
             address.nom_pc         = info.nom_pc;
             Base.in_categoria_CG.Add(address);
             Base.SaveChanges();
             resultado = true;
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         mensaje = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.InnerException.ToString());
     }
 }
コード例 #4
0
 public bool GrabarDB(in_Producto_CG_Info info, ref string mensaje)
 {
     try
     {
         bool resultado = false;
         using (Entities_Inventario_CG Base = new Entities_Inventario_CG())
         {
             in_Producto_CG address = new in_Producto_CG();
             address.IdEmpresa  = info.IdEmpresa;
             address.IdProducto = info.IdProducto;
             address.med_cod_anatofarmacologico  = info.med_cod_anatofarmacologico;
             address.med_cod_forma_farmacologica = info.med_cod_forma_farmacologica;
             address.med_cod_principio_activo    = info.med_cod_principio_activo;
             address.med_sw_farmacovigilancia    = info.med_sw_farmacovigilancia;
             address.med_descripcion_alerta      = info.med_descripcion_alerta;
             address.med_sw_alimento_parenteral  = info.med_sw_alimento_parenteral;
             address.med_sw_alimento_enteral     = info.med_sw_alimento_enteral;
             address.med_sw_manejo_luz           = info.med_sw_manejo_luz;
             address.codigo_alterno               = info.codigo_alterno;
             address.codigo_cnmb                  = info.codigo_cnmb;
             address.contenido_unidad_venta       = info.contenido_unidad_venta;
             address.sw_control_fecha_vencimiento = info.sw_control_fecha_vencimiento;
             address.sw_generico                  = info.sw_generico;
             address.sw_pos = info.sw_pos;
             address.sw_solicita_autorizacion = info.sw_solicita_autorizacion;
             address.sw_venta_directa         = info.sw_venta_directa;
             address.Estado        = "A";
             address.IdUsuario     = info.IdUsuario;
             address.Fecha_Transac = DateTime.Now;
             address.ip            = info.ip;
             address.nom_pc        = info.nom_pc;
             Base.in_Producto_CG.Add(address);
             Base.SaveChanges();
             resultado = true;
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         mensaje = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.InnerException.ToString());
     }
 }
コード例 #5
0
 public bool ActualizarDB(in_categoria_CG_Info info, ref string mensaje)
 {
     try
     {
         bool resultado = false;
         using (Entities_Inventario_CG Base = new Entities_Inventario_CG())
         {
             var address = Base.in_categoria_CG.FirstOrDefault(o => o.IdEmpresa == info.IdEmpresa && o.IdCategoria == info.IdCategoria);
             if (address != null)
             {
                 address.sw_formulacion  = info.sw_formulacion;
                 address.sw_insumos      = info.sw_insumos;
                 address.sw_medicamento  = info.sw_medicamento;
                 address.sw_vende        = info.sw_vende;
                 address.IdUsuarioUltMod = info.IdUsuarioUltMod;
                 address.Fecha_UltMod    = DateTime.Now;
                 address.ip     = info.ip;
                 address.nom_pc = info.nom_pc;
                 Base.SaveChanges();
                 resultado = true;
             }
             else
             {
                 resultado = GrabarDB(info, ref mensaje);
             }
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         mensaje = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.InnerException.ToString());
     }
 }
コード例 #6
0
 public bool GrabarDB(in_Ing_Egr_Inven_CG_Info info, ref string mensaje)
 {
     try
     {
         bool resultado = false;
         using (Entities_Inventario_CG Base = new Entities_Inventario_CG())
         {
             in_Ing_Egr_Inven_CG address = new in_Ing_Egr_Inven_CG();
             address.IdEmpresa         = info.IdEmpresa;
             address.IdSucursal        = info.IdSucursal;
             address.IdCuenta          = info.IdCuenta;
             address.IdIngreso         = info.IdIngreso;
             address.IdMovi_inven_tipo = info.IdMovi_inven_tipo;
             address.IdNumMovi         = info.IdNumMovi;
             address.Estado            = "A";
             address.IdUsuarioCreacion = info.IdUsuarioCreacion;
             address.Fecha_Transac     = DateTime.Now;
             address.ip     = info.ip;
             address.nom_pc = info.nom_pc;
             Base.in_Ing_Egr_Inven_CG.Add(address);
             Base.SaveChanges();
             resultado = true;
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         //string MensajeError = string.Empty;
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         mensaje = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.InnerException.ToString());
     }
 }