public prod_CompraChatarra_CusTalme_x__in_movi_inven_Info Get_Info_CompraChatarra_CusTalme_x__in_movi_inve(int IdEmpresa, decimal IdLiquidacion)
        {
            EntitiesProduccion oEnti = new EntitiesProduccion();
            prod_CompraChatarra_CusTalme_x__in_movi_inven_Info Info = new prod_CompraChatarra_CusTalme_x__in_movi_inven_Info();

            try
            {
                var Objeto = oEnti.prod_CompraChatarra_CusTalme_x__in_movi_inven.First(var => var.IdEmpresa == IdEmpresa && var.IdLiquidacion == IdLiquidacion);
                Info.IdEmpresa            = Objeto.IdEmpresa;
                Info.IdLiquidacion        = Objeto.IdLiquidacion;
                Info.mv_IdEmpresa         = Objeto.mv_IdEmpresa;
                Info.mv_IdSucursal        = Objeto.mv_IdSucursal;
                Info.mv_IdBodega          = Objeto.mv_IdBodega;
                Info.mv_IdMovi_inven_tipo = Objeto.mv_IdMovi_inven_tipo;
                Info.mv_IdNumMovi         = Objeto.mv_IdNumMovi;
                Info.None = Objeto.None;
                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.ToString() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
Beispiel #2
0
 public Boolean ValidarClave(int IdEmpresa, string Clave, int IdModeloProduccion)
 {
     try
     {
         using (EntitiesProduccion entities = new EntitiesProduccion())
         {
             string Query    = "select * from prod_Clave_Autorizacion where IdEmpresa =" + IdEmpresa + " and IdModeloProduccion = " + IdModeloProduccion + " and Clave = '" + Clave + "' and Activo = 'A'";
             var    Consulta = entities.Database.SqlQuery <prod_Clave_Autorizacion_Info>(Query).ToList().First();
             if (Consulta.Activo == "A")
             {
                 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);
         mensaje = ex.ToString() + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.ToString());
     }
 }
        public Boolean GuardarDB(prod_CompraChatarra_CusTalme_x__in_movi_inven_Info Info)
        {
            try
            {
                List <prod_CompraChatarra_CusTalme_x__in_movi_inven_Info> Lst = new List <prod_CompraChatarra_CusTalme_x__in_movi_inven_Info>();
                using (EntitiesProduccion Context = new EntitiesProduccion())
                {
                    var Address = new prod_CompraChatarra_CusTalme_x__in_movi_inven();

                    Address.IdEmpresa            = Info.IdEmpresa;
                    Address.IdLiquidacion        = Info.IdLiquidacion;
                    Address.mv_IdEmpresa         = Info.mv_IdEmpresa;
                    Address.mv_IdSucursal        = Info.mv_IdSucursal;
                    Address.mv_IdBodega          = Info.mv_IdBodega;
                    Address.mv_IdMovi_inven_tipo = Info.mv_IdMovi_inven_tipo;
                    Address.mv_IdNumMovi         = Info.mv_IdNumMovi;
                    Address.None = Info.None;

                    Context.prod_CompraChatarra_CusTalme_x__in_movi_inven.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());
            }
        }
 public prod_Parametro_Info ConsultaGeneral(int IdEmpresa)
 {
     try
     {
         EntitiesProduccion oEnti = new EntitiesProduccion();
         var item = oEnti.prod_Parametro.First(var => var.IdEmpresa == IdEmpresa);
         prod_Parametro_Info Obj = new prod_Parametro_Info();
         Obj.IdEmpresa             = item.IdEmpresa;
         Obj.IdSucursal_IngxProduc = item.IdSucursal_IngxProduc;
         Obj.IdBodega_IngxProduc   = item.IdBodega_IngxProduc;
         Obj.IdMovi_inven_tipo_x_IngxProduc_ProdTermi = item.IdMovi_inven_tipo_x_IngxProduc_ProdTermi;
         Obj.IdMovi_inven_tipo_x_EgrxProduc_MatPri    = item.IdMovi_inven_tipo_x_EgrxProduc_MatPri;
         Obj.IdCargo_JefeTurno                          = item.IdCargo_JefeTurno;
         Obj.IdBodega_EgrxMateriaPrima                  = item.IdBodega_EgrxMateriaPrima;
         Obj.IdSucursal_EgrxMateriaPrima                = item.IdSucursal_EgrxMateriaPrima;
         Obj.IdMovi_inven_tipo_x_IngCompraChatarra      = item.IdMovi_inven_tipo_x_IngCompraChatarra;
         Obj.IdMovi_inven_tipo_x_IngXProdAceriaProdTerm = item.IdMovi_inven_tipo_x_IngXProdAceriaProdTerm;
         Obj.IdProducto_ChatarraIngreso                 = item.IdProducto_ChatarraIngreso;
         return(Obj);
     }
     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());
     }
 }
 public Boolean VerificarExiste(prod_ProgramaProd_Info info, ref string msg)
 {
     try
     {
         using (EntitiesProduccion oEnt = new EntitiesProduccion())
         {
             var reg = from C in oEnt.prod_ProgramaProd
                       where C.IdProducto == info.IdProducto &&
                       C.IdTurno == info.IdTurno
                       select C;
             foreach (var item in reg)
             {
                 if (Convert.ToDateTime(item.Fecha).ToShortDateString() == Convert.ToDateTime(info.Fecha).ToShortDateString())
                 {
                     msg = "Consulta correcta"; return(true);
                 }
             }
             msg = "Consulta correcta";
             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;
         msg     = "Ocurrio un error" + ex.ToString();
         return(false);
     }
 }
Beispiel #6
0
        public List <prod_horno_CusTalme_Info> Get_List_horno_CusTalme()
        {
            List <prod_horno_CusTalme_Info> Lst = new List <prod_horno_CusTalme_Info>();
            EntitiesProduccion oEnti            = new EntitiesProduccion();

            try
            {
                var Query = from q in oEnti.prod_horno_CusTalme
                            select q;
                foreach (var item in Query)
                {
                    prod_horno_CusTalme_Info Obj = new prod_horno_CusTalme_Info();
                    Obj.IdHorno     = item.IdHorno;
                    Obj.descripcion = item.descripcion;
                    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());
            }
        }
Beispiel #7
0
        public List <prod_TipoParada_CusTalme_Info> ObtenerLista()
        {
            List <prod_TipoParada_CusTalme_Info> lista = new List <prod_TipoParada_CusTalme_Info>();

            try
            {
                using (EntitiesProduccion Oent = new EntitiesProduccion())
                {
                    var SQL = from q in Oent.prod_TipoParada_CusTalme
                              where q.Estado == "A"
                              select q;
                    foreach (var item in SQL)
                    {
                        prod_TipoParada_CusTalme_Info obj = new prod_TipoParada_CusTalme_Info();
                        obj.Descripcion  = item.Descripcion;
                        obj.IdTipoParada = item.IdTipoParada;
                        obj.Estado       = item.Estado;

                        lista.Add(obj);
                    }
                }
                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);
                mensaje = ex.ToString() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
 public Boolean AnularDB(prod_ProgramaProd_Info info)
 {
     try
     {
         using (EntitiesProduccion context = new EntitiesProduccion())
         {
             var contact = context.prod_ProgramaProd.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdProgramaProd == info.IdProgramaProd);
             if (contact != null)
             {
                 contact.Estado = "I";
                 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;
         return(false);
     }
 }
        public int getId(int IdEmpresa, int IdPrograma)
        {
            try
            {
                int Id;
                EntitiesProduccion OEProduccion = new EntitiesProduccion();
                var select = from q in OEProduccion.prod_ProgramaProd
                             where q.IdEmpresa == IdEmpresa && q.IdProgramaProd == IdPrograma
                             select q;

                if (select.ToList().Count() == 0)
                {
                    Id = 1;
                }
                else
                {
                    var select_em = (from q in OEProduccion.prod_ProgramaProd
                                     select q.IdProgramaProd).Max();
                    Id = Convert.ToInt32(select_em.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.ToString() + " " + ex.Message;
                return(0);
            }
        }
 public Boolean ModificarDB(prod_ProgramaProd_Info info)
 {
     try
     {
         using (EntitiesProduccion context = new EntitiesProduccion())
         {
             var contact = context.prod_ProgramaProd.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdProgramaProd == info.IdProgramaProd);
             if (contact != null)
             {
                 contact.IdTurno     = info.IdTurno;
                 contact.Fecha       = info.Fecha;
                 contact.IdProducto  = info.IdProducto;
                 contact.IdCategoria = info.IdCategoria;
                 contact.Unidad      = info.Unidad;
                 contact.Peso        = info.Peso;
                 contact.Toneladas   = info.Toneladas;
                 contact.Pedidos     = info.Pedidos;
                 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;
         return(false);
     }
 }
        public Boolean GuardarDB(prod_ModeloProduccion_x_Producto_CusTal_Info Info, ref String Mensaje)
        {
            try
            {
                List <prod_ModeloProduccion_x_Producto_CusTal_Info> Lst = new List <prod_ModeloProduccion_x_Producto_CusTal_Info>();
                using (EntitiesProduccion Context = new EntitiesProduccion())
                {
                    var Address = new prod_ModeloProduccion_x_Producto_CusTal();

                    Address.IdEmpresa    = Info.IdEmpresa;
                    Address.IdModeloProd = Info.IdModeloProd;
                    Address.IdProducto   = Info.IdProducto;
                    Address.Tipo         = Info.Tipo;

                    Context.prod_ModeloProduccion_x_Producto_CusTal.Add(Address);
                    Context.SaveChanges();
                    Mensaje = "Guardado Ok";
                }
                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());
            }
        }
        public List <prod_CompraChatarra_CusTalme_x__in_movi_inven_Info> Get_List_CompraChatarra_CusTalme_x__in_movi_inve()
        {
            List <prod_CompraChatarra_CusTalme_x__in_movi_inven_Info> Lst = new List <prod_CompraChatarra_CusTalme_x__in_movi_inven_Info>();
            EntitiesProduccion oEnti = new EntitiesProduccion();

            try
            {
                var Query = from q in oEnti.prod_CompraChatarra_CusTalme_x__in_movi_inven
                            select q;
                foreach (var item in Query)
                {
                    prod_CompraChatarra_CusTalme_x__in_movi_inven_Info Obj = new prod_CompraChatarra_CusTalme_x__in_movi_inven_Info();
                    Obj.IdEmpresa            = item.IdEmpresa;
                    Obj.IdLiquidacion        = item.IdLiquidacion;
                    Obj.mv_IdEmpresa         = item.mv_IdEmpresa;
                    Obj.mv_IdSucursal        = item.mv_IdSucursal;
                    Obj.mv_IdBodega          = item.mv_IdBodega;
                    Obj.mv_IdMovi_inven_tipo = item.mv_IdMovi_inven_tipo;
                    Obj.mv_IdNumMovi         = item.mv_IdNumMovi;
                    Obj.None = item.None;
                    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());
            }
        }
Beispiel #13
0
        public Boolean GuardarDB(prod_GestionProductivaTechos_CusTalme_X_in_movi_inve_Info Info, ref string Men)
        {
            try
            {
                using (EntitiesProduccion Context = new EntitiesProduccion())
                {
                    var Address = new prod_GestionProductivaTechos_CusTalme_X_in_movi_inve();

                    Address.IdBodega            = Info.IdBodega;
                    Address.IdEmpresa           = Info.IdEmpresa;
                    Address.IdGestionProductiva = Info.IdGestionProductiva;
                    Address.IdMovi_inven_tipo   = Info.IdMovi_inven_tipo;
                    Address.IdNumMovi           = Info.IdNumMovi;
                    Address.IdSucursal          = Info.IdSucursal;
                    Address.prod_IdEmpresa      = Info.prod_IdEmpresa;
                    Address.sec = null;

                    Context.prod_GestionProductivaTechos_CusTalme_X_in_movi_inve.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());
            }
        }
        public List <prod_GestionProductivaTechos_CusTalme_Detalle_Info> Get_List_GestionProductivaTechos_CusTalme_Detall(int Idempresa, decimal Idgestion)
        {
            List <prod_GestionProductivaTechos_CusTalme_Detalle_Info> Lst = new List <prod_GestionProductivaTechos_CusTalme_Detalle_Info>();
            EntitiesProduccion oEnti = new EntitiesProduccion();

            try
            {
                var Query = from q in oEnti.prod_GestionProductivaTechos_CusTalme_Detalle
                            where q.IdEmpresa == Idempresa && q.IdGestionProductiva == Idgestion
                            select q;
                foreach (var item in Query)
                {
                    prod_GestionProductivaTechos_CusTalme_Detalle_Info Obj = new prod_GestionProductivaTechos_CusTalme_Detalle_Info();
                    Obj.IdEmpresa           = item.IdEmpresa;
                    Obj.IdGestionProductiva = item.IdGestionProductiva;
                    Obj.Secuencia           = item.Secuencia;
                    Obj.Prod_IdProducto     = Convert.ToDecimal(item.Prod_IdProducto);
                    Obj.Prod_Largo          = Convert.ToDouble(item.Prod_Largo);
                    Obj.Prod_Ancho          = Convert.ToDouble(item.Prod_Ancho);
                    Obj.Prod_PsoEsp         = Convert.ToDouble(item.Prod_PsoEsp);
                    Obj.Prod_Espesor        = Convert.ToDouble(item.Prod_Espesor);
                    Obj.Prod_PsoUnd         = Convert.ToDouble(item.Prod_PsoUnd);
                    Obj.Prducc_Unidades     = Convert.ToDouble(item.Prducc_Unidades);
                    Obj.Prducc_Kg           = Convert.ToDouble(item.Prducc_Kg);
                    Obj.Segunda_IdProducto  = Convert.ToDecimal(item.Segunda_IdProducto);
                    Obj.Segunda_Unidades    = Convert.ToDouble(item.Segunda_Unidades);
                    Obj.Segunda_Kg          = Convert.ToDouble(item.Segunda_Kg);
                    Obj.Chatarra_Kg         = Convert.ToDouble(item.Chatarra_Kg);
                    Obj.Peso                  = Convert.ToDouble(item.Peso);
                    Obj.Kg_Desp               = Convert.ToDouble(item.Kg_Desp);
                    Obj.Rend_Metalico         = Convert.ToDouble(item.Rend_Metalico);
                    Obj.KW                    = Convert.ToDouble(item.KW);
                    Obj.Tiempo_Preparacion    = item.Tiempo_Preparacion;
                    Obj.Tiempo_Produccion     = item.Tiempo_Produccion;
                    Obj.Tiempo_Total          = item.Tiempo_Total;
                    Obj.Parada_Mecanica       = item.Parada_Mecanica;
                    Obj.Parada_Electrico      = item.Parada_Electrico;
                    Obj.Parada_Logistica      = item.Parada_Logistica;
                    Obj.Parada_Otros          = item.Parada_Otros;
                    Obj.TotalParos            = item.TotalParos;
                    Obj.Indicadores_TnHrs     = Convert.ToDouble(item.Indicadores_TnHrs);
                    Obj.Indicadores_TimeParda = Convert.ToDouble(item.Indicadores_TimeParda);
                    Obj.Indicadores_UndsHrs   = Convert.ToDouble(item.Indicadores_UndsHrs);
                    Obj.Indicadores_Calidad   = Convert.ToDouble(item.Indicadores_Calidad);
                    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());
            }
        }
 public Boolean ModificarDB(prod_GestionProductivaLaminado_CusTalme_Info Info)
 {
     try
     {
         using (EntitiesProduccion oEnt = new EntitiesProduccion())
         {
             var Contact = oEnt.prod_GestionProductivaLaminado_CusTalme.First(var => var.IdEmpresa == Info.IdEmpresa && var.IdGestionProductiva == Info.IdGestionProductiva);
             Contact.IdTurno = Info.IdTurno;
             Contact.IdEmpleado_JefeTurno   = Info.IdEmpleado_JefeTurno;
             Contact.Id_Bobina              = Info.Id_Bobina;
             Contact.Num_Orden              = Info.Num_Orden;
             Contact.kg_Cargados            = Info.kg_Cargados;
             Contact.kg_producidos          = Info.kg_producidos;
             Contact.kg_retazo_porcen       = Info.kg_retazo_porcen;
             Contact.kg_retazo_valor        = Info.kg_retazo_valor;
             Contact.kg_chatarra_porcen     = Info.kg_chatarra_porcen;
             Contact.kg_chatarra_valor      = Info.kg_chatarra_valor;
             Contact.kg_oxidacion_porcen    = Info.kg_oxidacion_porcen;
             Contact.kg_oxidacion_valor     = Info.kg_oxidacion_valor;
             Contact.rendi_metal_historico  = Info.rendi_metal_historico;
             Contact.rendi_metal_real       = Info.rendi_metal_real;
             Contact.rendi_metal_Diferencia = Info.rendi_metal_Diferencia;
             Contact.consumo_kilowatios     = Info.consumo_kilowatios;
             Contact.consumo_galones        = Info.consumo_galones;
             Contact.cambio_prue_programado = Info.cambio_prue_programado;
             Contact.cambio_prue_real       = Info.cambio_prue_real;
             Contact.cambio_prue_porcentaje = Info.cambio_prue_porcentaje;
             Contact.hora_turno_ini         = Info.hora_turno_ini;
             Contact.hora_turno_fin         = Info.hora_turno_fin;
             Contact.hora_jornada           = Info.hora_jornada;
             Contact.hora_productiva        = Info.hora_productiva;
             Contact.hora_Paros             = Info.hora_Paros;
             Contact.hora_Neta              = Info.hora_Neta;
             Contact.hora_Hrs_Maquina       = Info.hora_Hrs_Maquina;
             Contact.Ton_Programada         = Info.Ton_Programada;
             Contact.Ton_real             = Info.Ton_real;
             Contact.Ton_Eficiencia       = Info.Ton_Eficiencia;
             Contact.Ton_TnHrNeta         = Info.Ton_TnHrNeta;
             Contact.Ton_kwTon            = Info.Ton_kwTon;
             Contact.Ton_GlsTon           = Info.Ton_GlsTon;
             Contact.EficienciaProduccion = Info.EficienciaProduccion;
             Contact.Fecha = Info.Fecha;
             oEnt.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());
     }
 }
        public Boolean GuardarDB(prod_GestionProductivaTechos_CusTalme_Cab_Info Info, ref decimal Id)
        {
            try
            {
                List <prod_GestionProductivaTechos_CusTalme_Cab_Info> Lst = new List <prod_GestionProductivaTechos_CusTalme_Cab_Info>();
                using (EntitiesProduccion Context = new EntitiesProduccion())
                {
                    var Address = new prod_GestionProductivaTechos_CusTalme_Cab();

                    Address.IdEmpresa               = Info.IdEmpresa;
                    Address.IdGestionProductiva     = Id = GetId(Info.IdEmpresa);
                    Address.IdProducto_MateriaPrima = Info.IdProducto_MateriaPrima;
                    Address.Fecha        = Info.Fecha;
                    Address.IdModeloProd = Info.IdModeloProd;
                    Address.HrsTurno     = Info.HrsTurno;
                    Address.Tprep        = Info.Tprep;
                    Address.Despacho     = Info.Despacho;
                    Address.Factor       = Info.Factor;
                    Address.Num_Personas = Info.Num_Personas;
                    Address.Consumo      = Info.Consumo;
                    Address.Chatarra     = Info.Chatarra;
                    Address.IdTurno      = Info.IdTurno;

                    Address.ip               = Info.ip;
                    Address.Fecha_Transac    = Info.Fecha_Transac;
                    Address.nom_pc           = Info.nom_pc;
                    Address.IdUsuarioUltModi = Info.IdUsuarioUltModi;
                    Address.Fecha_UltMod     = Info.Fecha_UltMod;
                    Address.Estado           = "A";

                    Info.ListaDetalle.ForEach(var => { var.IdGestionProductiva = Address.IdGestionProductiva; var.IdEmpresa = Address.IdEmpresa; });

                    Context.prod_GestionProductivaTechos_CusTalme_Cab.Add(Address);
                    Context.SaveChanges();

                    if (dataDetalle.GuardarDB(Info.ListaDetalle))
                    {
                        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);
                mensaje = ex.ToString() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
Beispiel #17
0
        public Boolean GuardarDB(prod_CompraChatarra_CusTalme_Info Info, ref decimal IdLiquidacion, ref string Mensaje)
        {
            try
            {
                List <prod_CompraChatarra_CusTalme_Info> Lst = new List <prod_CompraChatarra_CusTalme_Info>();
                using (EntitiesProduccion Context = new EntitiesProduccion())
                {
                    var Address = new prod_CompraChatarra_CusTalme();

                    Address.IdEmpresa         = Info.IdEmpresa;
                    Address.IdLiquidacion     = IdLiquidacion = GetId(Info.IdEmpresa);
                    Address.IdProveedor_Presu = Info.IdProveedor_Presu;
                    Address.IdProveedor       = Info.IdProveedor;
                    Address.Fecha             = Info.Fecha;
                    Address.Beneficiario      = Info.Beneficiario;
                    Address.Placa             = Info.Placa;
                    Address.IdTipoChatarra    = Info.IdTipoChatarra;
                    Address.PrecioChatarra    = Info.PrecioChatarra;
                    Address.TLlenoKg          = Info.TLlenoKg;
                    Address.TVacionKg         = Info.TVacionKg;
                    Address.TMermaKg          = Info.TMermaKg;
                    Address.TNetokg           = Info.TNetokg;
                    Address.Subtotal          = Info.Subtotal;
                    Address.Descuento         = Info.Descuento;
                    Address.Total             = Info.Total;
                    Address.IdUsuario         = Info.IdUsuario;
                    Address.IdUsuarioUltMod   = Info.IdUsuario;
                    Address.Fecha_Transa      = Info.Fecha_Transaccion;
                    Address.Fecha_UltMod      = Info.Fecha_UltMod;
                    Address.ip     = Info.ip;
                    Info.nom_pc    = Info.nom_pc;
                    Address.Estado = "A";

                    Context.prod_CompraChatarra_CusTalme.Add(Address);
                    Context.SaveChanges();

                    Mensaje = "Registro # " + IdLiquidacion + " Ingresado Correctamente";
                }
                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());
            }
        }
Beispiel #18
0
 public List <prd_PuenteGrua_Info> ListadoPuenteGrua(int IdEmpresa)
 {
     try
     {
         List <prd_PuenteGrua_Info> L_PuentesGruas = new List <prd_PuenteGrua_Info>();
         EntitiesProduccion         OEEtapa        = new EntitiesProduccion();
         var registros = from A in OEEtapa.prod_PuenteGrua
                         where A.idEmpresa == IdEmpresa
                         orderby A.idPuenteGrua
                         select A;
         prd_PuenteGrua_Info info = new prd_PuenteGrua_Info();
         foreach (var item in registros)
         {
             info                  = new prd_PuenteGrua_Info();
             info.idEmpresa        = item.idEmpresa;
             info.Idsucural        = item.Idsucural;
             info.idPuenteGrua     = item.idPuenteGrua;
             info.nombre           = item.nombre;
             info.marca            = item.marca;
             info.tonelada_Soporta = Convert.ToInt32(item.tonelada_Soporta);
             info.IdUsuario        = item.IdUsuario;
             info.IdOperador       = Convert.ToInt32(item.IdOperador);
             info.Fecha_Transac    = item.Fecha_Transac;
             info.IdUsuarioUltMod  = item.IdUsuarioUltMod;
             info.Fecha_UltMod     = Convert.ToDateTime(item.Fecha_UltMod);
             info.IdUsuarioUltAnu  = item.IdUsuarioUltAnu;
             info.Fecha_UltAnu     = Convert.ToDateTime(item.Fecha_UltAnu);
             info.nom_pc           = item.nom_pc;
             info.ip               = item.ip;
             info.MotiAnula        = item.MotiAnula;
             info.estado           = item.estado;
             L_PuentesGruas.Add(info);
         }
         return(L_PuentesGruas);
     }
     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());
     }
 }
 public List <prod_ModeloProduccion_x_Producto_CusTal_Info> ConsultarXModeloDeProduccion(int IdEmpresa, int IdModeloProd)
 {
     try
     {
         EntitiesProduccion Oent  = new EntitiesProduccion();
         string             Query = "select * from prod_ModeloProduccion_x_Producto_CusTal where idEmpresa = " + IdEmpresa + " and IdModeloProd = " + IdModeloProd;
         return(Oent.Database.SqlQuery <prod_ModeloProduccion_x_Producto_CusTal_Info>(Query).ToList());
     }
     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());
     }
 }
        public void EjecutarSpReporte(int IdEmpresa, decimal IdGestion, string IdUsuario, string nom_Pc)
        {
            try
            {
                EntitiesProduccion oEntities = new EntitiesProduccion();

                //  oEntities.spProd_Rpt_PRD_CUS_TAL_001(IdEmpresa, IdGestion, nom_Pc, IdUsuario);
            }
            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());
            }
        }
Beispiel #21
0
        public List <prod_CompraChatarra_CusTalme_Info> Get_List_CompraChatarra_CusTalme(int IdEmpresa, DateTime DechaInicial, DateTime FechaFin)
        {
            EntitiesProduccion oEnti = new EntitiesProduccion();

            try
            {
                string Querty = "select * from vwProd_CompraChatarra Where IdEmpresa =" + IdEmpresa + " and Fecha>= '" + DechaInicial.ToString("yyyy/MM/dd") + "' and Fecha <= '" + FechaFin.ToString("yyyy/MM/dd") + "'";
                return(oEnti.Database.SqlQuery <prod_CompraChatarra_CusTalme_Info>(Querty).ToList());
            }
            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());
            }
        }
Beispiel #22
0
 public List <prod_BeneficiarioYProsupuestados_Info> Get_List_BeneficiarioYProsupuestados(int IdEmpresa)
 {
     try
     {
         using (EntitiesProduccion Entities = new EntitiesProduccion())
         {
             string qy = "select * from prod_BeneficiarioYProsupuestados where IdEmpresa = " + IdEmpresa;
             return(Entities.Database.SqlQuery <prod_BeneficiarioYProsupuestados_Info>(qy).ToList());
         }
     }
     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());
     }
 }
Beispiel #23
0
        public Boolean GuardarDB(List <prod_Clave_Autorizacion_Info> Lst, int IdEMpresa)
        {
            try
            {
                int     Secuencia  = 1;
                decimal IdGenerado = GetId(IdEMpresa);
                foreach (var Info in Lst)
                {
                    using (EntitiesProduccion Context = new EntitiesProduccion())
                    {
                        var Address = new prod_Clave_Autorizacion();

                        Address.IdEmpresa          = Info.IdEmpresa;
                        Address.IdGeneracion       = IdGenerado;
                        Address.Secuencia          = Secuencia;
                        Address.IdModeloProduccion = Info.IdModeloProduccion;
                        Address.Clave = Info.Clave;
                        Address.IdUsuarioUsoDeClave = Info.IdUsuarioUsoDeClave;
                        Address.FechaUsoDeClave     = Info.FechaUsoDeClave;
                        Address.IdUsuarioGeneracion = Info.IdUsuarioGeneracion;
                        Address.FechaGeneracion     = Info.FechaGeneracion;
                        Address.IdTransaccion       = Info.IdTransaccion;
                        Address.Activo = "A";
                        Secuencia++;
                        Context.prod_Clave_Autorizacion.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());
            }
        }
Beispiel #24
0
 public Boolean ModificarDB(prd_PuenteGrua_Info info, ref string msg)
 {
     try
     {
         using (EntitiesProduccion context = new EntitiesProduccion())
         {
             var contact = context.prod_PuenteGrua.FirstOrDefault(A => A.idEmpresa == info.idEmpresa && A.Idsucural == info.Idsucural && A.idPuenteGrua == info.idPuenteGrua);
             if (contact != null)
             {
                 //prod_PuenteGrua Address = new prod_PuenteGrua();
                 contact.idEmpresa        = info.idEmpresa;
                 contact.Idsucural        = info.Idsucural;
                 contact.idPuenteGrua     = info.idPuenteGrua;
                 contact.nombre           = info.nombre;
                 contact.marca            = info.marca;
                 contact.tonelada_Soporta = info.tonelada_Soporta;
                 contact.IdUsuario        = info.IdUsuario;
                 contact.ip              = info.ip;
                 contact.nom_pc          = info.nom_pc;
                 contact.Fecha_Transac   = info.Fecha_Transac;
                 contact.estado          = info.estado;
                 contact.IdUsuarioUltMod = info.IdUsuario;
                 contact.IdOperador      = info.IdOperador;
                 contact.Fecha_UltMod    = DateTime.Now;
                 // Context.prod_PuenteGrua.Add(Address);
                 context.SaveChanges();
             }
         }
         // msg = "Se ha procedido actualizar el registro de la Orden de Taller #: " + info.Codigo + " 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);
         msg = ex.ToString() + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
         throw new Exception(ex.ToString());
     }
 }
        public List <prod_ModeloProduccion_CusTalme_Info> Get_List_ModeloProduccion_CusTalme()
        {
            List <prod_ModeloProduccion_CusTalme_Info> Lst = new List <prod_ModeloProduccion_CusTalme_Info>();
            EntitiesProduccion oEnti = new EntitiesProduccion();

            try
            {
                var Query = from q in oEnti.prod_ModeloProduccion_CusTalme
                            select q;
                foreach (var item in Query)
                {
                    prod_ModeloProduccion_CusTalme_Info Obj = new prod_ModeloProduccion_CusTalme_Info();
                    Obj.IdModeloProd = item.IdModeloProd;
                    Obj.Descripcion  = item.Descripcion;
                    Obj.Estado       = item.Estado;
                    Obj.Tipo         = item.Tipo.Trim();

                    Obj.IdSucursal_IngxProduc = item.IdSucursal_IngxProduc;
                    Obj.IdBodega_IngxProduc   = item.IdBodega_IngxProduc;
                    Obj.IdMovi_inven_tipo_x_IngxProduc_ProdTermi = item.IdMovi_inven_tipo_x_IngxProduc_ProdTermi;
                    Obj.IdMovi_inven_tipo_x_EgrxProduc_MatPri    = item.IdMovi_inven_tipo_x_EgrxProduc_MatPri;
                    Obj.IdCargo_JefeTurno           = item.IdCargo_JefeTurno;
                    Obj.IdSucursal_EgrxMateriaPrima = item.IdSucursal_EgrxMateriaPrima;
                    Obj.IdBodega_EgrxMateriaPrima   = item.IdBodega_EgrxMateriaPrima;



                    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());
            }
        }
Beispiel #26
0
 public List <prod_ParametrosPorCampos_Info> Consulta(int IdEmpresa)
 {
     try
     {
         using (EntitiesProduccion Entity = new EntitiesProduccion())
         {
             return((from q in Entity.prod_ParametrosPorCampos where q.IdEmpresa == IdEmpresa select new prod_ParametrosPorCampos_Info {
                 IdEmpresa = q.IdEmpresa, IdProducto = q.IdProducto, NombreLaber = q.NombreLaber, NompreCampo = q.NompreCampo, Secuencia = q.Secuencia, TipoModeloProduccion = q.TipoModeloProduccion
             }).ToList());
         }
     }
     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());
     }
 }
Beispiel #27
0
        public Boolean GuardarDB(prd_Operador_Info info, ref string msg)
        {
            try
            {
                using (EntitiesProduccion Context = new EntitiesProduccion())
                {
                    prod_Operador Address = new prod_Operador();

                    Address.IdOperador      = info.IdOperador;
                    Address.IdEmpleado      = info.IdEmpleado;
                    Address.NomEmpleado     = info.NomEmpleado;
                    Address.IdUsuario       = info.IdUsuario;
                    Address.Fecha_Transac   = DateTime.Now;
                    Address.IdUsuarioUltMod = info.IdUsuarioUltMod;
                    Address.Fecha_UltMod    = null;
                    Address.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                    Address.Fecha_UltAnu    = null;
                    Address.nom_pc          = info.nom_pc;


                    Address.ip        = info.ip;
                    Address.MotiAnula = info.MotiAnula;
                    Address.Estado    = info.Estado;

                    Context.prod_Operador.Add(Address);
                    Context.SaveChanges();
                }
                msg = "Grabación exitosa..";
                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() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
                throw new Exception(ex.ToString());
            }
        }
Beispiel #28
0
 public List <prd_Operador_Info> ListadoOperadores()
 {
     try
     {
         List <prd_Operador_Info> ListadoOperadores = new List <prd_Operador_Info>();
         EntitiesProduccion       OEEtapa           = new EntitiesProduccion();
         var registros = from A in OEEtapa.prod_Operador
                         select A;
         prd_Operador_Info info = new prd_Operador_Info();
         foreach (var item in registros)
         {
             info                 = new prd_Operador_Info();
             info.IdOperador      = item.IdOperador;
             info.IdEmpleado      = item.IdEmpleado;
             info.NomEmpleado     = item.NomEmpleado;
             info.IdUsuario       = item.IdUsuario;
             info.Fecha_Transac   = item.Fecha_Transac;
             info.IdUsuarioUltMod = item.IdUsuarioUltMod;
             info.Fecha_UltMod    = Convert.ToDateTime(item.Fecha_UltMod);
             info.IdUsuarioUltAnu = item.IdUsuarioUltAnu;
             info.Fecha_UltAnu    = Convert.ToDateTime(item.Fecha_UltAnu);
             info.nom_pc          = item.nom_pc;
             info.ip              = item.ip;
             info.MotiAnula       = item.MotiAnula;
             info.Estado          = item.Estado;
             ListadoOperadores.Add(info);
         }
         return(ListadoOperadores);
     }
     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());
     }
 }
Beispiel #29
0
 public Boolean ModificarDB(prd_Operador_Info info, ref string msg)
 {
     try
     {
         using (EntitiesProduccion context = new EntitiesProduccion())
         {
             var Address = context.prod_Operador.FirstOrDefault(A => A.IdOperador == info.IdOperador && A.IdEmpleado == info.IdEmpleado);
             if (Address != null)
             {
                 Address.IdOperador      = info.IdOperador;
                 Address.IdEmpleado      = info.IdEmpleado;
                 Address.NomEmpleado     = info.NomEmpleado;
                 Address.IdUsuario       = info.IdUsuario;
                 Address.Fecha_Transac   = info.Fecha_Transac;
                 Address.IdUsuarioUltMod = info.IdUsuario;
                 Address.Fecha_UltMod    = DateTime.Now;
                 Address.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                 Address.Fecha_UltAnu    = null;
                 Address.nom_pc          = info.nom_pc;
                 Address.ip        = info.ip;
                 Address.MotiAnula = info.MotiAnula;
                 Address.Estado    = info.Estado;
                 // Context.prod_Operador.Add(Address);
                 context.SaveChanges();
             }
         }
         // msg = "Se ha procedido actualizar el registro de la Orden de Taller #: " + info.Codigo + " 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);
         msg = ex.ToString() + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
         throw new Exception(ex.ToString());
     }
 }
Beispiel #30
0
        public Boolean GuardarDB(List <prod_LiquidacionChatarraDetalle_Info> Lst)
        {
            try
            {
                int sec = 1;
                foreach (var Info  in Lst)
                {
                    using (EntitiesProduccion Context = new EntitiesProduccion())
                    {
                        var Address = new prod_LiquidacionChatarraDetalle();

                        Address.IdEmpresa           = Info.IdEmpresa;
                        Address.IdLiquidacion       = Info.IdLiquidacion;
                        Address.Secuencia           = sec;
                        Address.LLeno               = Info.LLeno;
                        Address.Vacio               = Info.Vacio;
                        Address.Merma               = Info.Merma;
                        Address.Neta                = Info.Neta;
                        Address.fecha_pesaje_lleno  = Info.fecha_pesaje_lleno;
                        Address.fecha_pesaje_vacion = Info.fecha_pesaje_vacion;
                        Address.Placa               = Info.Placa;
                        sec++;
                        Context.prod_LiquidacionChatarraDetalle.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());
            }
        }