Esempio n. 1
0
        public List <in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info> Get_List_Info_in_subgrupo_no_parametrizados(int IdEmpresa, DateTime Fecha_ini, DateTime Fecha_fin)
        {
            try
            {
                try
                {
                    List <in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info> Listdat_ = new List <in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info>();
                    Fecha_ini = Fecha_ini.Date;
                    Fecha_fin = Fecha_fin.Date;
                    using (EntitiesInventario Context = new EntitiesInventario())
                    {
                        Context.SetCommandTimeOut(5000);
                        var lst = Context.spINV_relaciones_no_parametrizadas(IdEmpresa, Fecha_ini, Fecha_fin).ToList();
                        foreach (var q in lst)
                        {
                            Listdat_.Add(new in_subgrupo_x_CentroCosto_x_SubCentroCosto_x_CtaCble_Info
                            {
                                IdEmpresa     = q.IdEmpresa,
                                IdCategoria   = q.IdCategoria,
                                nom_categoria = q.ca_Categoria,
                                IdLinea       = q.IdLinea,
                                nom_linea     = q.nom_linea,
                                IdGrupo       = q.IdGrupo,
                                nom_grupo     = q.nom_grupo,
                                IdSubgrupo    = q.IdSubGrupo,
                                nom_subgrupo  = q.nom_subgrupo,

                                IdCentroCosto        = q.IdCentroCosto,
                                nom_centro_costo     = q.Centro_costo,
                                IdSub_centro_costo   = q.IdCentroCosto_sub_centro_costo,
                                nom_sub_centro_costo = q.NomSubcentro,

                                IdCtaCble = null,
                            });
                        }
                    }
                    return(Listdat_);
                }
                catch (DbEntityValidationException 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;
                    mensaje = "Error al Grabar" + ex.Message;
                    throw new Exception(ex.ToString());
                }
            }
            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);
            }
        }