Exemplo n.º 1
0
 public Boolean Modificar_Estado_Prefacturacion_DB(Aca_Pre_Facturacion_Info Info, ref string msg)
 {
     try
     {
         Boolean resultado = false;
         using (Entities_Academico context = new Entities_Academico())
         {
             var address = context.Aca_Pre_Facturacion.FirstOrDefault(
                 minfo => minfo.IdInstitucion == Info.IdInstitucion &&
                 minfo.IdPreFacturacion == Info.IdPreFacturacion
                 );
             if (address != null)
             {
                 address.Estado_Pre_factutacion_Cat = "FAC";
                 context.SaveChanges();
                 resultado = true;
             }
             else
             {
                 msg = "No se pudo modificar, ya que la consulta regreso vacia";
             }
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.InnerException + " " + ex.Message;
         throw new Exception(ex.InnerException.ToString());
     }
 }
Exemplo n.º 2
0
        public void Set(Aca_Pre_Facturacion_Info info_)
        {
            try
            {
                info_prefac = info_;
                cmb_anio_lectivo.EditValue = info_.IdAnioLectivo;
                cmb_periodo.EditValue      = Convert.ToInt32(info_.IdPeriodo);
                txt_observacion.Text       = info_.observacion_fact;
                txt_id.EditValue           = info_.IdPreFacturacion;
                if (info_.Estado_Pre_factutacion_Cat == "FAC")
                {
                    cmb_facturar.Enabled         = false;
                    cmb_procesar_pre_fac.Enabled = false;
                }
                lista_detalle = new BindingList <Aca_Pre_Facturacion_det_Info>(bus_detalle.Get_list(info_.IdInstitucion, Convert.ToInt32(info_.IdPreFacturacion)));
                gridControl_pre_fac.DataSource = lista_detalle;

                lista_facturas = bus_facturas.Get_list(info_.IdInstitucion, Convert.ToInt32(info_.IdAnioLectivo), info_.IdPeriodo, ref mensaje);
                gridControl_Facturas.DataSource = lista_facturas;
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 3
0
        public Boolean Procesar_Pre_Fact(Aca_Pre_Facturacion_Info Info, int IdSede, ref string msg, ref decimal IdPrefacturacion)
        {
            try
            {
                using (Entities_Academico context = new Entities_Academico())
                {
                    var select = context.spACA_Pre_facturar_x_periodo(Info.IdEmpresa_fact, Info.IdInstitucion, IdSede, Info.IdAnioLectivo, Info.IdPeriodo, Info.IdGrupoFE, Info.IdPreFacturacion, Info.fecha_prefacturacion, Info.Estado_Pre_factutacion_Cat, Info.observacion_fact);
                    foreach (var item in select)
                    {
                        IdPrefacturacion = item.Value;
                    }

                    //IdPrefacturacion =
                }
                return(true);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemplo n.º 4
0
        private void ucGe_Menu_event_btnModificar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                info = new Aca_Pre_Facturacion_Info();
                info = (Aca_Pre_Facturacion_Info)gridView_pre_fac.GetFocusedRow();
                if (info == null)
                {
                    MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Seleccione_un_registro), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (info.Estado_Pre_factutacion_Cat == "PEN")
                {
                    frm           = new FrmAca_Pre_Facturacion_Mant();
                    frm.accion    = Cl_Enumeradores.eTipo_action.consultar;
                    frm.MdiParent = this.MdiParent;
                    frm.Set(info);
                    frm.Show();
                }
                if (info.Estado_Pre_factutacion_Cat == "FAC")
                {
                    MessageBox.Show("No se puede Modificar el Proceso de Facturacion \n El Proceso de Facturacion ya esta Facturado", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Log_Error_bus.Log_Error(ex.Message);
            }
        }
Exemplo n.º 5
0
        public List <Aca_Pre_Facturacion_Info> Get_List(int IdInstitucion)
        {
            List <Aca_Pre_Facturacion_Info> lstAspirante = new List <Aca_Pre_Facturacion_Info>();

            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    var vaspirante = from a in Base.vwAca_Pre_Facturacion
                                     where a.IdInstitucion == IdInstitucion
                                     select a;

                    foreach (var item in vaspirante)
                    {
                        Aca_Pre_Facturacion_Info address = new Aca_Pre_Facturacion_Info();
                        address.IdInstitucion          = item.IdInstitucion;
                        address.IdPreFacturacion       = item.IdPreFacturacion;
                        address.IdInstitucion_contrato = item.IdInstitucion_contrato;
                        address.IdPeriodo            = item.IdPeriodo;
                        address.fecha_prefacturacion = Convert.ToDateTime(item.fecha_prefacturacion);
                        address.IdEmpresa_fact       = Convert.ToInt32(item.IdEmpresa_fact);
                        address.IdSucursal_fact      = item.IdSucursal_fact;
                        address.IdBodega_fact        = Convert.ToInt32(item.IdBodega_fact);
                        address.IdCbteVta            = item.IdCbteVta;
                        address.IdPtoVta_fact        = item.IdPtoVta_fact;
                        address.vt_fecha_fact        = item.vt_fecha_fact;
                        address.vt_fech_venc         = item.vt_fech_venc;
                        address.observacion_fact     = item.observacion_fact;
                        address.IdBodega_fact        = Convert.ToInt32(item.IdBodega_fact);

                        address.Descripcion                = item.Descripcion;
                        address.pe_FechaIni                = item.pe_FechaIni;
                        address.pe_FechaFin                = item.pe_FechaFin;
                        address.pe_estado                  = item.pe_estado;
                        address.IdAnioLectivo              = item.IdAnioLectivo;
                        address.Ruc                        = item.Ruc;
                        address.codInstitucion             = item.codInstitucion;
                        address.Nombre                     = item.Nombre;
                        address.Estado_Pre_factutacion_Cat = item.Estado_Pre_factutacion_Cat;
                        lstAspirante.Add(address);
                    }
                }
                return(lstAspirante);
            }
            catch (Exception ex)
            {
                string arreglo      = ToString();
                string MensajeError = string.Empty;
                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);
                MensajeError = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemplo n.º 6
0
 public Boolean Modificar_Estado_Prefacturacion_DB(Aca_Pre_Facturacion_Info Info, ref string msg)
 {
     try
     {
         return(data.Modificar_Estado_Prefacturacion_DB(Info, ref msg));
     }
     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_Catalogo", ex.Message), ex)
               {
                   EntityType = typeof(Aca_Catalogo_Bus)
               };
     }
 }
Exemplo n.º 7
0
        public Boolean ModificarDB(Aca_Pre_Facturacion_Info Info, ref string msg)
        {
            try
            {
                Boolean resultado = false;
                using (Entities_Academico context = new Entities_Academico())
                {
                    var address = context.Aca_Pre_Facturacion.FirstOrDefault(
                        minfo => minfo.IdInstitucion == Info.IdInstitucion &&
                        minfo.IdPreFacturacion == Info.IdPreFacturacion
                        );
                    if (address != null)
                    {
                        address.IdInstitucion_contrato = Info.IdInstitucion_contrato;
                        address.IdPeriodo            = Info.IdPeriodo;
                        address.fecha_prefacturacion = Convert.ToDateTime(Info.fecha_prefacturacion);
                        address.IdEmpresa_fact       = Convert.ToInt32(Info.IdEmpresa_fact);
                        address.IdSucursal_fact      = Info.IdSucursal_fact;
                        address.IdBodega_fact        = Info.IdBodega_fact;

                        address.IdCbteVta                  = Info.IdCbteVta;
                        address.IdPtoVta_fact              = Info.IdPtoVta_fact;
                        address.vt_fecha_fact              = Info.vt_fecha_fact;
                        address.vt_fech_venc               = Info.vt_fech_venc;
                        address.observacion_fact           = Info.observacion_fact;
                        address.IdBodega_fact              = Info.IdBodega_fact;
                        address.Estado_Pre_factutacion_Cat = Info.Estado_Pre_factutacion_Cat;
                        context.SaveChanges();
                        resultado = true;
                    }
                    else
                    {
                        msg = "No se pudo modificar, ya que la consulta regreso vacia";
                    }
                }
                return(resultado);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemplo n.º 8
0
 public Boolean ModificarDB(Aca_Pre_Facturacion_Info Info, ref string msg)
 {
     try
     {
         Get_convertir_perosno_x_estudiante_a_client();
         foreach (var item in lista_cliente)
         {
             fa_cliente_data.GrabarDB(item, ref IdPersona, ref Idcliente, ref msg);
         }
         return(data.ModificarDB(Info, ref msg));
     }
     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_Rubro", ex.Message), ex)
               {
                   EntityType = typeof(Aca_Rubro_Bus)
               };
     }
 }
Exemplo n.º 9
0
        public Boolean GrabarDB(Aca_Pre_Facturacion_Info Info, ref string msg)
        {
            try
            {
                using (Entities_Academico context = new Entities_Academico())
                {
                    Aca_Pre_Facturacion address = new Aca_Pre_Facturacion();
                    address.IdInstitucion          = Info.IdInstitucion;
                    address.IdPreFacturacion       = Info.IdPreFacturacion;
                    address.IdInstitucion_contrato = Info.IdInstitucion_contrato;
                    address.IdPeriodo            = Info.IdPeriodo;
                    address.fecha_prefacturacion = Convert.ToDateTime(Info.fecha_prefacturacion);
                    address.IdEmpresa_fact       = Convert.ToInt32(Info.IdEmpresa_fact);
                    address.IdSucursal_fact      = Info.IdSucursal_fact;
                    address.IdBodega_fact        = Info.IdBodega_fact;

                    address.IdCbteVta                  = Info.IdCbteVta;
                    address.IdPtoVta_fact              = Info.IdPtoVta_fact;
                    address.vt_fecha_fact              = Info.vt_fecha_fact;
                    address.vt_fech_venc               = Info.vt_fech_venc;
                    address.observacion_fact           = Info.observacion_fact;
                    address.IdBodega_fact              = Info.IdBodega_fact;
                    address.Estado_Pre_factutacion_Cat = Info.Estado_Pre_factutacion_Cat
                    ;
                    context.Aca_Pre_Facturacion.Add(address);
                    context.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }