Example #1
0
        public void cargaempleados(Cl_Enumeradores.eTipoFiltro tipo)
        {
            try
            {
                ListaEmpleados = new List <ro_Empleado_Info>();
                if (tipo == Cl_Enumeradores.eTipoFiltro.todos)
                {
                    todos.IdEmpleado  = 0;
                    todos.NomCompleto = "Todos";
                    ListaEmpleados.Add(todos);
                    var ListaEmpleadosTemp = busEmp.Obtener_Empleados(param.IdEmpresa);
                    foreach (var item in ListaEmpleadosTemp)
                    {
                        ListaEmpleados.Add(item);
                    }

                    cmbEmpleado.Properties.DataSource = ListaEmpleados;
                    cmbEmpleado.EditValue             = 0;
                }
                else if (tipo == Cl_Enumeradores.eTipoFiltro.Normal)
                {
                    ListaEmpleados = busEmp.Obtener_Empleados(param.IdEmpresa);
                    cmbEmpleado.Properties.DataSource = ListaEmpleados;
                }
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }
Example #2
0
        public List <ct_Cbtecble_tipo_Info> Get_list_Cbtecble_tipo(int IdEmpresa, Cl_Enumeradores.eTipoFiltro TipoFiltro, ref string MensajeError)
        {
            try
            {
                List <ct_Cbtecble_tipo_Info> lM      = new List <ct_Cbtecble_tipo_Info>();
                EntitiesDBConta OECbtecble_tipo_Info = new EntitiesDBConta();
                var             selectCbtecble_tipo  = from C in OECbtecble_tipo_Info.ct_cbtecble_tipo
                                                       where C.IdEmpresa == IdEmpresa
                                                       select C;


                if (TipoFiltro == Cl_Enumeradores.eTipoFiltro.todos)
                {
                    ct_Cbtecble_tipo_Info Cbt1 = new ct_Cbtecble_tipo_Info();
                    Cbt1.IdEmpresa   = IdEmpresa;
                    Cbt1.IdTipoCbte  = 0;
                    Cbt1.CodTipoCbte = "ALL";
                    Cbt1.tc_TipoCbte = "TODOS LOS COMPROBANTES";
                    Cbt1.tc_Estado   = "A";
                    Cbt1.tc_Interno  = "S";
                    Cbt1.tc_Nemonico = "ALL";

                    lM.Add(Cbt1);
                }

                foreach (var item in selectCbtecble_tipo)
                {
                    ct_Cbtecble_tipo_Info Cbt = new ct_Cbtecble_tipo_Info();
                    Cbt.IdEmpresa       = item.IdEmpresa;
                    Cbt.IdTipoCbte      = Convert.ToInt32(item.IdTipoCbte);
                    Cbt.CodTipoCbte     = item.CodTipoCbte.Trim();
                    Cbt.tc_TipoCbte     = item.tc_TipoCbte.Trim();
                    Cbt.tc_TipoCbte2    = "[" + item.CodTipoCbte + "]" + item.tc_TipoCbte.Trim();
                    Cbt.tc_Estado       = item.tc_Estado;
                    Cbt.tc_Interno      = item.tc_Interno;
                    Cbt.tc_Nemonico     = item.tc_Nemonico;
                    Cbt.IdTipoCbte_Anul = item.IdTipoCbte_Anul;
                    Cbt.SEstado         = (item.tc_Estado == "A") ? "ACTIVO" : "*ANULADO*";


                    lM.Add(Cbt);
                }

                return(lM);
            }

            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
                MensajeError = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Example #3
0
        public List <tb_Bodega_Info> Get_List_Bodega(int idempresa, Cl_Enumeradores.eTipoFiltro TipoCarga = Cl_Enumeradores.eTipoFiltro.Normal)
        {
            try
            {
                List <tb_Bodega_Info> lM        = new List <tb_Bodega_Info>();
                EntitiesGeneral       OEGeneral = new EntitiesGeneral();

                var lst = OEGeneral.tb_bodega.Include("tb_sucursal").Where(q => q.IdEmpresa == idempresa).ToList();

                if (TipoCarga == Cl_Enumeradores.eTipoFiltro.todos)
                {
                    tb_Bodega_Info info = new tb_Bodega_Info();
                    info.bo_Descripcion  = "Todas";
                    info.bo_Descripcion2 = "Todas";
                    info.IdBodega        = 0;
                    lM.Add(info);
                }
                foreach (var item in lst)
                {
                    lM.Add(new tb_Bodega_Info
                    {
                        IdEmpresa            = item.IdEmpresa,
                        IdBodega             = item.IdBodega,
                        IdSucursal           = item.IdSucursal,
                        cod_bodega           = item.cod_bodega,
                        bo_Descripcion       = item.bo_Descripcion.Trim(),
                        cod_punto_emision    = item.cod_punto_emision,
                        bo_esBodega          = item.bo_EsBodega,
                        bo_manejaFacturacion = item.bo_manejaFacturacion,
                        Estado           = (item.Estado == "A") ? true : false,
                        NomSucursal      = item.tb_sucursal.Su_Descripcion.Trim(),
                        IdCtaCtble_Inve  = item.IdCtaCtble_Inve,
                        IdCtaCtble_Costo = item.IdCtaCtble_Costo,
                        bo_Descripcion2  = "[" + item.IdBodega.ToString() + "] " + item.bo_Descripcion
                    });
                }
                return(lM);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Example #4
0
 public List <tb_Bodega_Info> Get_List_Bodega(int IdEmpresa, Cl_Enumeradores.eTipoFiltro TipoCarga = Cl_Enumeradores.eTipoFiltro.Normal)
 {
     try
     {
         tb_Bodega_Data data = new tb_Bodega_Data();
         return(data.Get_List_Bodega(IdEmpresa, TipoCarga));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Obtener_BodegasTodas", ex.Message), ex)
               {
                   EntityType = typeof(tb_Bodega_Bus)
               };
     }
 }
Example #5
0
        public List <ct_Cbtecble_tipo_Info> Get_list_Cbtecble_tipo(int IdEmpresa, Cl_Enumeradores.eTipoFiltro TipoFiltro, ref string MensajeError)
        {
            List <ct_Cbtecble_tipo_Info> lm = new List <ct_Cbtecble_tipo_Info>();

            try
            {
                lm = data.Get_list_Cbtecble_tipo(IdEmpresa, TipoFiltro, ref MensajeError);
                return(lm);
            }
            catch (Exception ex)
            {
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_list_Cbtecble_tipo", ex.Message), ex)
                      {
                          EntityType = typeof(ct_Cbtecble_tipo_Bus)
                      };
            }
        }
Example #6
0
        public UCFa_Sucursal_PtoVta_cmb()
        {
            try
            {
                InitializeComponent();
                if (TipoCarga == null)
                {
                    TipoCarga = Cl_Enumeradores.eTipoFiltro.Normal;
                }

                Event_cmb_sucursal_EditValueChanged += UCIn_Sucursal_Bodega_Event_cmb_sucursal_EditValueChanged;
                Event_cmb_PtoVta_EditValueChanged   += UCIn_Sucursal_Bodega_Event_cmb_PtoVta_EditValueChanged;
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(NameMetodo + " - " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }
Example #7
0
        public List <tb_Bodega_Info> Get_List_Bodega(int idempresa, Cl_Enumeradores.eTipoFiltro TipoCarga = Cl_Enumeradores.eTipoFiltro.Normal)
        {
            try
            {
                List <tb_Bodega_Info> lM        = new List <tb_Bodega_Info>();
                EntitiesGeneral       OEGeneral = new EntitiesGeneral();

                var select_pv = from A in OEGeneral.tb_bodega
                                join B in OEGeneral.tb_sucursal
                                on new { A.IdEmpresa, A.IdSucursal } equals new { B.IdEmpresa, B.IdSucursal }
                where A.IdEmpresa == idempresa
                select new
                {
                    A.IdEmpresa,
                    A.IdBodega,
                    A.IdSucursal,
                    A.cod_bodega,
                    A.bo_Descripcion,
                    A.cod_punto_emision,
                    A.bo_EsBodega,
                    A.bo_manejaFacturacion,
                    A.Estado,
                    B.Su_Descripcion,
                    A.IdCtaCtble_Costo,
                    A.IdCtaCtble_Inve
                };
                if (TipoCarga == Cl_Enumeradores.eTipoFiltro.todos)
                {
                    tb_Bodega_Info info = new tb_Bodega_Info();
                    info.bo_Descripcion  = "Todas";
                    info.bo_Descripcion2 = "Todas";
                    info.IdBodega        = 0;
                    lM.Add(info);
                }
                foreach (var item in select_pv)
                {
                    tb_Bodega_Info info = new tb_Bodega_Info();
                    info.IdEmpresa            = item.IdEmpresa;
                    info.IdBodega             = item.IdBodega;
                    info.IdSucursal           = item.IdSucursal;
                    info.cod_bodega           = item.cod_bodega;
                    info.bo_Descripcion       = item.bo_Descripcion.Trim();
                    info.cod_punto_emision    = item.cod_punto_emision;
                    info.bo_esBodega          = item.bo_EsBodega;
                    info.bo_manejaFacturacion = item.bo_manejaFacturacion;
                    info.Estado      = (item.Estado == "A") ? true : false;
                    info.NomSucursal = item.Su_Descripcion.Trim();

                    info.IdCtaCtble_Inve  = item.IdCtaCtble_Inve;
                    info.IdCtaCtble_Costo = item.IdCtaCtble_Costo;

                    lM.Add(info);
                }
                return(lM);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }