コード例 #1
0
        public void guardarEvento(Evento  proximoEvento)
        {
            //Como se producen partidas con tiempo infinito, vamos a mantener solamente Una partida con tiempo
            //infinito. Si se intenta guardar otra, la descartamos.

            if (proximoEvento is Partida && proximoEvento.DevolverTiempoEvento == double.PositiveInfinity  )
            {
                var tipoPartida = LEV.OfType<Partida>();
                var sel =
                    from e in tipoPartida
                    where e.DevolverTiempoEvento  == double.PositiveInfinity
                    select e;

                //si no hay partidas con tiempo infinito, agregamos el evento.
                //sino, no hacemos nada (void)
                if (sel.Count() == 0)
                {
                    LEV.Add(proximoEvento);
                }

            }
            else
            {
                //si es arribo, no hay que validar que existan varias partidas con tiempo infinito.
                LEV.Add(proximoEvento);
            }
        }
コード例 #2
0
ファイル: EventoLista.cs プロジェクト: emiliomm/ProjectY
	public EventoLista(int IDInteractuableInicial, Evento evento)
	{
		interactuables = new List<int>();
		interactuables.Add(IDInteractuableInicial);

		this.evento = evento;
	}
コード例 #3
0
ファイル: Asistencia.cs プロジェクト: tjsearsz/MINESANTED
 public Asistencia()
 {
     this.asistio = " ";
     this.inscripcion = new Inscripcion();
     this.competencia = new Competencia();
     this.evento = new Evento();
 }
 public static void NovoEvento()
 {
     var evento = new Evento();
     Console.WriteLine("Nome: {0}", evento.Nome);
     Console.WriteLine("Cidade: {0}", evento.Cidade);
     Console.WriteLine("Ano: {0}", evento.Ano);
 }
コード例 #5
0
 public Inscripcion(DateTime fecha, Persona persona, Evento evento)
 {
     this.fecha = fecha;
     this.persona = persona;
     this.evento = evento;
     this.competencia = new Modulo12.Competencia();
     this.asistencias = new List<Asistencia>();
     this.resAscenso = new List<Entidad>();
     this.resKata = new List<Entidad>();
     this.resKumite = new List<ResultadoKumite>();
 }
コード例 #6
0
 public Inscripcion()
 {
     this.fecha = new DateTime();
     this.persona = new Persona();
     this.competencia = new Modulo12.Competencia();
     this.evento = new Evento();
     this.asistencias = new List<Asistencia>();
     this.resAscenso = new List<Entidad>();
     this.resKata = new List<Entidad>();
     this.resKumite = new List<ResultadoKumite>();
 }
コード例 #7
0
 public Inscripcion(DateTime fecha, Persona persona, DominioSKD.Entidades.Modulo12.Competencia competencia)
 {
     this.fecha = fecha;
     this.persona = persona;
     this.competencia = competencia;
     this.evento = new Evento();
     this.asistencias = new List<Asistencia>();
     this.resAscenso = new List<Entidad>();
     this.resKata = new List<Entidad>();
     this.resKumite = new List<ResultadoKumite>();
 }
コード例 #8
0
 public Inscripcion(DateTime fecha, Persona persona, Evento evento, DominioSKD.Entidades.Modulo14.SolicitudPlanilla solicitud)
 {
     this.fecha = fecha;
     this.persona = persona;
     this.evento = evento;
     this.solicitud = solicitud;
     this.competencia = new Modulo12.Competencia();
     this.asistencias = new List<Asistencia>();
     this.resAscenso = new List<Entidad>();
     this.resKata = new List<Entidad>();
     this.resKumite = new List<ResultadoKumite>();
 }
コード例 #9
0
ファイル: Inscripcion.cs プロジェクト: tjsearsz/MINESANTED
 public Inscripcion(int id, DateTime fecha, Persona persona, Competencia competencia, SolicitudPlanilla solicitud)
 {
     this.id = id;
     this.fecha = fecha;
     this.persona = persona;
     this.competencia = competencia;
     this.solicitud = solicitud;
     this.evento = new Evento();
     this.asistencias = new List<Asistencia>();
     this.resAscenso = new List<ResultadoAscenso>();
     this.resKata = new List<ResultadoKata>();
     this.resKumite = new List<ResultadoKumite>();
 }
コード例 #10
0
ファイル: EventoDAO.cs プロジェクト: marlonps/OpenSARC
 public void AtualizaEvento(Evento evento)
 {
     DbCommand cmd = baseDados.GetStoredProcCommand("EventoUpdate");
     baseDados.AddInParameter(cmd, "@EventoId", DbType.Guid, evento.EventoId);
     baseDados.AddInParameter(cmd, "@Titulo", DbType.String, evento.Titulo);
     baseDados.AddInParameter(cmd, "@Responsavel", DbType.String, evento.Responsavel);
     baseDados.AddInParameter(cmd, "@Descricao", DbType.String, evento.Descricao);
     baseDados.AddInParameter(cmd, "@Unidade", DbType.String, evento.Unidade);
     try
     {
         baseDados.ExecuteNonQuery(cmd);
     }
     catch (SqlException ex)
     {
         throw new DataAccessException(ErroMessages.GetErrorMessage(ex.Number), ex);
     }
 }
コード例 #11
0
        public ActionResult Create(Evento evento)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    dc.Eventos.InsertOnSubmit(evento);
                    dc.SubmitChanges();
                    return RedirectToAction("Index");
                }
                catch
                {
                    SetDropDownListViewData();
                    return View(evento);
                }
            }

            SetDropDownListViewData();
            return View(evento);
        }
コード例 #12
0
 public static void Log(TipoEvento tipoEvento, string detalle)
 {
     Evento evento = new Evento();
     evento.IdUsuario = BiFactory.User.IdUsuario;
     evento.IdTipoEvento = (int)tipoEvento;
     evento.Fecha = DateTime.Now;
     string host = string.Empty;
     try
     {
         host = Dns.GetHostEntry(HttpContext.Current.Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' })[0].ToString();
     }
     catch (Exception)
     {
         host = HttpContext.Current.Request.UserHostAddress;
     }
     evento.Host = host;
     evento.Detalle = detalle;
     evento.Save();
     LogToFile(tipoEvento, detalle);
 }
コード例 #13
0
        public ActionResult Add(RegisterEventoModel model)
        {
            int idAfiliado = SessionLayer.Instance.GetUserLoggedId();
            var evento = new Evento
            {
                /*Ciudad = _ciudadRepo.Filter(x => x.idCiudad == model.Country).First(),
                Estado = _estadoRepo.Filter(x => x.idEstado == model.State).First(),
                Pais = _paisRepo.Filter(x => x.idPais == model.Country).First(),
                Afiliado = _afiliadoRepository.Filter(x => x.idAfiliado == idAfiliado).First(),*/
                direccion = model.Address,
                fechaInicio = DateTime.Parse(model.StartDate),
                fechaExpiracion = DateTime.Parse(model.EndDate),
                idCiudad = model.City,
                idEstado = model.State,
                idPais = model.Country,
                nombreEvento = model.Name,
                activo = _eventoRepository.GetActiveEventValue(model.Active),
                descripcion = model.Description,
                idCategoria = model.Category,
                idAfiliado = idAfiliado
            };

            _eventoRepository.Create(evento);

            if (model.PictureFile != null && model.PictureFile.ContentLength > 0)
            {
                var fileName = Path.GetFileName(model.PictureFile.FileName);
                if (fileName != null)
                {
                    var temp = "~/Content/dataImg/eventsImages";
                    var name = evento.idEvento.ToString(CultureInfo.InvariantCulture) + Path.GetExtension(model.PictureFile.FileName);
                    var path = Path.Combine(Server.MapPath(temp), name);
                    model.PictureFile.SaveAs(path);
                    temp += "/" + name;
                    evento.imgUrl = temp;
                    _eventoRepository.Update(evento);
                }
            }
            return RedirectToAction("Index");
        }
コード例 #14
0
 public EventoCommand(Evento evento)
 {
     Evento = evento;
 }
コード例 #15
0
 public void Add(Evento evento)
 {
     db.Eventos.InsertOnSubmit(evento);
 }
コード例 #16
0
 public void RemoverEvento(Evento eventItem)
 {
     _notificacoes?.Remove(eventItem);
 }
コード例 #17
0
ファイル: App.cs プロジェクト: RobertoOFonseca/MySafety
		private async void SaveEventDatabase (MySafetyDll.MySafety.Message message, Evento evento)
		{

			Events _event = new Events ();
			_event.UserId = Settings.user_Id;
			_event.Id = Guid.NewGuid ().ToString ();
			_event.Type = message.newEvent.ToString ();
			if (evento != null) {
				_event.Date = evento.horario;
				_event.Arg1 = evento.bleAddress;
				_event.Arg2 = evento.evento.ToString ();
			} else {
				_event.Date = DateTime.Now;
			}
			await new Repository<Events> ().CreateAsync (_event);
		}
コード例 #18
0
ファイル: Inscripcion.cs プロジェクト: tjsearsz/MINESANTED
 public Inscripcion()
 {
     this.id = 0;
     this.fecha = new DateTime();
     this.persona = new Persona();
     this.competencia = new Competencia();
     //this.solicitud = new SolicitudPlanilla();
     this.evento = new Evento();
     this.asistencias = new List<Asistencia>();
     this.resAscenso = new List<ResultadoAscenso>();
     this.resKata = new List<ResultadoKata>();
     this.resKumite = new List<ResultadoKumite>();
 }
コード例 #19
0
 public void Update(Evento obj)
 {
     //
 }
コード例 #20
0
        public void clonaImmagineIncorniciata(Fotografia fotoOrig, string nomeFileImg)
        {
            FileInfo fileInfoSrc   = new FileInfo(fotoOrig.nomeFile);
            string   nomeOrig      = fileInfoSrc.Name;
            string   nomeFotoClone = ClonaImmaginiWorker.getNomeFileClone(fotoOrig);
            string   nomeFileDest  = Path.Combine(Config.Configurazione.cartellaRepositoryFoto, Path.GetDirectoryName(fotoOrig.nomeFile), nomeFotoClone);

            //Sposto la foto nella coartellaRepository e gli attribuisco il suo nome originale.
            File.Move(nomeFileImg, nomeFileDest);

            Fotografia fotoMsk = null;

            using (new UnitOfWorkScope(false))
            {
                try
                {
                    fotoMsk    = new Fotografia();
                    fotoMsk.id = Guid.NewGuid();
                    fotoMsk.dataOraAcquisizione = fotoOrig.dataOraAcquisizione;

                    Fotografo f = fotoOrig.fotografo;
                    OrmUtil.forseAttacca <Fotografo>(ref f);
                    fotoMsk.fotografo = f;

                    if (fotoOrig.evento != null)
                    {
                        Evento e = fotoOrig.evento;
                        OrmUtil.forseAttacca <Evento>(ref e);
                        fotoMsk.evento = e;
                    }

                    fotoMsk.didascalia = fotoOrig.didascalia;
                    fotoMsk.numero     = fotoOrig.numero;
                    // Le correzioni non devo duplicarle perché non sono tipiche della composizione finale, ma della foto originale.

                    fotoMsk.faseDelGiorno = fotoOrig.faseDelGiorno;
                    fotoMsk.giornata      = fotoOrig.giornata;

                    // il nome del file, lo memorizzo solamente relativo
                    // scarto la parte iniziale di tutto il path togliendo il nome della cartella di base delle foto.
                    // Questo perché le stesse foto le devono vedere altri computer della rete che
                    // vedono il percorso condiviso in maniera differente.
                    fotoMsk.nomeFile = Path.Combine(Path.GetDirectoryName(fotoOrig.nomeFile), nomeFotoClone);

                    fotografieRepositorySrv.addNew(fotoMsk);
                    fotografieRepositorySrv.saveChanges();
                }

                catch (Exception ee)
                {
                    _giornale.Error("Non riesco ad inserire una foto clonata. Nel db non c'è ma nel filesystem si: " + fotoOrig.nomeFile, ee);
                }

                AiutanteFoto.creaProvinoFoto(nomeFileDest, fotoMsk);

                // Libero la memoria occupata dalle immagini, altrimenti esplode.
                AiutanteFoto.disposeImmagini(fotoMsk, IdrataTarget.Tutte);

                // Notifico la lista delle foto da mandare in modifica
                NuovaFotoMsg msg = new NuovaFotoMsg(this, fotoMsk);
//				msg.descrizione += Configurazione.ID_FOTOGRAFO_ARTISTA;
                LumenApplication.Instance.bus.Publish(msg);
            }
        }
コード例 #21
0
        public void PruebaCarritoVariosItems()
        {
            //Agregamos todos los items en el carrito de una persona
            this.daoPrueba.agregarItem(this.persona4, this.implemento, 1, 5);
            this.daoPrueba.agregarItem(this.persona4, this.listaEventos[0], 2, 6);
            this.daoPrueba.agregarItem(this.persona4, this.matricula, 3, 1);

            //Ejecutamos los metodos correspondientes para ver los items
            this.ImplementosCarrito = this.daoPrueba.getImplemento(this.persona4);
            this.EventosCarrito = this.daoPrueba.getEvento(this.persona4);
            this.MatriculasCarrito = this.daoPrueba.getMatricula(this.persona4);

            /*Revisamos que hayan Implementos, Eventos y matriculas, ademas,
              que efectivamente haya solo uno agregado de cada uno de ellos*/
            Assert.IsTrue(this.ImplementosCarrito.Count == 1);
            Assert.IsTrue(this.EventosCarrito.Count == 1);
            Assert.IsTrue(this.MatriculasCarrito.Count == 1);

            //Obtenemos los items y verificamos sus valores
            this.implemento = this.ImplementosCarrito.ElementAt(0).Key as Implemento;
            Assert.AreEqual(this.implemento.Id_Implemento, 1);
            Assert.AreEqual(this.implemento.Precio_Implemento, 4500);
            Assert.AreEqual(this.ImplementosCarrito.ElementAt(0).Value, 5);

            this.evento = this.EventosCarrito.ElementAt(0).Key as Evento;
            Assert.AreEqual(this.evento.Id_evento, 1);
            Assert.AreEqual(this.evento.Costo, 0);
            Assert.AreEqual(this.EventosCarrito.ElementAt(0).Value, 6);

            this.matricula = this.MatriculasCarrito.ElementAt(0).Key as Matricula;
            Assert.AreEqual(this.matricula.Id, 1);
            //Assert.AreEqual(this.matricula.Costo, 5000);
            //PILAS CON EL COSTO ARREGLAR
            Assert.AreEqual(this.MatriculasCarrito.ElementAt(0).Value, 1);
        }
コード例 #22
0
        public void PruebaCarritoSoloEventos()
        {
            //Agregamos Eventos en el carrito de la persona
            this.daoPrueba.agregarItem(this.persona2, this.listaEventos[0], 2, 6);

            //Ejecutamos los metodos correspondientes para ver los items
            this.ImplementosCarrito = this.daoPrueba.getImplemento(this.persona2);
            this.EventosCarrito = this.daoPrueba.getEvento(this.persona2);
            this.MatriculasCarrito = this.daoPrueba.getMatricula(this.persona2);

            //Revisamos que solo hayan Eventos y efectivamente haya solo uno agregado
            Assert.IsTrue(this.ImplementosCarrito.Count == 0);
            Assert.IsTrue(this.EventosCarrito.Count == 1);
            Assert.IsTrue(this.MatriculasCarrito.Count == 0);

            //Obtenemos el Evento y verificamos sus valores
            this.evento = this.EventosCarrito.ElementAt(0).Key as Evento;
            Assert.AreEqual(this.evento.Id_evento, 1);
            Assert.AreEqual(this.evento.Costo, 0);
            Assert.AreEqual(this.EventosCarrito.ElementAt(0).Value, 6);
        }
コード例 #23
0
ファイル: DaoEvento.cs プロジェクト: rosmantorres/sakaratedo
        /// <summary>
        /// Metodo que retorma una entidad de tipo evento
        /// </summary>
        /// <param name=Entidad>Se pasa el id del evento a buscar</param>
        /// <returns>Todas los atributos de la clase evento para el detallar</returns>
        public Entidad ConsultarXId(Entidad evento)
        {
            FabricaEntidades laFabrica = new FabricaEntidades();
            List<Evento> laLista = new List<Evento>();
            DataTable resultado = new DataTable();
            List<Parametro> parametros = new List<Parametro>();
            Evento elEvento = new Evento();
            Evento lista = new Evento();

            // Casteamos
            Evento eve = (Evento)evento;

                try
                {
                    //Escribo en el logger la entrada a este metodo
                    Logger.EscribirInfo(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name,
                    RecursosBDModulo16.MENSAJE_ENTRADA_LOGGER, System.Reflection.MethodBase.GetCurrentMethod().Name);

                    //Creo la lista de los parametros para el stored procedure y los anexo
                    parametros = new List<Parametro>();
                    Parametro parametro = new Parametro(RecursosBDModulo16.PARAMETRO_ITEM, SqlDbType.Int, eve.Id.ToString(), false);
                    parametros.Add(parametro);

                    //Ejecuto el Stored Procedure
                    resultado = EjecutarStoredProcedureTuplas(RecursosBDModulo16.DETALLAR_EVENTO, parametros);

                    //Limpio la conexion
                    LimpiarSQLConnection();

                    //Obtengo todos los elementos del evento
                    foreach (DataRow row in resultado.Rows)
                    {
                        elEvento = (Evento)laFabrica.ObtenerEvento();
                        elEvento.Id_evento = int.Parse(row[RecursosBDModulo16.PARAMETRO_IDEVENTO].ToString());
                        elEvento.Nombre = row[RecursosBDModulo16.PARAMETRO_NOMBRE].ToString();
                        elEvento.Costo = int.Parse(row[RecursosBDModulo16.PARAMETRO_PRECIO].ToString());
                        elEvento.Descripcion = row[RecursosBDModulo16.PARAMETRO_DESCRIPCION].ToString();

                    }

                    //Limpio la conexion
                    LimpiarSQLConnection();

                    //Escribo en el logger la salida a este metodo
                    Logger.EscribirInfo(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name,
                    RecursosBDModulo16.MENSAJE_SALIDA_LOGGER, System.Reflection.MethodBase.GetCurrentMethod().Name);

                    //Retorno el evento
                    return elEvento;

                }

                #region catches
                catch (LoggerException e)
                {
                    Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, e);
                    throw e;
                }
                catch (ArgumentNullException e)
                {
                    Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, e);
                    throw new ParseoVacioException(RecursosBDModulo16.CODIGO_EXCEPCION_ARGUMENTO_NULO,
                        RecursosBDModulo16.MENSAJE_EXCEPCION_ARGUMENTO_NULO, e);
                }
                catch (FormatException e)
                {
                    Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, e);
                    throw new ParseoFormatoInvalidoException(RecursosBDModulo16.CODIGO_EXCEPCION_FORMATO_INVALIDO,
                        RecursosBDModulo16.MENSAJE_EXCEPCION_FORMATO_INVALIDO, e);
                }
                catch (OverflowException e)
                {
                    Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, e);
                    throw new ParseoEnSobrecargaException(RecursosBDModulo16.CODIGO_EXCEPCION_SOBRECARGA,
                        RecursosBDModulo16.MENSAJE_EXCEPCION_SOBRECARGA, e);
                }
                catch (ParametroInvalidoException e)
                {
                    Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, e);
                    throw e;
                }
                catch (ExceptionSKDConexionBD e)
                {
                    Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, e);
                    throw e;
                }
                catch (ExceptionSKD e)
                {
                    Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, e);
                    throw e;
                }
                catch (Exception e)
                {
                    Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, e);
                    throw new ExceptionSKD(RecursosBDModulo16.CODIGO_EXCEPCION_GENERICO,
                        RecursosBDModulo16.MENSAJE_EXCEPCION_GENERICO, e);
                }
                #endregion
        }
コード例 #24
0
ファイル: Asistencia.cs プロジェクト: tjsearsz/MINESANTED
 public Asistencia(String asistio, Inscripcion inscripcion, Evento evento)
 {
     this.asistio = asistio;
     this.inscripcion = inscripcion;
     this.evento = evento;
 }
コード例 #25
0
ファイル: belEventosNFe.cs プロジェクト: dramosti/GeraXml_3.0
        private string GetMsgDados()
        {
            string sVersao = "1.00";
            belEnvEvento objEnvEvento = new belEnvEvento();
            objEnvEvento.idLote = Util.GetNumeroNFe(this.xChaveNFe).PadLeft(15, '0');
            objEnvEvento.versao = sVersao;
            Evento evento = new Evento();
            evento.versao = sVersao;
            evento.infEvento = new eventoInfEvento();
            evento.infEvento.tpEvento = this.xCodEvento;
            evento.infEvento.nSeqEvento = this.iNumEvento.ToString();

            evento.infEvento.nSeqEvento = iNumEvento.ToString(); // numero de evento
            evento.infEvento.Id = "ID" + evento.infEvento.tpEvento + this.xChaveNFe + evento.infEvento.nSeqEvento.PadLeft(2, '0');
            evento.infEvento.cOrgao = 91;
            evento.infEvento.tpAmb = Convert.ToByte(Acesso.TP_AMB);
            evento.infEvento.CNPJ = Util.RetiraCaracterCNPJ(Acesso.CNPJ_EMPRESA);
            evento.infEvento.chNFe = this.xChaveNFe;
            evento.infEvento.dhEvento = daoUtil.GetDateServidor().ToString("yyyy-MM-ddTHH:mm:ss" + Acesso.FUSO);
            evento.infEvento.verEvento = sVersao;
            evento.infEvento.detEvento = new eventoInfEventoDetEvento();
            evento.infEvento.detEvento.versao = sVersao;
            evento.infEvento.detEvento.descEvento = lTpEventos.FirstOrDefault(c => c.Key == this.xCodEvento).Value;
            evento.infEvento.detEvento.nProt = this.xProt;
            evento.infEvento.detEvento.xJust = this.xJust != "" ? this.xJust : null;

            string sEvento = "";

            XmlSerializerNamespaces nameSpaces = new XmlSerializerNamespaces();
            nameSpaces.Add("", "");
            nameSpaces.Add("", "http://www.portalfiscal.inf.br/nfe");


            XmlSerializer xs = new XmlSerializer(typeof(Evento));
            MemoryStream memory = new MemoryStream();
            XmlTextWriter xmltext = new XmlTextWriter(memory, Encoding.UTF8);
            xs.Serialize(xmltext, evento, nameSpaces);
            UTF8Encoding encoding = new UTF8Encoding();
            sEvento = encoding.GetString(memory.ToArray());
            sEvento = sEvento.Substring(1);



            belAssinaXml Assinatura = new belAssinaXml();
            sEvento = Assinatura.ConfigurarArquivo(sEvento, "infEvento", Acesso.cert_NFe);

            string sXMLfinal = "<?xml version=\"1.0\" encoding=\"utf-8\"?><envEvento xmlns=\"http://www.portalfiscal.inf.br/nfe\" versao=\"1.00\"><idLote>" + objEnvEvento.idLote
                                + "</idLote>" + sEvento.Replace("<?xml version=\"1.0\" encoding=\"utf-8\"?>", "") + "</envEvento>";

            XmlDocument xDoc = new XmlDocument();
            xDoc.LoadXml(sXMLfinal);

            string sPath = "";

            if (this.tpEvento == tipoEvento.CANCELAMENTO)
            {
                sPath = Pastas.PROTOCOLOS + "\\" + objEnvEvento.idLote + "_ped-can.xml";
            }
            else if (tpEvento == tipoEvento.MANIFESTO)
            {
                sPath = Pastas.PROTOCOLOS + "\\" + objEnvEvento.idLote + "_" + this.xCodEvento + "_maniEvent.xml";
            }


            if (File.Exists(sPath))
            {
                File.Delete(sPath);
            }
            xDoc.Save(sPath);
            try
            {
                if (this.tpEvento == tipoEvento.CANCELAMENTO)
                {
                    belValidaXml.ValidarXml("http://www.portalfiscal.inf.br/nfe", Pastas.SCHEMA_CANC + "\\envEventoCancNFe_v1.00.xsd", sPath);
                }
                else if (tpEvento == tipoEvento.MANIFESTO)
                {
                    belValidaXml.ValidarXml("http://www.portalfiscal.inf.br/nfe", Pastas.SCHEMA_MANIFESTACAO + "\\envConfRecebto_v1.00.xsd", sPath);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return sXMLfinal;
        }
コード例 #26
0
        // PUT: api/Eventos/5
        public void Put(int id, [FromBody] Evento ev)
        {
            var repo = new EventoRepository();

            repo.Update(id, ev);
        }
コード例 #27
0
        public async Task <IActionResult> FormularioCrearCausa(AnalisisCausaRaizModels rca, List <IFormFile> files)
        {
            int contador = 0;

            string[] filename2;
            string   eventoid = rca.EventoId;

            if (ModelState.IsValid)
            {
                foreach (var formFile in files)
                {
                    contador++;

                    if (formFile.Length > 0)
                    {
                        string cadena = formFile.FileName;
                        filename2 = cadena.Split('.');
                        if (filename2.Last().Equals("doc") || filename2.Last().Equals("docx") || filename2.Last().Equals("txt") || filename2.Last().Equals("csv") || filename2.Last().Equals("pdf") || filename2.Last().Equals("xls") || filename2.Last().Equals("xlsx") || filename2.Last().Equals("odp") || filename2.Last().Equals("ods") || filename2.Last().Equals("odt") || filename2.Last().Equals("vsd") || filename2.Last().Equals("pptx") || filename2.Last().Equals("ppt") || filename2.Last().Equals("potx") || filename2.Last().Equals("png") || filename2.Last().Equals("jpg") || filename2.Last().Equals("jpeg") || filename2.Last().Equals("ico") || filename2.Last().Equals("webp") || filename2.Last().Equals("avi") || filename2.Last().Equals("mp4") || filename2.Last().Equals("mpeg") || filename2.Last().Equals("mpg") || filename2.Last().Equals("ogv") || filename2.Last().Equals("webm") || filename2.Last().Equals("mp3") || filename2.Last().Equals("wav") || filename2.Last().Equals("oga") || filename2.Last().Equals("aac") || filename2.Last().Equals("mid") || filename2.Last().Equals("midi") || filename2.Last().Equals("weba") || filename2.Last().Equals("rar") || filename2.Last().Equals("zip") || filename2.Last().Equals("bz") || filename2.Last().Equals("bz2"))
                        {
                            //ModelState.AddModelError("Error1", "no hay Error en el formato del archivo" + " " + filename2.Last());
                        }
                        else
                        {
                            ModelState.AddModelError("Error2", "Error en el formato del archivo" + " " + "." + filename2.Last());
                            return(await FormularioCrearCausa(eventoid));
                        }
                    }
                }



                string          creadorRCA  = null;
                ClaimsPrincipal currentUser = User;
                if (db.AspNetUsers.FirstOrDefault(c => c.Id.Equals(currentUser.getUserId())).RutPersona != null)
                {
                    creadorRCA = db.AspNetUsers.FirstOrDefault(c => c.Id.Equals(currentUser.getUserId())).RutPersona;
                }

                AnalisisCausaRaiz acr = new AnalisisCausaRaiz()
                {
                    IdEvento           = rca.EventoId,
                    Creador            = creadorRCA,
                    FechaRegistro      = rca.FechaRegistro,
                    IdOrigenFalla      = rca.OrigenFalla,
                    IdFallaPrimaria    = rca.FallaPrimaria,
                    IdFallaSecundaria  = rca.FallaSecundaria,
                    IdCausa1           = rca.Causa1,
                    IdCausa2           = rca.Causa2,
                    IdCausa3           = rca.Causa3,
                    IdCausa4           = rca.Causa4,
                    IdCausa5           = rca.Causa5,
                    IdCausaIntermedia1 = rca.CausaIntermedia1,
                    IdCausaIntermedia2 = rca.CausaIntermedia2,
                    IdProceso1         = rca.Proceso1,
                    IdProceso2         = rca.Proceso2,
                    IdProceso3         = rca.Proceso3,
                    IdProceso4         = rca.Proceso4,
                    IdProceso5         = rca.Proceso5,
                    Descripcion        = rca.Descripcion,
                    Costo   = rca.Costo,
                    Removed = false,
                };
                db.AnalisisCausaRaiz.Add(acr);
                db.SaveChanges();

                if (rca.EventoUnico.Ncaceptada == true)
                {
                    Evento UpdateEvento = db.Evento.FirstOrDefault(c => c.Id == rca.EventoId);
                    UpdateEvento.Ncaceptada = true;
                    UpdateEvento.Estado     = 5;
                    db.Evento.Update(UpdateEvento);
                    db.SaveChanges();
                }
                else
                {
                    if (rca.EventoUnico.Ncaceptada == false)
                    {
                        Evento UpdateEvento = db.Evento.FirstOrDefault(c => c.Id == rca.EventoId);
                        UpdateEvento.Ncaceptada = false;
                        UpdateEvento.Estado     = 10;
                        db.Evento.Update(UpdateEvento);
                        db.SaveChanges();
                    }
                }

                // full path to file in temp location
                var filePath = Path.GetTempFileName();

                string direccionRCAId = db.AnalisisCausaRaiz.FirstOrDefault(c => c.IdEvento == rca.EventoId).Id.TrimEnd();

                string concatenar = rca.EventoId.TrimEnd() + "/" + "AnalisisCausaRaiz" + "/" + direccionRCAId;

                foreach (var formFile in files)
                {
                    if (formFile.Length > 0)
                    {
                        string uploadPath = Path.Combine(_enviroment.WebRootPath, "uploads");
                        Directory.CreateDirectory(Path.Combine(uploadPath, concatenar));
                        string filename = formFile.FileName;
                        using (FileStream fs = new FileStream(Path.Combine(uploadPath, concatenar, filename), FileMode.Create))
                        {
                            await formFile.CopyToAsync(fs);
                        }

                        Archivo ar = new Archivo()
                        {
                            Identificador = rca.EventoId.TrimEnd(),
                            Nombre        = filename,
                            Tipo          = "AnalisisCausaRaiz",
                            Removed       = false,
                            FechaRegistro = DateTime.Now,
                        };
                        db.Archivo.Add(ar);
                        db.SaveChanges();
                    }
                }

                return(RedirectToAction("Index", "EventoSecuencia", new { EventoID = rca.EventoId }));
            }
            else
            {
                return(await FormularioCrearCausa(rca.EventoId.TrimEnd()));
            }
        }
コード例 #28
0
 public void Limpiar()
 {
     this.daoPrueba = null;
     this.persona = null;
     this.persona2 = null;
     this.persona3 = null;
     this.persona4 = null;
     this.persona5 = null;
     this.persona6 = null;
     this.implemento = null;
     this.implemento2 = null;
     this.listaEventos = null;
     this.matricula = null;
     this.matricula2 = null;
     this.ImplementosCarrito = null;
     this.EventosCarrito = null;
     this.MatriculasCarrito = null;
     this.evento = null;
 }
コード例 #29
0
 public CalcularDiferenciaXMes(Evento _evento) : base(_evento)
 {
     base.unidad = "meses";
 }
コード例 #30
0
ファイル: Reference.cs プロジェクト: rmlalves/NetPonto.App
 public static Evento CreateEvento(int ID, global::System.DateTime data)
 {
     Evento evento = new Evento();
     evento.Id = ID;
     evento.Data = data;
     return evento;
 }
コード例 #31
0
 public void Editar(Evento item)
 {
     throw new NotImplementedException();
 }
コード例 #32
0
ファイル: Reference.cs プロジェクト: rmlalves/NetPonto.App
 public void AddToEventos(Evento evento)
 {
     base.AddObject("Eventos", evento);
 }
コード例 #33
0
ファイル: Consulta.aspx.cs プロジェクト: marlonps/OpenSARC
 public AlocacaoTmp(BusinessData.Entities.Recurso r, DateTime d, string h, Aula a, Evento e)
     : base(r,d,h,a,e)
 {
 }
コード例 #34
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Session["listaHorariosExcluidos"] = listaHorariosExcluidos;
         Session["listaHorariosAdicionados"] = listaHorariosAdicionados;
         PopulaDDLFim();
         if (Request.QueryString["GUID"] != null)
         {
             Session["EventoId"] = new Guid(Request.QueryString["GUID"]);
             try
             {
                 EventoBO eventoBO = new EventoBO();
                 try
                 {
                     evento = eventoBO.GetEventoById(new Guid(Request.QueryString["GUID"]));
                     if (evento == null)
                         Response.Redirect("~/Eventos/ListaEventos.aspx");
                     ativaHorarios();
                     txtTitulo.Text = evento.Titulo;
                     txtResponsavel.Text = evento.Responsavel;
                     txtUnidade.Text = evento.Unidade;
                     txtaDescricao.Text = evento.Descricao;
                 }
                 catch (FormatException )
                 {
                     Response.Redirect("~/Eventos/ListaEventosFuturos.aspx");
                 }
             }
             catch (BusinessData.DataAccess.DataAccessException )
             {
                 Response.Redirect("~/Eventos/ListaEventosFuturos.aspx");
             }
         }
         else
         {
             Response.Redirect("~/Eventos/ListaEventosFuturos.aspx");
         }
     }
 }
コード例 #35
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        try
        {
            Guid eventoId = (Guid)Session["EventoId"];
            evento = eventoBO.GetEventoById(eventoId);

            if (evento != null)
            {
                listaHorarios = (List<HorariosEvento>)Session["listaHorarios"];
                listaHorariosExcluidos = (List<HorariosEvento>)Session["listaHorariosExcluidos"];
                listaHorariosAdicionados = (List<HorariosEvento>)Session["listaHorariosAdicionados"];
                evento.Titulo = txtTitulo.Text;
                evento.Responsavel = txtResponsavel.Text;
                evento.Unidade = txtUnidade.Text;
                evento.Descricao = txtaDescricao.Text;
                eventoBO.UpdateEvento(evento);
                if (listaHorarios.Count != 0)
                {
                    foreach (HorariosEvento horario in listaHorariosAdicionados)
                    {
                        horario.EventoId = evento;
                        horariosEventoBO.InsereHorariosEvento(horario);
                    }
                    foreach (HorariosEvento horario in listaHorariosExcluidos)
                    {
                        horariosEventoBO.DeletaHorariosEvento(horario.HorariosEventoId);
                    }
                    Response.Redirect("~/Eventos/ListaEventos.aspx");
                }
                else
                    lblResultado.Text = "Nenhum horário escolhido para o evento.";
            }
            else
            {
                throw new InvalidOperationException();
            }
        }
        catch (InvalidOperationException)
        {
            Response.Redirect("~/Default/Erro.aspx?Erro=" + "Evento não existente.");
        }
        catch (System.Threading.ThreadAbortException)
        {
            Response.Redirect("~/Eventos/ListaEventos.aspx");
        }
        catch (Exception ex)
        {
            Response.Redirect("~/Default/Erro.aspx?Erro=" + ex.Message);
        }
    }
コード例 #36
0
 public void ConvidarUsuario(Evento usuarioConvidado)
 {
     throw new NotImplementedException();
 }
コード例 #37
0
 private void EliminarEvento()
 {
     Evento.Baja(Convert.ToInt32(gridEventos.SelectedRows[0].Cells[0].Value));
 }
コード例 #38
0
 public void Incluir(Evento oEvento)
 {
     _db.Evento.Add(oEvento);
     _db.SaveChanges();
 }
コード例 #39
0
 public void Delete(Evento evento)
 {
     db.Eventos.DeleteOnSubmit(evento);
 }
コード例 #40
0
 public void Alterar(Evento oEvento)
 {
     _db.Entry(oEvento).State = System.Data.Entity.EntityState.Modified;
     _db.SaveChanges();
 }
コード例 #41
0
        //examen

        /*
         * public List<Evento> Get(string equipo)
         * {
         *  var repo = new EventoRepository();
         *  return repo.RetrieveByTeam(equipo);
         *
         * }*/


        // POST: api/Eventos
        public void Post([FromBody] Evento evento)
        {
            var repo = new EventoRepository();

            repo.Save(evento);
        }
コード例 #42
0
 public void Excluir(Evento oEvento)
 {
     _db.Entry(oEvento).State = System.Data.Entity.EntityState.Deleted;
     _db.SaveChanges();
 }
コード例 #43
0
        public IEnumerable <Bitacora> ObtenerTodasLasEntradasEnBitacora(ITraductor traductor, DateTime desde, DateTime hasta, Evento evento)
        {
            if (evento != null && evento.Id < 0)
            {
                evento = null;
            }

            return(this.ObtenerTodasLasEntradasEnBitacora(traductor)
                   .Where(l => l.CreatedOn >= desde && l.CreatedOn <= hasta)
                   .Where(l => evento == null || evento.Id.Equals(l.Evento.Id)));
        }
コード例 #44
0
        // GET: Evento/Details/5
        public ActionResult Details(int id)
        {
            Evento result = _eventoRepository.ObterPorId(id);

            return(View(SetEventoViewModel(result)));
        }
コード例 #45
0
        public async Task <IActionResult> FormularioEditCausa(AnalisisCausaRaizModels Edit, List <IFormFile> files)
        {
            int contador = 0;

            string[] filename2;
            if (ModelState.IsValid)
            {
                foreach (var formFile in files)
                {
                    contador++;

                    if (formFile.Length > 0)
                    {
                        string cadena = formFile.FileName;
                        filename2 = cadena.Split('.');
                        if (filename2.Last().Equals("doc") || filename2.Last().Equals("docx") || filename2.Last().Equals("txt") || filename2.Last().Equals("csv") || filename2.Last().Equals("pdf") || filename2.Last().Equals("xls") || filename2.Last().Equals("xlsx") || filename2.Last().Equals("odp") || filename2.Last().Equals("ods") || filename2.Last().Equals("odt") || filename2.Last().Equals("vsd") || filename2.Last().Equals("pptx") || filename2.Last().Equals("ppt") || filename2.Last().Equals("potx") || filename2.Last().Equals("png") || filename2.Last().Equals("jpg") || filename2.Last().Equals("jpeg") || filename2.Last().Equals("ico") || filename2.Last().Equals("webp") || filename2.Last().Equals("avi") || filename2.Last().Equals("mp4") || filename2.Last().Equals("mpeg") || filename2.Last().Equals("mpg") || filename2.Last().Equals("ogv") || filename2.Last().Equals("webm") || filename2.Last().Equals("mp3") || filename2.Last().Equals("wav") || filename2.Last().Equals("oga") || filename2.Last().Equals("aac") || filename2.Last().Equals("mid") || filename2.Last().Equals("midi") || filename2.Last().Equals("weba") || filename2.Last().Equals("rar") || filename2.Last().Equals("zip") || filename2.Last().Equals("bz") || filename2.Last().Equals("bz2"))
                        {
                            //ModelState.AddModelError("Error1", "no hay Error en el formato del archivo" + " " + filename2.Last());
                        }
                        else
                        {
                            ModelState.AddModelError("Error2", "Error en el formato del archivo" + " " + "." + filename2.Last());
                            return(await FormularioEditCausa(Edit.RCAUnica.Id, Edit.EventoId));
                        }
                    }
                }



                AnalisisCausaRaiz updateRCA = db.AnalisisCausaRaiz.FirstOrDefault(c => c.Id == Edit.RCAUnica.Id);
                updateRCA.Descripcion        = Edit.Descripcion;
                updateRCA.IdOrigenFalla      = Edit.RCAUnica.IdOrigenFalla;
                updateRCA.FechaRegistro      = Edit.FechaRegistro;
                updateRCA.IdCausa1           = Edit.Causa1;
                updateRCA.IdCausa2           = Edit.Causa2;
                updateRCA.IdCausa3           = Edit.Causa3;
                updateRCA.IdCausa4           = Edit.Causa4;
                updateRCA.IdCausa5           = Edit.Causa5;
                updateRCA.IdCausaIntermedia1 = Edit.CausaIntermedia1;
                updateRCA.IdCausaIntermedia2 = Edit.CausaIntermedia2;
                updateRCA.IdFallaPrimaria    = Edit.FallaPrimaria;
                updateRCA.IdFallaSecundaria  = Edit.FallaSecundaria;
                updateRCA.Costo      = Convert.ToInt64(Edit.RCAUnica.Costo);
                updateRCA.IdProceso1 = Edit.Proceso1;
                updateRCA.IdProceso2 = Edit.Proceso2;
                updateRCA.IdProceso3 = Edit.Proceso3;
                updateRCA.IdProceso4 = Edit.Proceso4;
                updateRCA.IdProceso5 = Edit.Proceso5;

                db.AnalisisCausaRaiz.Update(updateRCA);
                db.SaveChanges();


                if (Edit.EventoUnico.Ncaceptada == true)
                {
                    Evento UpdateEvento = db.Evento.FirstOrDefault(c => c.Id == Edit.EventoId);
                    UpdateEvento.Ncaceptada = true;
                    UpdateEvento.Estado     = 5;
                    db.Evento.Update(UpdateEvento);
                    db.SaveChanges();
                }
                else
                {
                    if (Edit.EventoUnico.Ncaceptada == false)
                    {
                        Evento UpdateEvento = db.Evento.FirstOrDefault(c => c.Id == Edit.EventoId);
                        UpdateEvento.Ncaceptada = false;
                        UpdateEvento.Estado     = 10;
                        db.Evento.Update(UpdateEvento);
                        db.SaveChanges();
                    }
                }

                var    filePath       = Path.GetTempFileName();
                string direccionRCAId = db.AnalisisCausaRaiz.FirstOrDefault(c => c.IdEvento == updateRCA.IdEvento).Id.TrimEnd();
                string concatenar     = updateRCA.IdEvento.TrimEnd() + "/" + "AnalisisCausaRaiz" + "/" + direccionRCAId;
                foreach (var formFile in files)
                {
                    if (formFile.Length > 0)
                    {
                        string uploadPath = Path.Combine(_enviroment.WebRootPath, "uploads");
                        Directory.CreateDirectory(Path.Combine(uploadPath, concatenar));
                        string filename = formFile.FileName;
                        using (FileStream fs = new FileStream(Path.Combine(uploadPath, concatenar, filename), FileMode.Create))
                        {
                            await formFile.CopyToAsync(fs);
                        }

                        Archivo ar = new Archivo()
                        {
                            Identificador = updateRCA.IdEvento.TrimEnd(),
                            Nombre        = filename,
                            Tipo          = "AnalisisCausaRaiz",
                            Removed       = false,
                            FechaRegistro = DateTime.Now,
                        };
                        db.Archivo.Add(ar);
                        db.SaveChanges();
                    }
                }
                return(RedirectToAction("Index", "EventoSecuencia", new { EventoID = Edit.EventoId }));
            }
            else
            {
                return(await FormularioEditCausa(Edit.RCAUnica.Id, Edit.EventoId.TrimEnd()));
            }
        }
コード例 #46
0
 public CalcularDiferenciaXDia(Evento _evento) : base(_evento)
 {
     base.unidad = "días";
 }
コード例 #47
0
        private string GetMsgDados()
        {
            string       sVersao      = "1.00";
            belEnvEvento objEnvEvento = new belEnvEvento();

            objEnvEvento.idLote = Util.GetNumeroNFe(this.xChaveNFe).PadLeft(15, '0');
            objEnvEvento.versao = sVersao;
            Evento evento = new Evento();

            evento.versao               = sVersao;
            evento.infEvento            = new eventoInfEvento();
            evento.infEvento.tpEvento   = this.xCodEvento;
            evento.infEvento.nSeqEvento = this.iNumEvento.ToString();

            evento.infEvento.nSeqEvento           = iNumEvento.ToString(); // numero de evento
            evento.infEvento.Id                   = "ID" + evento.infEvento.tpEvento + this.xChaveNFe + evento.infEvento.nSeqEvento.PadLeft(2, '0');
            evento.infEvento.cOrgao               = 91;
            evento.infEvento.tpAmb                = Convert.ToByte(Acesso.TP_AMB);
            evento.infEvento.CNPJ                 = Util.RetiraCaracterCNPJ(Acesso.CNPJ_EMPRESA);
            evento.infEvento.chNFe                = this.xChaveNFe;
            evento.infEvento.dhEvento             = daoUtil.GetDateServidor().ToString("yyyy-MM-ddTHH:mm:ss" + Acesso.FUSO);
            evento.infEvento.verEvento            = sVersao;
            evento.infEvento.detEvento            = new eventoInfEventoDetEvento();
            evento.infEvento.detEvento.versao     = sVersao;
            evento.infEvento.detEvento.descEvento = lTpEventos.FirstOrDefault(c => c.Key == this.xCodEvento).Value;
            evento.infEvento.detEvento.nProt      = this.xProt;
            evento.infEvento.detEvento.xJust      = this.xJust != "" ? this.xJust : null;

            string sEvento = "";

            XmlSerializerNamespaces nameSpaces = new XmlSerializerNamespaces();

            nameSpaces.Add("", "");
            nameSpaces.Add("", "http://www.portalfiscal.inf.br/nfe");


            XmlSerializer xs      = new XmlSerializer(typeof(Evento));
            MemoryStream  memory  = new MemoryStream();
            XmlTextWriter xmltext = new XmlTextWriter(memory, Encoding.UTF8);

            xs.Serialize(xmltext, evento, nameSpaces);
            UTF8Encoding encoding = new UTF8Encoding();

            sEvento = encoding.GetString(memory.ToArray());
            sEvento = sEvento.Substring(1);



            belAssinaXml Assinatura = new belAssinaXml();

            sEvento = Assinatura.ConfigurarArquivo(sEvento, "infEvento", Acesso.cert_NFe);

            string sXMLfinal = "<?xml version=\"1.0\" encoding=\"utf-8\"?><envEvento xmlns=\"http://www.portalfiscal.inf.br/nfe\" versao=\"1.00\"><idLote>" + objEnvEvento.idLote
                               + "</idLote>" + sEvento.Replace("<?xml version=\"1.0\" encoding=\"utf-8\"?>", "") + "</envEvento>";

            XmlDocument xDoc = new XmlDocument();

            xDoc.LoadXml(sXMLfinal);

            string sPath = "";

            if (this.tpEvento == tipoEvento.CANCELAMENTO)
            {
                sPath = Pastas.PROTOCOLOS + "\\" + objEnvEvento.idLote + "_ped-can.xml";
            }
            else if (tpEvento == tipoEvento.MANIFESTO)
            {
                sPath = Pastas.PROTOCOLOS + "\\" + objEnvEvento.idLote + "_" + this.xCodEvento + "_maniEvent.xml";
            }


            if (File.Exists(sPath))
            {
                File.Delete(sPath);
            }
            xDoc.Save(sPath);
            try
            {
                if (this.tpEvento == tipoEvento.CANCELAMENTO)
                {
                    belValidaXml.ValidarXml("http://www.portalfiscal.inf.br/nfe", Pastas.SCHEMA_CANC + "\\envEventoCancNFe_v1.00.xsd", sPath);
                }
                else if (tpEvento == tipoEvento.MANIFESTO)
                {
                    belValidaXml.ValidarXml("http://www.portalfiscal.inf.br/nfe", Pastas.SCHEMA_MANIFESTACAO + "\\envConfRecebto_v1.00.xsd", sPath);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(sXMLfinal);
        }
コード例 #48
0
 public static Evento CreateEvento(int id)
 {
     Evento evento = new Evento();
     evento.Id = id;
     return evento;
 }
コード例 #49
0
 public void Add(Evento obj)
 {
     //
 }
コード例 #50
0
    protected void dgEventos_ItemCommand(object sender, DataGridCommandEventArgs e)
    {
        if (e.CommandName == "Transferir")
        {
            if (rblRecursos.SelectedValue != "")
            {
                DateTime data    = Convert.ToDateTime(Session["Data"]);
                Guid     aulaId  = new Guid(Session["EventoId"].ToString());
                string   horario = (string)Session["Horario"];

                Guid         recId       = new Guid(rblRecursos.SelectedValue);
                List <Troca> listaTrocas = trocaBO.GetNaoVisualizadasByEvento(aulaId, data, horario);

                bool controle = false;
                //verifica se o recurso n esta envolvido em alguma troca
                if (listaTrocas.Count != 0)
                {
                    foreach (Troca t in listaTrocas)
                    {
                        if (t.AlocacaoAtual.Recurso.Id == recId || t.AlocacaoDesejada.Recurso.Id == recId)
                        {
                            controle = true;
                        }
                    }
                }
                if (!controle)
                {
                    Alocacao aloc = alocBO.GetAlocacao(recId, data, horario);

                    Label lblEventoId = (Label)e.Item.FindControl("lblEventoId");

                    Turma turmaRecebeu = null;
                    Turma turmaTrans   = null;

                    Guid   eventoTransId = new Guid(Session["EventoId"].ToString());
                    Evento eventoTrans   = eventoBO.GetEventoById(eventoTransId);
                    Evento eventoRec     = eventoBO.GetEventoById(new Guid(lblEventoId.Text));

                    Transferencia trans = new Transferencia(Guid.NewGuid(), aloc.Recurso, data, horario, turmaRecebeu, turmaTrans, false, eventoRec, eventoTrans);

                    aloc.Horario = horario;
                    aloc.Evento  = eventoRec;

                    alocBO.UpdateAlocacao(aloc);

                    transBO.InsereTransferencia(trans);

                    FechaJanela();
                }
                else
                {
                    lblStatus.Text = "Este recurso não pode ser transferido por estar envolvido numa troca.";
                    ddlResponsavel.SelectedIndex = 0;
                    dgEventos.Visible            = false;
                }
            }
            else
            {
                lblStatus.Text = "Selecione um recurso para efetuar a transferência";
            }
        }
    }
コード例 #51
0
 public AttendantsViewModel(INavigation Navigation, Evento evento)
 {
     this.Navigation = Navigation;
     this.evento     = evento;
     InitializeDataAsync();
 }
コード例 #52
0
ファイル: GestorEventos.cs プロジェクト: degva/LP2Proyects
 public void AgregarEvento(Evento objEvento)
 {
     this.ListaEventos.Add(objEvento);
 }
コード例 #53
0
ファイル: NFBase.cs プロジェクト: njmube/openposbr
        /// <summary>
        /// Método utilizado para preencher esta instância com os dados do dataReader
        /// </summary>
        /// <param name="dataReader">DataReader com os dados que deverão ser passados para esta instância</param>
        public override void Populate(DataReader dataReader)
        {
            #region base
            base.Populate(dataReader);
            #endregion

            StatusNF = dataReader.GetInt("p_StatusNF") == 0 ?
                OpenPOS.NFe.Status.LoteEmProcessamento :
                dataReader.GetInt("p_StatusNF");
            Motivo = dataReader.GetString("p_Motivo");
            InfProt = dataReader.GetString("p_InfProt");
            Chave = dataReader.GetString("p_Chave");
            InformacoesAdicionais = new InfAdic().Find<IInfAdic, INF>(new Where()
            {
                { "fat_LanMovNF.GUIDLanMov",GUID.ToString() }
            }, this);
            Eventos = new Evento().Find<IEvento, INF>(new Where()
            {
                { "fat_LanMovNF.GUIDLanMov",GUID.ToString() }
            }, this);
        }
コード例 #54
0
 public override int ContarTotalOficinas(Evento mEvento)
 {
     return(mSessao.QueryOver <Oficina>().RowCount());
 }
コード例 #55
0
 public Task <Localizacao> Alterar(Evento evento)
 {
     throw new System.NotImplementedException();
 }
コード例 #56
0
        public override IList <InscricaoParticipante> ListarParticipantesSemOficinaNoEvento(Evento evento)
        {
            InscricaoParticipante      aliasParticipante = null;
            AtividadeInscricaoOficinas aliasAtividade    = null;

            var subQueryParticipantes = QueryOver.Of <Oficina>()
                                        .JoinQueryOver <InscricaoParticipante>(x => x.Participantes, () => aliasParticipante)
                                        .Where(x => x.Id == aliasAtividade.Inscrito.Id)
                                        .SelectList(x => x.Select(() => aliasParticipante.Id));

            var subQueryCoordenadores = QueryOver.Of <AtividadeInscricaoOficinasCoordenacao>()
                                        .Where(x => x.Inscrito.Id == aliasAtividade.Id)
                                        .Select(x => x.Inscrito.Id);

            return(mSessao.QueryOver <AtividadeInscricaoOficinas>(() => aliasAtividade)
                   .JoinQueryOver(x => x.Inscrito)
                   .JoinQueryOver(y => y.Evento)
                   .Where(y => y.Id == evento.Id)
                   .WithSubquery.WhereNotExists(subQueryParticipantes)
                   .Select(x => x.Inscrito)
                   .List <InscricaoParticipante>());
        }
コード例 #57
0
        public void PruebaCarritoVariosItems()
        {
            //Ejecutamos el comando y casteamos
            this.Carrito = (Carrito)this.PruebaVerTodo.Ejecutar();

            /*Revisamos que hayan Implementos, Eventos y matriculas, ademas,
              que efectivamente haya solo uno agregado de cada uno de ellos*/
            Assert.IsTrue(this.Carrito.ListaImplemento.Count == 1);
            Assert.IsTrue(this.Carrito.Listaevento.Count == 1);
            Assert.IsTrue(this.Carrito.Listamatricula.Count == 1);

            //Obtenemos los items y verificamos sus valores
            this.implemento = this.Carrito.ListaImplemento.ElementAt(0).Key as Implemento;
            Assert.AreEqual(this.implemento.Id_Implemento, 1);
            Assert.AreEqual(this.implemento.Precio_Implemento, 4500);
            Assert.AreEqual(this.Carrito.ListaImplemento.ElementAt(0).Value, 5);

            this.evento = this.Carrito.Listaevento.ElementAt(0).Key as Evento;
            Assert.AreEqual(this.evento.Id_evento, 1);
            Assert.AreEqual(this.evento.Costo, 0);
            Assert.AreEqual(this.Carrito.Listaevento.ElementAt(0).Value, 6);

            this.matricula = this.Carrito.Listamatricula.ElementAt(0).Key as Matricula;
            Assert.AreEqual(this.matricula.Id, 1);
            //Assert.AreEqual(this.matricula.Costo, 5000);
            //PILAS CON EL COSTO ARREGLAR
            Assert.AreEqual(this.Carrito.Listamatricula.ElementAt(0).Value, 1);
        }
コード例 #58
0
 public void AdicionarEvento(Evento evento)
 {
     _notificacoes ??= new List <Evento>();
     _notificacoes.Add(evento);
 }
コード例 #59
0
      public IActionResult Post(Evento novoEvento)
      {
          _eventoRepository.Cadastrar(novoEvento);

          return(StatusCode(201));
      }
コード例 #60
0
    //LISTAR EVENTOS
    public static List<Evento> listarEvento(int idEmpresa)
    {
        List<Evento> lst = new List<Evento>();
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        //indico que voy a ejecutar un procedimiento almacenado en la bd
        cmd.CommandText = "Eventos_SelectAll";//indico el nombre del procedimiento almacenado a ejecutar

        SqlConnection cn = new SqlConnection(); //creamos y configuramos la conexion
        string cadenaConexion = ConfigurationManager.ConnectionStrings["conexionBD"].ConnectionString;
        cn.ConnectionString = cadenaConexion;

        SqlDataReader drResults;

        cmd.Connection = cn;
        cn.Open();//abrimos la conexion
        drResults = cmd.ExecuteReader(CommandBehavior.CloseConnection);
        while (drResults.Read())
        {
            //string retornoPrecios = "";
            Evento r = new Evento();
            r.idEvento = Convert.ToInt32(drResults["idEvento"]);
            r.Titulo = drResults["Titulo"].ToString();
            r.Descripcion = drResults["Descripcion"].ToString();
            r.NombreArtistas = drResults["NombreArtistas"].ToString();
            //r.Fecha = drResults["Fecha"].ToString;
            r.Hora = drResults["Hora"].ToString();
            r.NombreLugar = drResults["NombreLugar"].ToString();
            r.DireccionLugar = drResults["DireccionLugar"].ToString();
            r.DireccionLugar = drResults["BarrioLugar"].ToString();
            r.DireccionLugar = drResults["CapasidadMaxima"].ToString();
            //r.Imagen =
            //r.Imagen = drResults["imagen"].ToString();
            r.Precio = drResults["precio"].ToString();
            r.Estado = drResults["estado"].ToString();
            //r.NombreEmpresa = drResults["nombreEmpresa"].ToString();
            if (idEmpresa == -1 || idEmpresa == 0)//Entra si es -1
            {
                lst.Add(r);
            }
            else if (idEmpresa == Convert.ToInt32(drResults["IdEmpresa"]))//Entra si es un idEmpresa
            {
                lst.Add(r);
            }
        }
        drResults.Close();//luego de leer todos los registros le indicamos al reader que cierre la conexion
        cn.Close(); //cerramos la conexion explicitamente
        return lst;
    }