Exemple #1
0
        public bool GuardarDB(ct_distribucion_gastos_x_periodo_Info info)
        {
            try
            {
                using (EntitiesContabilidad_FJ Context = new EntitiesContabilidad_FJ())
                {
                    ct_distribucion_gastos_x_periodo Entity = new ct_distribucion_gastos_x_periodo();
                    Entity.IdEmpresa      = info.IdEmpresa;
                    Entity.IdDistribucion = info.IdDistribucion = get_id(info.IdEmpresa);
                    Entity.IdPeriodo      = info.IdPeriodo;
                    Entity.Fecha          = info.Fecha;
                    Entity.Estado         = info.Estado;
                    Entity.Observacion    = info.Observacion;
                    Context.ct_distribucion_gastos_x_periodo.Add(Entity);
                    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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Exemple #2
0
 public bool ModificarDB(ct_distribucion_gastos_x_periodo_Info info)
 {
     try
     {
         if (oData.ModificarDB(info))
         {
             foreach (var item in info.lst_x_punto_cargo)
             {
                 item.IdEmpresa      = info.IdEmpresa;
                 item.IdDistribucion = info.IdDistribucion;
             }
             foreach (var item in info.lst_x_gastos)
             {
                 item.IdEmpresa      = info.IdEmpresa;
                 item.IdDistribucion = info.IdDistribucion;
             }
             oData_gastos.GuardarDB(info.lst_x_gastos);
             oData_pc.GuardarDB(info.lst_x_punto_cargo);
             return(true);
         }
         return(false);
     }
     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_Info_Punto_cargo", ex.Message), ex)
               {
                   EntityType = typeof(ct_distribucion_gastos_x_periodo_Bus)
               };
     }
 }
Exemple #3
0
        public bool ModificarDB(ct_distribucion_gastos_x_periodo_Info info)
        {
            try
            {
                using (EntitiesContabilidad_FJ Context = new EntitiesContabilidad_FJ())
                {
                    ct_distribucion_gastos_x_periodo Entity = Context.ct_distribucion_gastos_x_periodo.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdDistribucion == info.IdDistribucion);
                    if (Entity != null)
                    {
                        Entity.Fecha       = info.Fecha;
                        Entity.Observacion = info.Observacion;
                        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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
 public void set_info(ct_distribucion_gastos_x_periodo_Info _info)
 {
     try
     {
         info_distribucion = _info;
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         NameMetodo = NameMetodo + " - " + ex.ToString();
         MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas)
                         , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
     }
 }
Exemple #5
0
        public List <ct_distribucion_gastos_x_periodo_Info> get_list(int IdEmpresa, DateTime Fecha_ini, DateTime Fecha_fin)
        {
            try
            {
                int IdPeriodo_ini = Convert.ToInt32(Fecha_ini.Date.Year.ToString() + Fecha_ini.Date.Month.ToString("00"));
                int IdPeriodo_fin = Convert.ToInt32(Fecha_fin.Date.Year.ToString() + Fecha_fin.Date.Month.ToString("00"));

                List <ct_distribucion_gastos_x_periodo_Info> Lista = new List <ct_distribucion_gastos_x_periodo_Info>();

                using (EntitiesContabilidad_FJ Context = new EntitiesContabilidad_FJ())
                {
                    var lst = from q in Context.ct_distribucion_gastos_x_periodo
                              where q.IdEmpresa == IdEmpresa &&
                              IdPeriodo_ini <= q.IdPeriodo && q.IdPeriodo <= IdPeriodo_fin
                              select q;

                    foreach (var item in lst)
                    {
                        ct_distribucion_gastos_x_periodo_Info info = new ct_distribucion_gastos_x_periodo_Info();

                        info.IdEmpresa      = item.IdEmpresa;
                        info.IdDistribucion = item.IdDistribucion;
                        info.IdPeriodo      = item.IdPeriodo;
                        info.Fecha          = item.Fecha;
                        info.Observacion    = item.Observacion;
                        info.Estado         = item.Estado;
                        info.IdEmpresa_ct   = item.IdEmpresa_ct;
                        info.IdTipoCbte_ct  = item.IdTipoCbte_ct;
                        info.IdCbteCble_ct  = item.IdCbteCble_ct;

                        Lista.Add(info);
                    }
                }

                return(Lista);
            }
            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.ToString();
                throw new Exception(ex.ToString());
            }
        }
 public bool ModificarDB(ct_distribucion_gastos_x_periodo_Info info)
 {
     try
     {
         if (oData.ModificarDB(info))
         {
             return(true);
         }
         return(false);
     }
     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_Info_Punto_cargo", ex.Message), ex)
               {
                   EntityType = typeof(ct_distribucion_gastos_x_periodo_Bus)
               };
     }
 }
Exemple #7
0
 private void ucGe_Menu_Mantenimiento_x_usuario1_event_btnconsultar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         info_distribucion = (ct_distribucion_gastos_x_periodo_Info)gridView_distribucion.GetFocusedRow();
         if (info_distribucion == null)
         {
             MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Seleccione_un_registro), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             return;
         }
         Llamar_formulario(Cl_Enumeradores.eTipo_action.consultar);
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
     }
 }