Ejemplo n.º 1
0
        public Boolean VerificacionAsociacionGuiaVStransferencia(int IdEmpresa_Guia, int IdSucursal_Guia, int IdBodega_Guia, decimal IdGuiaRemision)
        {
            try
            {
                using (EntitiesInventario oen = new EntitiesInventario())
                {
                    in_transferencia_x_fa_guia_remision cus = new in_transferencia_x_fa_guia_remision();
                    IQueryable <in_transferencia_x_fa_guia_remision> Consulta = from q in oen.in_transferencia_x_fa_guia_remision
                                                                                where q.IdGuiaRemision == IdGuiaRemision && q.IdEmpresa_Guia == IdEmpresa_Guia &&
                                                                                q.IdSucursal_Guia == IdSucursal_Guia && q.IdBodega_Guia == IdBodega_Guia
                                                                                select q;

                    if (Consulta.Count() == 0)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            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(mensaje);
            }
        }
Ejemplo n.º 2
0
        public Boolean GuardarDB(in_transferencia_x_fa_guia_remision_Info Info)
        {
            try
            {
                List <in_transferencia_x_fa_guia_remision_Info> Lst = new List <in_transferencia_x_fa_guia_remision_Info>();
                using (EntitiesInventario Context = new EntitiesInventario())
                {
                    var Address = new in_transferencia_x_fa_guia_remision();

                    Address.IdEmpresa        = Info.IdEmpresa;
                    Address.IdSucursalOrigen = Info.IdSucursalOrigen;
                    Address.IdBodegaOrigen   = Info.IdBodegaOrigen;
                    Address.IdTransferencia  = Info.IdTransferencia;
                    Address.IdEmpresa_Guia   = Info.IdEmpresa_Guia;
                    Address.IdSucursal_Guia  = Info.IdSucursal_Guia;
                    Address.IdBodega_Guia    = Info.IdBodega_Guia;
                    Address.IdGuiaRemision   = Info.IdGuiaRemision;
                    Address.Obser            = Info.Obser;

                    Context.in_transferencia_x_fa_guia_remision.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.ToString() + " " + ex.Message;
                throw new Exception(mensaje);
            }
        }