コード例 #1
0
        public bool modificarDB(imp_liquidacion_Info info)
        {
            try
            {
                using (Entities_importacion Context = new Entities_importacion())
                {
                    imp_liquidacion Entity = Context.imp_liquidacion.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdLiquidacion == info.IdLiquidacion);
                    if (Entity != null)
                    {
                        Entity.li_num_documento     = info.li_num_documento;
                        Entity.li_codigo            = info.li_codigo;
                        Entity.li_num_DAU           = info.li_num_DAU;
                        Entity.li_fecha             = info.li_fecha;
                        Entity.li_observacion       = info.li_observacion;
                        Entity.li_factor_conversion = info.li_factor_conversion;
                        Entity.li_total_fob         = info.li_total_fob;
                        Entity.li_total_gastos      = info.li_total_gastos;
                        Entity.li_total_bodega      = info.li_total_bodega;
                        Entity.li_factor_costo      = info.li_factor_costo;
                        Context.SaveChanges();
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                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();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
コード例 #2
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());
            }
        }
コード例 #3
0
        public ro_Config_Rubros_x_empleado_Info Get_Info_Config_Rubros(string IdRubro)
        {
            EntitiesRoles oEnti = new EntitiesRoles();
            ro_Config_Rubros_x_empleado_Info Info = new ro_Config_Rubros_x_empleado_Info();

            try
            {
                var Objeto = oEnti.ro_Config_Rubros_x_empleado.First(var => var.IdRubro == IdRubro);
                Info.IdEmpresa = Objeto.IdEmpresa;
                Info.OrdenPres = Objeto.OrdenPres;
                Info.Estado    = Objeto.Estado;

                return(Info);
            }
            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 int GetId(int idempresa)
        {
            try
            {
                int Id;
                EntitiesActivoFijo OEPActivoFijo = new EntitiesActivoFijo();
                var select = from q in OEPActivoFijo.Af_Encargado
                             where q.IdEmpresa == idempresa
                             select q;

                if (select.ToList().Count < 1)
                {
                    Id = 1;
                }
                else
                {
                    EntitiesActivoFijo OEPActivoFijoTipo = new EntitiesActivoFijo();
                    var select_pv = (from q in OEPActivoFijoTipo.Af_Encargado
                                     where q.IdEmpresa == idempresa
                                     select q.IdEncargado).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.InnerException.ToString());
            }
        }
コード例 #5
0
        public Boolean ModificarDB(cp_orden_pago_estado_aprob_Info Info)
        {
            try
            {
                EntitiesCuentasxPagar context = new EntitiesCuentasxPagar();

                var address = context.cp_orden_pago_estado_aprob.FirstOrDefault(var => var.IdEstadoAprobacion == Info.IdEstadoAprobacion);
                if (address != null)
                {
                    address.Descripcion = Info.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());
            }
        }
コード例 #6
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());
            }
        }
コード例 #7
0
        public decimal get_id(int IdEmpresa)
        {
            try
            {
                decimal ID = 0;

                using (EntitiesActivoFijo Context = new EntitiesActivoFijo())
                {
                    var lst = from q in Context.Af_ruta
                              where q.IdEmpresa == IdEmpresa
                              select q;

                    if (lst.Count() == 0)
                    {
                        ID = 1;
                    }
                    else
                    {
                        ID = lst.Max(q => q.IdRuta) + 1;
                    }
                }

                return(ID);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                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 excepción controlada a la proxima capa
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #8
0
        public bool Anular_DB(ro_fectividad_Entrega_x_Periodo_Empleado_Info info)
        {
            try
            {
                if (info.IdServicioTipo == 1)
                {
                    info.IdCalendario = info.IdPeriodo.ToString() + "VB";
                }
                else
                {
                    info.IdCalendario = info.IdPeriodo.ToString() + "VA";
                }

                return(data.Anular_DB(info));
            }
            catch (Exception ex)
            {
                mensaje = ex.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(), "", mensaje, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(mensaje);
            }
        }
コード例 #9
0
        public decimal Get_id(int IdEmpresa)
        {
            try
            {
                decimal ID = 0;

                using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
                {
                    var lst = from q in Context.cp_cuotas_x_doc
                              where q.IdEmpresa == IdEmpresa
                              select q;

                    if (lst.Count() == 0)
                    {
                        ID = 1;
                    }
                    else
                    {
                        ID = lst.Max(q => q.IdCuota) + 1;
                    }
                }

                return(ID);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                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());
            }
        }
        public ro_Calculo_Pago_Variable_Porcentaje_servicio_Info get_info(int IdEmpresa, int IdTipo_Nomina, int IdTipoServicio)
        {
            try
            {
                ro_Calculo_Pago_Variable_Porcentaje_servicio_Info Info = new ro_Calculo_Pago_Variable_Porcentaje_servicio_Info();
                using (EntityRoles_FJ Context = new EntityRoles_FJ())
                {
                    var contact = from q in Context.ro_Calculo_Pago_Variable_Porcentaje_servicio
                                  where q.IdEmpresa == IdEmpresa &&
                                  q.IdTipo_Nomina == IdTipo_Nomina &&
                                  q.IdTipoServicio == IdTipoServicio
                                  select q;

                    foreach (var item in contact)
                    {
                        Info.IdEmpresa      = item.IdEmpresa;
                        Info.IdTipo_Nomina  = item.IdTipo_Nomina;
                        Info.IdEfectividad  = item.IdEfectividad;
                        Info.IdTipoServicio = item.IdTipoServicio;
                        Info.Efec_desde     = item.Efec_desde;
                        Info.Efec_hasta     = item.Efec_hasta;
                        Info.Efec_aplica    = item.Efec_aplica;
                    }
                }
                return(Info);
            }
            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.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #11
0
 public decimal GetId(ref string mensaje)
 {
     try
     {
         decimal id = 0;
         using (EntitiesCuentas_x_Cobrar cxc = new EntitiesCuentas_x_Cobrar())
         {
             var cons = from q in cxc.cxc_cobro_x_Anticipo
                        select q;
             id = cons.ToList().Count + 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.InnerException.ToString());
     }
 }
コード例 #12
0
        public bool Eliminar_OrdenPago(int IdEmpresa, decimal IdOrdenPago, ref string mensaje)
        {
            try
            {
                using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
                {
                    Context.Database.ExecuteSqlCommand("delete cp_orden_pago_det where IdEmpresa = " + IdEmpresa + " and IdOrdenPago = " + IdOrdenPago);

                    Context.Database.ExecuteSqlCommand("delete cp_orden_pago where IdEmpresa = " + IdEmpresa + " and IdOrdenPago = " + IdOrdenPago);
                }

                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());
            }
        }
コード例 #13
0
        public Boolean GuardarDB(cxc_cobro_tipo_x_cobros_Docxc_Info Info)
        {
            try
            {
                EntitiesCuentas_x_Cobrar context = new EntitiesCuentas_x_Cobrar();
                var address = new cxc_cobro_tipo_x_cobros_Docxc();
                address.IdCobro_tipo = Info.IdCobro_tipo;
                address.Posicion     = Info.Posicion;
                context.cxc_cobro_tipo_x_cobros_Docxc.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());
            }
        }
コード例 #14
0
        public List <imp_Embarcador_Info> Get_List_Embarcador()
        {
            List <imp_Embarcador_Info> lst  = new List <imp_Embarcador_Info>();
            EntitiesImportacion        oEnt = new EntitiesImportacion();

            try
            {
                var select = from q in oEnt.imp_Embarcador
                             select q;
                foreach (var item in select)
                {
                    imp_Embarcador_Info info = new imp_Embarcador_Info();
                    info.IdEmpresa      = item.IdEmpresa;
                    info.IdEmbarcador   = item.IdEmbarcador;
                    info.em_descripcion = item.em_descripcion.Trim();;
                    info.em_direccion   = item.em_direccion;
                    info.em_telefono    = item.em_telefono;
                    info.em_contacto    = item.em_contacto;
                    info.em_email       = item.em_email;
                    info.Estado         = item.Estado;

                    lst.Add(info);
                }
                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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #15
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());
            }
        }
コード例 #16
0
        public com_ListadoMateriales_Det_x_com_GenerOCompra_Det_Info Get_Info_ListadoMateriales_Det_x_com_GenerOCompra_Det(com_ListadoMateriales_Det_Info Info, ref string msg)
        {
            com_ListadoMateriales_Det_x_com_GenerOCompra_Det_Info info = new com_ListadoMateriales_Det_x_com_GenerOCompra_Det_Info();
            EntitiesCompras oEnti = new EntitiesCompras();

            try
            {
                var select = from A in oEnti.com_ListadoMateriales_Det_x_com_GenerOCompra_Det
                             where A.go_IdEmpresa == Info.IdEmpresa &&
                             A.go_IdTransaccion == Info.IdTransaccion &&
                             A.go_IdDetTrans == Info.IdDetTrans
                             select A;

                foreach (var item in select)
                {
                    info.go_IdEmpresa           = item.go_IdEmpresa;
                    info.go_IdTransaccion       = item.go_IdTransaccion;
                    info.go_IdDetTrans          = item.go_IdDetTrans;
                    info.lm_IdEmpresa           = item.lm_IdEmpresa;
                    info.lm_IdListadoMateriales = item.lm_IdListadoMateriales;
                    info.lm_IdDetalle           = item.lm_IdDetalle;
                }
                return(info);
            }
            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;
                msg     = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
コード例 #17
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());
     }
 }
コード例 #18
0
        public bool GrabarDB(Aca_Jornada_Info info, ref int idJornada, ref string mensaje)
        {
            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    Aca_Jornada addressJor = new Aca_Jornada();
                    addressJor.IdSede              = info.IdSede == null ? 0 : Convert.ToInt32(info.IdSede);
                    idJornada                      = GetId();
                    addressJor.IdJornada           = idJornada;
                    addressJor.Descripcion_Jor     = info.DescripcionJornada;
                    addressJor.CodJornada          = (info.CodJornada == "0" || string.IsNullOrEmpty(info.CodJornada) == true) ? idJornada.ToString() : info.CodJornada;
                    addressJor.CodAlternoJor       = string.IsNullOrEmpty(info.CodAternoJornada)?"":info.CodAternoJornada;
                    addressJor.estado              = info.Estado;
                    addressJor.FechaCreacion       = DateTime.Now;
                    addressJor.FechaModificacion   = DateTime.Now;
                    addressJor.UsuarioCreacion     = info.UsuarioCreacion;
                    addressJor.UsuarioModificacion = info.UsuarioModificacion;

                    Base.Aca_Jornada.Add(addressJor);
                    Base.SaveChanges();
                    mensaje = "Se ha procedido a grabar la Jornada #: " + idJornada.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());
            }
        }
コード例 #19
0
// haac 09/01/2014
        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());
            }
        }// haac 09/01/2014
コード例 #20
0
        public List <prod_LiquidacionChatarraDetalle_Info> Get_List_LiquidacionChatarraDetalle()
        {
            List <prod_LiquidacionChatarraDetalle_Info> Lst = new List <prod_LiquidacionChatarraDetalle_Info>();
            EntitiesProduccion oEnti = new EntitiesProduccion();

            try
            {
                var Query = from q in oEnti.prod_LiquidacionChatarraDetalle
                            select q;
                foreach (var item in Query)
                {
                    prod_LiquidacionChatarraDetalle_Info Obj = new prod_LiquidacionChatarraDetalle_Info();
                    Obj.IdEmpresa           = item.IdEmpresa;
                    Obj.IdLiquidacion       = item.IdLiquidacion;
                    Obj.Secuencia           = item.Secuencia;
                    Obj.LLeno               = item.LLeno;
                    Obj.Vacio               = item.Vacio;
                    Obj.Merma               = item.Merma;
                    Obj.Neta                = item.Neta;
                    Obj.fecha_pesaje_lleno  = item.fecha_pesaje_lleno;
                    Obj.fecha_pesaje_vacion = item.fecha_pesaje_vacion;
                    Obj.Placa               = item.Placa;
                    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.ToString() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
コード例 #21
0
        public Boolean ModificarDB(int IdEmpresa, decimal IdOrdenPago, int secuencia)
        {
            try
            {
                EntitiesCuentasxPagar context = new EntitiesCuentasxPagar();
                var address = context.cp_orden_pago_det.FirstOrDefault(var => var.IdOrdenPago == IdOrdenPago && var.IdEmpresa == IdEmpresa && var.Secuencia == secuencia);
                if (address != null)
                {
                    address.IdEmpresa_cxp  = null;
                    address.IdCbteCble_cxp = null;
                    address.IdTipoCbte_cxp = null;
                    context.SaveChanges();

                    //Si la op tiene cuotas y es anulada entonces la cuota queda libre nuevamente
                    var Entity = context.cp_cuotas_x_doc_det.FirstOrDefault(q => q.IdEmpresa_op == IdEmpresa && q.IdOrdenPago == IdOrdenPago && q.Secuencia_op == secuencia);
                    if (Entity != null)
                    {
                        Entity.IdEmpresa_op = null;
                        Entity.IdOrdenPago  = null;
                        Entity.Secuencia_op = null;
                        Entity.Estado       = false;
                        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());
            }
        }
コード例 #22
0
 public Boolean GuardarDB(List <fa_notaCreDeb_x_fa_factura_NotaDeb_Info> Lista)
 {
     try
     {
         int sec = 1;
         foreach (var item in Lista)
         {
             item.secuencia = sec;
             GuardarDB(item);
             sec++;
         }
         return(true);
     }
     catch (Exception ex)
     {
         string mensaje = "";
         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();
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.ToString());
     }
 }
コード例 #23
0
 public Boolean GuardarDB(List <fa_pre_facturacion_det_gasto_mano_obra_Info> Lista)
 {
     try
     {
         foreach (var item in Lista)
         {
             using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ())
             {
                 Context.SaveChanges();
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         string MensajeError = "";
         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());
     }
 }
コード例 #24
0
        public bool guardarDB(imp_parametro_Info info)
        {
            try
            {
                using (Entities_importacion Context = new Entities_importacion())
                {
                    imp_parametro Entity = Context.imp_parametro.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa);
                    if (Entity == null)
                    {
                        Entity           = new imp_parametro();
                        Entity.IdEmpresa = info.IdEmpresa;
                        Entity.IdTipoCbte_liquidacion     = info.IdTipoCbte_liquidacion;
                        Entity.IdTipoCbte_liquidacion_anu = info.IdTipoCbte_liquidacion_anu;
                        Context.imp_parametro.Add(Entity);
                    }
                    else
                    {
                        Entity.IdTipoCbte_liquidacion     = info.IdTipoCbte_liquidacion;
                        Entity.IdTipoCbte_liquidacion_anu = info.IdTipoCbte_liquidacion_anu;
                    }
                    Context.SaveChanges();
                }

                return(true);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                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();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
コード例 #25
0
        public List <fa_guia_remision_det_Info> Get_List_guia_remision_det(int IdEmpresa, int IdSucursal, int IdBodega, decimal IdGuiaRemision)
        {
            try
            {
                List <fa_guia_remision_det_Info> lst = new List <fa_guia_remision_det_Info>();
                EntitiesFacturacion oentities        = new EntitiesFacturacion();
                var consulta = from q in oentities.vwfa_guia_remision_det
                               where q.IdEmpresa == IdEmpresa &&
                               q.IdSucursal == IdSucursal &&
                               q.IdBodega == IdBodega &&
                               q.IdGuiaRemision == IdGuiaRemision
                               select q;

                foreach (var item in consulta)
                {
                    fa_guia_remision_det_Info temp = new fa_guia_remision_det_Info();
                    temp.Secuencia        = item.Secuencia;
                    temp.IdProducto       = item.IdProducto;
                    temp.gi_cantidad      = item.gi_cantidad;
                    temp.gi_detallexItems = item.gi_detallexItems;
                    temp.pr_codigo        = item.pr_codigo;
                    temp.pr_descripcion   = item.pr_descripcion;
                    lst.Add(temp);
                }
                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.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
コード例 #26
0
        public decimal GetId(int IdEmpresa, int IdSucursal)
        {
            decimal id = 0;

            try
            {
                List <fa_venta_telefonica_Info> lst     = new List <fa_venta_telefonica_Info>();
                EntitiesFacturacion             context = new EntitiesFacturacion();


                var selecte = context.fa_venta_telefonica.Count(q => q.IdEmpresa == IdEmpresa && q.IdSucursal == IdSucursal);
                if (selecte == 0)
                {
                    id = 1;
                }
                else
                {
                    context = new EntitiesFacturacion();
                    var select = (from q in context.fa_venta_telefonica
                                  where q.IdEmpresa == IdEmpresa &&
                                  q.IdSucursal == IdSucursal
                                  select q.IdVenta_tel).Max();
                    id = Convert.ToDecimal(select.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.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
コード例 #27
0
 public Boolean GrabarDB(List <ct_Cbtecble_det_Info> lista, ref string MensajeError)
 {
     try
     {
         foreach (var item in lista)
         {
             if (!GrabarDB(item, ref MensajeError))
             {
                 return(false);
             }
         }
         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());
     }
 }
コード例 #28
0
        public List <ro_tabla_Impu_Renta_Info> Get_List_tabla_Impu_Renta(int anio)
        {
            List <ro_tabla_Impu_Renta_Info> Lst = new List <ro_tabla_Impu_Renta_Info>();

            try
            {
                using (EntitiesRoles rol = new EntitiesRoles())
                {
                    var consultar = from q in rol.ro_tabla_Impu_Renta
                                    where q.AnioFiscal == anio
                                    orderby q.Secuencia
                                    select q;
                    foreach (var item in consultar)
                    {
                        ro_tabla_Impu_Renta_Info info = new ro_tabla_Impu_Renta_Info();
                        info.AnioFiscal           = item.AnioFiscal;
                        info.Secuencia            = item.Secuencia;
                        info.FraccionBasica       = Convert.ToDouble(item.FraccionBasica);
                        info.ExcesoHasta          = Convert.ToDouble(item.ExcesoHasta);
                        info.ImpFraccionBasica    = Convert.ToDouble(item.ImpFraccionBasica);
                        info.Por_ImpFraccion_Exce = Convert.ToDouble(item.Por_ImpFraccion_Exce);
                        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());
            }
        }
コード例 #29
0
        public Boolean ModificarDB(ro_Config_Rubros_x_empleado_Info info)
        {
            try
            {
                using (EntitiesRoles context = new EntitiesRoles())
                {
                    var contact = context.ro_Config_Rubros_x_empleado.First(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdRubro == info.IdRubro);
                    contact.OrdenPres = info.OrdenPres;
                    contact.Estado    = info.Estado;

                    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.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #30
0
        public bool ActualizarDB(Aca_Sede_Info info, ref string mensaje)
        {
            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    var vSede = Base.Aca_Sede.FirstOrDefault(j => j.IdInstitucion == info.IdInstitucion && j.IdSede == info.IdSede);

                    if (vSede != null)
                    {
                        vSede.CodSede             = string.IsNullOrEmpty(info.CodSede) ? info.IdSede.ToString() : info.CodSede.Trim();
                        vSede.CodAlterno          = string.IsNullOrEmpty(info.CodAlterno) ? "" : info.CodAlterno.Trim();
                        vSede.Descripcion_sede    = info.DescripcionSede.Trim();
                        vSede.estado              = info.Estado.Trim();
                        vSede.FechaModificacion   = DateTime.Now;
                        vSede.UsuarioModificacion = info.UsuarioModificacion;
                        vSede.IdEmpresa           = info.IdEmpresa;
                        vSede.IdSucursal          = info.IdSucursal;

                        Base.SaveChanges();
                        mensaje = "Se ha procedido actualizar la Sede #: " + info.IdSede.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.InnerException.ToString());
            }
        }