コード例 #1
0
        public List <ro_permiso_x_empleado_Info> GetListLicenciaPorEmpleado(int IdEmpresa, int idEmpleado, DateTime fecha_I, DateTime fecha_F)
        {
            List <ro_permiso_x_empleado_Info> lst = new List <ro_permiso_x_empleado_Info>();

            try
            {
                // ARREGLAR CARLOS

                using (EntitiesRoles Gene = new EntitiesRoles())
                {
                    var cons = from q in Gene.ro_permiso_x_empleado
                               where q.IdEmpresa == IdEmpresa &&
                               q.IdEmpleado == idEmpleado &&
                               q.IdTipoLicencia == "143" &&
                               q.Estado == "A"
                               select q;
                    foreach (var item in cons)
                    {
                        ro_permiso_x_empleado_Info info = new ro_permiso_x_empleado_Info();
                        info.FechaEntrada = item.FechaEntrada;
                        info.FechaSalida  = item.FechaSalida;
                        lst.Add(info);
                    }
                }
                return(lst);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #2
0
ファイル: Aca_Profesor_Data.cs プロジェクト: arocajorge/ERPFJ
        public Aca_Profesor_Info Get_Profesor_Info(string cedula)
        {
            Aca_Profesor_Info profesorInfo;

            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    var vProfesor = Base.vwAca_profesor.FirstOrDefault(p => p.pe_cedulaRuc == cedula);
                    profesorInfo                                = new Aca_Profesor_Info();
                    profesorInfo.IdPersona                      = vProfesor.IdPersona;
                    profesorInfo.IdProfesor                     = vProfesor.IdProfesor;
                    profesorInfo.CodProfesor                    = vProfesor.CodProfesor;
                    profesorInfo.estado                         = vProfesor.estado;
                    profesorInfo.IdInstitucion                  = vProfesor.IdInstitucion;
                    profesorInfo.Persona_Info.IdPersona         = vProfesor.IdPersona;
                    profesorInfo.Persona_Info.pe_cedulaRuc      = vProfesor.pe_cedulaRuc;
                    profesorInfo.Persona_Info.pe_nombre         = vProfesor.pe_nombre;
                    profesorInfo.Persona_Info.pe_apellido       = vProfesor.pe_apellido;
                    profesorInfo.Persona_Info.pe_nombreCompleto = vProfesor.pe_nombreCompleto;
                    profesorInfo.Persona_Info.pe_sexo           = vProfesor.pe_sexo;
                    profesorInfo.Base                           = vProfesor.Base;
                }
                return(profesorInfo);
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                //saca la exceopción controlada a la proxima capa
                throw new Exception(ex.ToString());
            }
        }
コード例 #3
0
        public int Get_si_estaVacaciones(int idempresa, int IdNomina_Tipo, int idempleado, DateTime fechaIni, DateTime fechaFin)
        {
            try
            {
                ro_SolicitudVacaciones_Info Info = new ro_SolicitudVacaciones_Info();
                using (EntitiesRoles Rol = new EntitiesRoles())
                {
                    var Consulta = from q in Rol.vwro_Solicitud_Vacaciones_x_empleado
                                   where q.IdEmpresa == idempresa &&
                                   q.IdNomina_Tipo == IdNomina_Tipo &&
                                   q.IdEmpleado == idempleado &&
                                   q.Fecha_Hasta > fechaIni


                                   select q;

                    if (Consulta.Count() == 0)
                    {
                        return(0);
                    }
                    else
                    {
                        return(Consulta.Sum(v => v.Dias_a_disfrutar));
                    }
                }
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #4
0
 public bool ModificarDB(ba_CatalogoTipo_info info)
 {
     try
     {
         EntitiesBanco context   = new EntitiesBanco();
         var           contenido = context.ba_CatalogoTipo.FirstOrDefault(var => var.IdTipoCatalogo == info.IdTipoCatalogo);
         if (contenido != null)
         {
             contenido.tc_Descripcion = info.tc_descripcion;
             context.SaveChanges();
         }
         return(true);
     }
     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);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #5
0
        public Boolean Pago_Decimo_XIII(int IdPeriodo_Ini, int IdPeriodo_Fin)
        {
            try
            {
                using (EntitiesRoles base_ = new EntitiesRoles())
                {
                    string query = "exec  spRo_Calcula_Pago_XIII " + IdPeriodo_Ini + " , " + IdPeriodo_Fin;
                    base_.Database.ExecuteSqlCommand(query);



                    return(true);
                }
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #6
0
        public Boolean EliminarDB(int idEmpresa, int IdNomina_Tipo, decimal idEmpleado, decimal idNovedad)
        {
            try
            {
                using (EntitiesRoles db = new EntitiesRoles())
                {
                    db.Database.ExecuteSqlCommand("delete from dbo.ro_empleado_novedad_det where IdEmpresa =" + idEmpresa.ToString()
                                                  + " AND IdNovedad=" + idNovedad.ToString()
                                                  + " AND IdEmpleado=" + idEmpleado.ToString()
                                                  );
                }

                return(true);
            }
            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());
            }
        }
        public List <fa_tarifario_facturacion_x_cliente_Por_comision_Info> Get_List_Tarifarios_Porcentaje_Ganancia(int idempresa, decimal idtarifario)
        {
            try
            {
                List <fa_tarifario_facturacion_x_cliente_Por_comision_Info> lista = new List <fa_tarifario_facturacion_x_cliente_Por_comision_Info>();
                using (Entity_Facturacion_FJ model = new Entity_Facturacion_FJ())
                {
                    var query = from q in model.fa_tarifario_facturacion_x_cliente_Por_comision
                                where q.IdEmpresa == idempresa &&
                                q.IdTarifario == idtarifario
                                select q;

                    foreach (var item in query)
                    {
                        fa_tarifario_facturacion_x_cliente_Por_comision_Info info = new fa_tarifario_facturacion_x_cliente_Por_comision_Info();
                        info.IdEmpresa    = item.IdEmpresa;
                        info.IdTarifario  = item.IdTarifario;
                        info.IdAnio       = item.IdAnio;
                        info.porcentaje   = item.porcentaje;
                        info.Fecha_Fin    = item.Fecha_Fin;
                        info.Fecha_inicio = item.Fecha_inicio;
                        lista.Add(info);
                    }
                    return(lista);
                }
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
                MensajeError = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
コード例 #8
0
        public Boolean GuardarDB(ref prod_ProgramaProd_Info Info)
        {
            try
            {
                List <prod_ProgramaProd_Info> Lst = new List <prod_ProgramaProd_Info>();
                using (EntitiesProduccion Context = new EntitiesProduccion())
                {
                    var Address = new prod_ProgramaProd();

                    Address.IdEmpresa   = Info.IdEmpresa;
                    Info.IdProgramaProd = Address.IdProgramaProd = getId(Info.IdEmpresa, Info.IdProgramaProd);
                    Address.IdTurno     = Info.IdTurno;
                    Address.Fecha       = Info.Fecha;
                    Address.IdProducto  = Info.IdProducto;
                    Address.IdCategoria = Info.IdCategoria;
                    Address.Unidad      = Info.Unidad;
                    Address.Peso        = Info.Peso;
                    Address.Toneladas   = Info.Toneladas;
                    Address.Pedidos     = Info.Pedidos;
                    Address.Estado      = "A";

                    Context.prod_ProgramaProd.Add(Address);
                    Context.SaveChanges();
                }
                return(true);
            }
            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.ToString() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
コード例 #9
0
        } // haac 14/01/2014

        public ro_periodo_x_ro_Nomina_TipoLiqui_Info ObtenerPeriodoDespues(int IdEmpresa, int IdPeriodo, int IdNomina_Tipo, int IdNomina_TipoLiqui)
        {
            try
            {
                using (EntitiesRoles entity = new EntitiesRoles())
                {
                    spRo_ObtenerPeriodoDespues_Result q = entity.spRo_ObtenerPeriodoDespues(IdEmpresa, IdPeriodo, IdNomina_Tipo, IdNomina_TipoLiqui).First();

                    return(new ro_periodo_x_ro_Nomina_TipoLiqui_Info()
                    {
                        IdEmpresa = q.IdEmpresa, IdNomina_Tipo = q.IdNomina_Tipo, IdNomina_TipoLiqui = q.IdNomina_TipoLiqui, IdPeriodo = q.IdPeriodo, Cerrado = q.Cerrado, Procesado = q.Procesado
                    });
                }
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        } // haac 14/0
コード例 #10
0
        public List <ro_Cuentas_contables_x_empleado_Info> Get_List_Cuentas_contables_x_empleados(int IdEmpresa, decimal IdEmpleado)
        {
            List <ro_Cuentas_contables_x_empleado_Info> Lst = new List <ro_Cuentas_contables_x_empleado_Info>();

            try
            {
                EntitiesRoles oEnti = new EntitiesRoles();
                var           Query = from q in oEnti.ro_Cuentas_contables_x_empleado
                                      where q.IdEmpresa == IdEmpresa &&
                                      q.IdEmpleado == IdEmpleado
                                      select q;

                foreach (var item in Query)
                {
                    ro_Cuentas_contables_x_empleado_Info Obj = new ro_Cuentas_contables_x_empleado_Info();
                    Obj.IdEmpresa           = item.IdEmpresa;
                    Obj.IdEmpleado          = item.IdEmpleado;
                    Obj.IdRubro             = item.IdRubro;
                    Obj.IdCtaCble           = item.IdCtaCble;
                    Obj.IdPunto_cargo       = item.IdPunto_cargo;
                    Obj.IdPunto_cargo_grupo = item.IdPunto_cargo_grupo;

                    Lst.Add(Obj);
                }
                return(Lst);
            }
            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());
            }
        }
コード例 #11
0
        public cp_proveedor_Autorizacion_Info Get_Info_proveedor_Autorizacion(int Iempresa, decimal Iproveedor, decimal iAutorizacion)
        {
            try
            {
                EntitiesCuentasxPagar          db  = new EntitiesCuentasxPagar();
                cp_proveedor_Autorizacion_Info dat = new cp_proveedor_Autorizacion_Info();
                var select_ = from T in db.cp_proveedor_Autorizacion
                              where T.IdEmpresa == Iempresa && T.IdProveedor == Iproveedor && T.IdAutorizacion == iAutorizacion

                              select T;

                foreach (var item in select_)
                {
                    dat.IdEmpresa               = item.IdEmpresa;
                    dat.IdProveedor             = item.IdProveedor;
                    dat.IdAutorizacion          = item.IdAutorizacion;
                    dat.Serie1                  = item.Serie1;
                    dat.Serie2                  = item.Serie2;
                    dat.nAutorizacion           = item.nAutorizacion;
                    dat.Valido_Hasta            = item.Valido_Hasta;
                    dat.factura_inicial         = item.factura_inicial;
                    dat.factura_final           = item.factura_final;
                    dat.NumAutorizacionImprenta = item.NumAutorizacionImprenta;
                }
                return(dat);
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #12
0
        public Boolean GrabarDB(ro_nomina_tipo_liqui_orden_Info item, ref string msg)
        {
            try
            {
                ro_nomina_tipo_liqui_orden info = new ro_nomina_tipo_liqui_orden();

                using (EntitiesRoles db = new EntitiesRoles()){
                    info.IdEmpresa         = item.IdEmpresa;
                    info.IdNominaTipo      = item.IdNominaTipo;
                    info.IdNominaTipoLiqui = item.IdNominaTipoLiqui;
                    info.Orden             = item.Orden;
                    info.IdRubro           = item.IdRubro;
                    info.Descripcion       = item.Descripcion;
                    info.Formula           = item.Formula;
                    info.EsVisible         = item.EsVisible;
                    info.FechaIngresa      = item.FechaIngresa;
                    info.UsuarioIngresa    = item.UsuarioIngresa;
                    info.FechaModifica     = item.FechaModifica;
                    info.UsuarioModifica   = item.UsuarioModifica;

                    db.ro_nomina_tipo_liqui_orden.Add(info);
                    db.SaveChanges();
                }

                return(true);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #13
0
        public bool procesar(ro_fectividad_Entrega_servicio_Info info)
        {
            try
            {
                info.Observacion = " ";
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var Entity = db.ro_fectividad_Entrega_servicio.FirstOrDefault(v => v.IdEmpresa == info.IdEmpresa &&
                                                                                  v.IdNomina_Tipo == info.IdNomina_Tipo &&
                                                                                  v.IdNomina_tipo_Liq == info.IdNomina_tipo_Liq &&
                                                                                  v.IdPeriodo == info.IdPeriodo &&
                                                                                  v.Estado == true);
                    if (Entity == null)
                    {
                        info.IdNivelServicio = getId(info.IdEmpresa);
                    }
                    else
                    {
                        info.IdNivelServicio = Entity.IdNivelServicio;
                    }
                    db.spro_calculo_nivel_servicio(info.IdEmpresa, info.IdNomina_Tipo, info.IdNomina_tipo_Liq, info.IdPeriodo,
                                                   info.IdNivelServicio, info.Observacion, info.IdUsuario);

                    return(true);
                }
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
                MensajeError = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
コード例 #14
0
        public Boolean VericarCodigoExiste(string codigo, ref string mensaje)
        {
            try
            {
                Boolean Existe;

                string scodigo;

                scodigo = codigo.Trim();
                mensaje = "";
                Existe  = false;

                EntitiesCuentasxPagar B = new EntitiesCuentasxPagar();

                var select_ = from t in B.cp_TipoDocumento
                              where t.CodTipoDocumento == scodigo
                              select t;

                foreach (var item in select_)
                {
                    mensaje = mensaje + " " + item.Descripcion;
                    Existe  = true;
                }

                return(Existe);
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #15
0
ファイル: ba_tipo_nota_Data.cs プロジェクト: arocajorge/ERPFJ
        private Int32 GetId(int IdEmpresa)
        {
            try
            {
                Int32         secuencia;
                EntitiesBanco base_ = new EntitiesBanco();

                var q = from C in base_.ba_tipo_nota
                        where C.IdEmpresa == IdEmpresa
                        select C;

                if (q.ToList().Count < 1)
                {
                    return(1);
                }
                else
                {
                    base_ = new EntitiesBanco();
                    var select_ = (from T in base_.ba_tipo_nota
                                   where T.IdEmpresa == IdEmpresa
                                   select T.IdTipoNota).Max();
                    secuencia = Convert.ToInt32(select_.ToString()) + 1;
                    return(secuencia);
                }
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #16
0
        }//CJimenez 15.01.14

        public Boolean ActualizarContabilizacion(int IdEmpresa, int IdNomina_Tipo, int IdNomina_TipoLiqui, int IdPeriodo)
        {
            try
            {
                using (EntitiesRoles context = new EntitiesRoles())
                {
                    var contact = context.ro_periodo_x_ro_Nomina_TipoLiqui.First(minfo => minfo.IdEmpresa == IdEmpresa && minfo.IdPeriodo == IdPeriodo &&
                                                                                 minfo.IdNomina_Tipo == IdNomina_Tipo && minfo.IdNomina_TipoLiqui == IdNomina_TipoLiqui);

                    contact.Contabilizado = "S";
                    context.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }//CJimenez 15.01.14
コード例 #17
0
        public decimal get_Valor_Novedad_Periodo(int idEmpresa, int idNomina, int idNominaLiqui, int IdEmpleado, DateTime fechaIni, DateTime fechaFin)
        {
            try
            {
                decimal valor = 0;

                using (EntitiesRoles db = new EntitiesRoles())
                {
                    var sresult = from a in db.vwro_Empleado_Novedades
                                  where a.IdEmpresa == idEmpresa &&
                                  ((a.FechaPago >= fechaIni) &&
                                   (a.FechaPago <= fechaFin)) &&
                                  a.IdNomina_Tipo == idNomina &&
                                  a.IdNomina_TipoLiqui == idNominaLiqui &&
                                  a.Estado_det == "A" &&
                                  a.EstadoCobro == "PEN" &&
                                  a.IdEmpleado == IdEmpleado
                                  select a;

                    if (sresult.Count() > 0)
                    {
                        valor = (decimal)sresult.Sum(v => v.Valor);
                    }
                }
                return(valor);
            }
            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());
            }
        }
コード例 #18
0
        public int GetId(int IdEmpresa, ref string mensaje)
        {
            try
            {
                int Id;
                EntitiesCompras_Edehsa OEProd = new EntitiesCompras_Edehsa();
                var select = from q in OEProd.com_ListadoMaterialesDisponibles
                             where q.IdEmpresa == IdEmpresa

                             select q;

                if (select.ToList().Count == 0)
                {
                    Id = 1;
                }
                else
                {
                    var select_pv = (from q in OEProd.com_ListadoMaterialesDisponibles
                                     where q.IdEmpresa == IdEmpresa

                                     select q.IdListadoMaterialesDisponibles).Max();
                    Id = Convert.ToInt32(select_pv.ToString()) + 1;
                }
                return(Id);
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #19
0
ファイル: ct_Grupocble_Data.cs プロジェクト: arocajorge/ERPFJ
        public List <ct_Grupocble_Info> Get_list_Grupocble()
        {
            try
            {
                List <ct_Grupocble_Info> lM = new List <ct_Grupocble_Info>();
                EntitiesDBConta          OEGrupocble_Info = new EntitiesDBConta();
                var selectGrupocble = from C in OEGrupocble_Info.ct_grupocble

                                      select C;

                foreach (var item in selectGrupocble)
                {
                    ct_Grupocble_Info Cbt = new ct_Grupocble_Info();
                    Cbt.IdGrupoCble          = item.IdGrupoCble;
                    Cbt.gc_GrupoCble         = item.gc_GrupoCble;
                    Cbt.gc_Orden             = Convert.ToInt32(item.gc_Orden);
                    Cbt.gc_estado_financiero = item.gc_estado_financiero;
                    Cbt.gc_signo_operacion   = Convert.ToInt32(item.gc_signo_operacion);
                    Cbt.Estado = item.Estado;
                    lM.Add(Cbt);
                }

                return(lM);
            }

            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
コード例 #20
0
 public Boolean ModificarDB(List <fa_VendedorxSucursal_Info> lista_antigua, List <fa_VendedorxSucursal_Info> lista_nueva, ref string msg)
 {
     try
     {
         foreach (var item in lista_antigua)
         {
             EliminarDB(item, ref msg);
         }
         foreach (var item1 in lista_nueva)
         {
             GrabarDB(item1, ref msg);
         }
         return(true);
     }
     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);
         msg = ex.ToString();
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
         throw new Exception(ex.ToString());
     }
 }
コード例 #21
0
        public int GetIdgrupo(int idempresa, string idcategoria, int idlinea)
        {
            try
            {
                int IdGrupo = 0;
                EntitiesInventario OEGrupo = new EntitiesInventario();

                var selecte = OEGrupo.in_grupo.Count(q => q.IdEmpresa == idempresa && q.IdCategoria == idcategoria && q.IdLinea == idlinea);

                if (selecte == 0)
                {
                    IdGrupo = 1;
                }
                else
                {
                    OEGrupo = new EntitiesInventario();
                    var selectGrupo = (from grupo in OEGrupo.in_grupo
                                       where grupo.IdEmpresa == idempresa &&
                                       grupo.IdCategoria == idcategoria &&
                                       grupo.IdLinea == idlinea
                                       select grupo.IdGrupo).Max();
                    IdGrupo = Convert.ToInt32(selectGrupo.ToString()) + 1;
                }
                return(IdGrupo);
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #22
0
        public bool GrabarDB(Aca_Paralelo_Info info, ref int idParalelo, ref string mensaje)
        {
            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    Aca_Paralelo addressPara = new Aca_Paralelo();
                    idParalelo                       = GetId(info.IdInstitucion);
                    addressPara.IdParalelo           = idParalelo;
                    addressPara.Descripcion_paralelo = info.DescripcionParalelo;
                    addressPara.CodParalelo          = (info.CodParalelo == "0" || string.IsNullOrEmpty(info.CodParalelo) == true) ? idParalelo.ToString() : info.CodParalelo;
                    addressPara.CodAlterno           = string.IsNullOrEmpty(info.CodAlterno) ? "" : info.CodAlterno;
                    addressPara.IdCurso              = info.IdCurso;
                    addressPara.Estado               = info.Estado;
                    addressPara.FechaCreacion        = DateTime.Now;
                    addressPara.FechaModificacion    = DateTime.Now;
                    addressPara.UsuarioCreacion      = info.UsuarioCreacion;
                    addressPara.UsuarioModificacion  = info.UsuarioModificacion;

                    Base.Aca_Paralelo.Add(addressPara);
                    Base.SaveChanges();
                    mensaje = "Se ha procedido a grabar la Jornada #: " + idParalelo.ToString() + " exitosamente.";
                }
                return(true);
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #23
0
        public Boolean PROCESAR1x1(int IDempresa, int IDproceso, int IDperiodo, decimal IDEmpleado, int IDtipo_nomina)
        {
            try
            {
                using (EntitiesRoles base_ = new EntitiesRoles())
                {
                    string query = "exec  spRo_procesa_Rol " + IDempresa + " , " + IDEmpleado + ","
                                   + IDEmpleado + ", " + IDtipo_nomina + "," + IDproceso + ","
                                   + IDperiodo;
                    base_.Database.ExecuteSqlCommand(query);

                    return(true);
                }
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #24
0
 public Boolean GuardarDB(cxc_Cobro_Tipo_x_Anticipo_Info Info)
 {
     try
     {
         EntitiesCuentas_x_Cobrar context = new EntitiesCuentas_x_Cobrar();
         var address = new cxc_cobro_tipo_x_anticipo();
         address.IdEmpresa    = Info.IdEmpresa;
         address.IdCobro_tipo = Info.IdCobro_tipo;
         address.posicion     = (int)Info.posicion;
         context.cxc_cobro_tipo_x_anticipo.Add(address);
         context.SaveChanges();
         return(true);
     }
     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);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.InnerException + " " + ex.Message;
         throw new Exception(ex.InnerException.ToString());
     }
 }
コード例 #25
0
        public bool ModificiarDB_CbteCierre(ct_anio_fiscal_x_cuenta_utilidad_Info Info, ref string mensaje)
        {
            try
            {
                Boolean res = false;
                using (EntitiesDBConta Context = new EntitiesDBConta())
                {
                    ct_anio_fiscal_x_cuenta_utilidad contact = Context.ct_anio_fiscal_x_cuenta_utilidad.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdanioFiscal == Info.IdanioFiscal);
                    if (contact != null)
                    {
                        contact.IdEmpresa_cbte_cierre  = Info.IdEmpresa_cbte_cierre;
                        contact.IdTipoCbte_cbte_cierre = Info.IdTipoCbte_cbte_cierre;
                        contact.IdCbteCble_cbte_cierre = Info.IdCbteCble_cbte_cierre;

                        Context.SaveChanges();
                        res = true;
                    }

                    if (contact == null) // no esta el año fiscal
                    {
                        GuardarDB(Info, ref mensaje);
                        res = true;
                    }
                }
                return(res);
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
コード例 #26
0
 public bool Guardar_DB(ro_Grupo_empleado_Info info, ref int idgrupo)
 {
     try
     {
         using (EntityRoles_FJ db = new EntityRoles_FJ())
         {
             ro_Grupo_empleado add = new ro_Grupo_empleado();
             add.IdEmpresa                  = info.IdEmpresa;
             add.IdGrupo                    = GetId(info.IdEmpresa);
             add.Nombre_Grupo               = info.Nombre_Grupo;
             add.IdRubro_Alim               = info.IdRubro_Alim;
             add.IdRubro_Trans              = info.IdRubro_Trans;
             add.Valor_Alimen               = info.Valor_Alimen;
             add.Valor_Transp               = info.Valor_Transp;
             add.Max_num_horas_sab_dom      = info.Max_num_horas_sab_dom;
             add.Calculo_Horas_extras_Sobre = info.Calculo_Horas_extras_Sobre;
             add.Valor_bono                 = info.Valor_bono;
             add.IdUsuario                  = info.IdUsuario;
             add.Fecha_Transac              = DateTime.Now;
             add.Estado = "A";
             db.ro_Grupo_empleado.Add(add);
             db.SaveChanges();
             idgrupo = add.IdGrupo;
             return(true);
         }
     }
     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);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
         MensajeError = ex.ToString();
         throw new Exception(ex.ToString());
     }
 }
コード例 #27
0
        public Boolean getExisteFecha(int idEmpresa, decimal idEmpleado, DateTime fecha)
        {
            try
            {
                Boolean valorRetornar = false;

                using (EntitiesRoles db = new EntitiesRoles())
                {
                    var cont = (from q in db.ro_Solicitud_Vacaciones_x_empleado
                                where q.IdEmpresa == idEmpresa && q.IdEmpleado == idEmpleado && q.Estado == "A"
                                //&& (new[] { "Pendiente, Aprobado" }.Contains(q.IdEstadoAprobacion.Trim()))
                                && ((fecha >= q.Fecha_Desde) && (fecha <= q.Fecha_Hasta))
                                select q).Count();

                    if (cont > 0)
                    {
                        valorRetornar = true;
                    }
                    else
                    {
                        valorRetornar = false;
                    }

                    return(valorRetornar);
                }
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #28
0
        public List <ro_empleado_x_ro_rubro_Info> Get_List_empleado_x_ro_rubro_x_Empleado(int IdEmpresa, decimal IdEmpleado)
        {
            List <ro_empleado_x_ro_rubro_Info> Lst = new List <ro_empleado_x_ro_rubro_Info>();
            EntitiesRoles db = new EntitiesRoles();

            try
            {
                var datos = from a in db.ro_empleado_x_ro_rubro
                            where a.IdEmpresa == IdEmpresa && a.IdEmpleado == IdEmpleado
                            select a;

                foreach (var item in datos)
                {
                    ro_empleado_x_ro_rubro_Info Obj = new ro_empleado_x_ro_rubro_Info();
                    Obj.IdEmpresa          = item.IdEmpresa;
                    Obj.IdNomina_Tipo      = item.IdNomina_Tipo;
                    Obj.IdNomina_TipoLiqui = item.IdNomina_TipoLiqui;
                    Obj.IdEmpleado         = item.IdEmpleado;
                    Obj.IdRubro            = item.IdRubro;
                    Obj.Valor = item.Valor;

                    Lst.Add(Obj);
                }

                return(Lst);
            }
            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());
            }
        }
コード例 #29
0
        public int GetId(int IdEmpresa, int IdActivoFijoTipo)
        {
            try
            {
                int Id;
                EntitiesActivoFijo OEPActivoFijo = new EntitiesActivoFijo();
                var select = from q in OEPActivoFijo.Af_Activo_fijo_Categoria
                             where q.IdEmpresa == IdEmpresa
                             //&& q.IdActivoFijoTipo == IdActivoFijoTipo
                             select q;

                if (select.ToList().Count < 1)
                {
                    Id = 1;
                }
                else
                {
                    EntitiesActivoFijo OEPActivoFijoTipo = new EntitiesActivoFijo();
                    var select_pv = (from q in OEPActivoFijoTipo.Af_Activo_fijo_Categoria
                                     where q.IdEmpresa == IdEmpresa
                                     //      && q.IdActivoFijoTipo == IdActivoFijoTipo
                                     select q.IdCategoriaAF).Max();
                    Id = Convert.ToInt32(select_pv.ToString()) + 1;
                }
                return(Id);
            }
            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());
            }
        }
コード例 #30
0
 public bool Eliminar_OrdenPagoCancelaciones_List(List <cp_orden_pago_cancelaciones_Info> Lst, int Id, ref string mensaje)
 {
     try
     {
         foreach (var Item in Lst)
         {
             using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
             {
                 Context.Database.ExecuteSqlCommand("delete cp_orden_pago_cancelaciones where IdEmpresa = " + Item.IdEmpresa + " and Idcancelacion = " + Item.Idcancelacion);
             }
         }
         return(true);
     }
     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);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }