コード例 #1
0
        public IActionResult Create(int?steps, int?fields)
        {
            var templateSteps = new List <PlantillasPasosDetalle>();

            for (int i = 0; i < steps.GetValueOrDefault(); i++)
            {
                templateSteps
                .Add(new PlantillasPasosDetalle()
                {
                    PlantillasPasosUsuariosDetalle = new List <PlantillasPasosUsuariosDetalle>()
                });
            }
            var templateFields = new List <PlantillasCamposDetalle>();

            for (int i = 0; i < fields.GetValueOrDefault(); i++)
            {
                templateFields
                .Add(new PlantillasCamposDetalle());
            }
            var model = new Plantillas
            {
                PlantillasPasosDetalle  = templateSteps,
                PlantillasCamposDetalle = templateFields
            };

            SetupCreateViewBag(model);
            return(View(model));
        }
コード例 #2
0
        public async Task <IActionResult> Create(Plantillas plantillas)
        {
            if (ModelState.IsValid)
            {
                _context.Add(plantillas);
                var counter = 0;
                foreach (var item in plantillas.PlantillasPasosDetalle)
                {
                    counter++;

                    item.PasoNavigation.Numero = counter;
                }
                await _context.SaveChangesAsync();

                var stepsAndFieldsLinks = plantillas.PasosPlantillasCamposDetalle;
                foreach (var link in stepsAndFieldsLinks)
                {
                    link.Paso =
                        plantillas.PlantillasPasosDetalle[link.Paso].PasoNavigation.IdPaso;
                    link.PlantillaCampo =
                        plantillas.PlantillasCamposDetalle[link.PlantillaCampo].IdPlantillaCampo;
                }
                _context.AddRange(stepsAndFieldsLinks);
                await _context.SaveChangesAsync();

                TempData["Success"] = "Plantilla creada exitosamente";
                return(RedirectToAction(nameof(Index)));
            }
            SetupCreateViewBag(plantillas);
            return(View(plantillas));
        }
コード例 #3
0
 public IActionResult AddField(Plantillas plantilla)
 {
     plantilla.PlantillasCamposDetalle
     .Add(new PlantillasCamposDetalle());
     SetupCreateViewBag(plantilla);
     return(View(nameof(Create), plantilla));
 }
コード例 #4
0
 public IActionResult LinkStepsAndFields(Plantillas plantilla)
 {
     plantilla.PasosPlantillasCamposDetalle
     .Add(new PasosPlantillasCamposDetalle());
     SetupCreateViewBag(plantilla);
     return(View(nameof(Create), plantilla));
 }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string id      = Request.QueryString["id"];
                string cliente = AccesoDatos.RegresaCadena_1_ResultadoSql("Select cliente from CartasClientes where indice = " + id);
                this.lblCliente.Text = cliente;

                Plantillas Marco = new Plantillas();


                for (int i = 0; i < Marco.NumeroPlantillas; i++)
                {
                    TableCell c   = new TableCell();
                    TableRow  r   = new TableRow();
                    HyperLink hyp = new HyperLink();
                    hyp.Text        = Marco.listado[i].NombrePlantilla;
                    hyp.NavigateUrl = Marco.listado[i].Direccion + "?id=" + id;
                    c.Controls.Add(hyp);
                    r.Cells.Add(c);

                    Table1.Rows.Add(r);
                }
            }
            catch (Exception)
            {
            }
        }
コード例 #6
0
        public ActionResult Index()
        {
            var sucursal = Session["Sucursal"] as SucursalDatos;

            if (sucursal != null)
            {
                //Se obtienen los departamentos y los puestos que tiene la empresa para la recontratación
                Departamentos deptos  = new Departamentos();
                Puestos       puestos = new Puestos();
                ViewBag.Departamentos = deptos.ObtenerDepartamentosPorEmpresa(sucursal.IdCliente);
                ViewBag.Puestos       = puestos.ObtenerPuestosPorEmpresa(sucursal.IdCliente);

                ViewBag.IdSucursal = sucursal.IdSucursal;

                Plantillas pl = new Plantillas();
                ViewBag.Plantillas = pl.GetPlantillasByTipo((int)TipoPlantilla.Contrato, sucursal.IdCliente);

                ViewBag.PlantillasBaja = pl.GetPlantillasByTipo2((int)TipoPlantilla.Baja, sucursal.IdCliente);

                Empresas emp = new Empresas();
                ViewBag.Empresas = emp.GetEmpresasBySucursal(sucursal.IdSucursal);
                ViewBag.Esquemas = emp.GetEsquemas();

                return(View());
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
コード例 #7
0
        public async Task <IActionResult> Edit(int id, [Bind("IdPlantilla,Nombre,Descripcion")] Plantillas plantillas)
        {
            if (id != plantillas.IdPlantilla)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(plantillas);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlantillasExists(plantillas.IdPlantilla))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(plantillas));
        }
コード例 #8
0
        public string GenerarPlantillaContrato(int idPlantilla, int[] empleados)
        {
            Plantillas p    = new Plantillas();
            RHEntities ctx  = new RHEntities();
            var        tipo = ctx.Plantilla.Where(x => x.Id == idPlantilla).Select(x => x.Tipo).FirstOrDefault();

            if (tipo == 1)
            {
                return(p.FormarPlantilla(idPlantilla, (int)TipoPlantilla.Contrato, empleados));
            }
            else if (tipo == 7)
            {
                return(p.FormarPlantilla(idPlantilla, (int)TipoPlantilla.MovimientoPersonal, empleados));
            }
            else if (tipo == 8)
            {
                return(p.FormarPlantilla(idPlantilla, (int)TipoPlantilla.CartaAntiguedad, empleados));
            }
            else if (tipo == 9)
            {
                return(p.FormarPlantilla(idPlantilla, (int)TipoPlantilla.GastosMedicosMenores, empleados));
            }
            else if (tipo == 10)
            {
                return(p.FormarPlantilla(idPlantilla, (int)TipoPlantilla.Sindicato, empleados));
            }

            else
            {
                return("false");
            }
        }
コード例 #9
0
        public async Task <IActionResult> InstanciarPlantilla(int id)
        {
            var model = new Plantillas {
                IdPlantilla = id
            };

            return(View(model));
        }
コード例 #10
0
        public ActionResult RealDeleteConfirmed(string id)
        {
            Plantillas plantillas = db.PLANTILLAS.Find(id);

            db.PLANTILLAS.Remove(plantillas);
            db.SaveChanges();
            TempData["Type"]    = "error";
            TempData["Message"] = "El registro se eliminó correctamente";
            return(RedirectToAction("Index"));
        }
コード例 #11
0
 public IActionResult AddStep(Plantillas plantilla)
 {
     plantilla.PlantillasPasosDetalle
     .Add(new PlantillasPasosDetalle()
     {
         PlantillasPasosUsuariosDetalle = new List <PlantillasPasosUsuariosDetalle>()
     });
     SetupCreateViewBag(plantilla);
     return(View(nameof(Create), plantilla));
 }
コード例 #12
0
 public ActionResult Edit([Bind(Include = "Id,Descripcion,Estado,FechaDeInicio,FechaDeFin")] Plantillas plantillas)
 {
     if (ModelState.IsValid)
     {
         db.Entry(plantillas).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(plantillas));
 }
コード例 #13
0
        public async Task <IActionResult> Create(Plantillas plantillas)
        {
            if (ModelState.IsValid)
            {
                _context.Add(plantillas);
                await _context.SaveChangesAsync();

                TempData["Success"] = "Plantilla creada exitosamente";
                return(RedirectToAction(nameof(Index)));
            }
            SetupCreateViewBag();
            return(View(plantillas));
        }
コード例 #14
0
ファイル: VacacionesController.cs プロジェクト: IsraelBV/SUN
        public ActionResult ViewDetails(int idContrato = 0)
        {
            var sucursal = Session["Sucursal"] as SucursalDatos;

            var detalle = vaca.GetPeriodoVacacionesV2(idContrato);
            //var detalle = vaca.GetPeriodoVacaciones(id);
            Plantillas pl = new Plantillas();

            ViewBag.Plantillas = pl.GetPlantillasByTipo2((int)TipoPlantilla.Vacaciones, sucursal.IdCliente);
            //ViewBag.vaciones = vaca.GetVacaciones(id=10);

            return(PartialView("_PeriodoVacaciones", detalle));
        }
コード例 #15
0
        // GET: Plantillas/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Plantillas plantillas = db.PLANTILLAS.Find(id);

            if (plantillas == null)
            {
                return(HttpNotFound());
            }
            return(View(plantillas));
        }
コード例 #16
0
        private System.Data.DataTable ObtenerTablaFormatoDatosReporteResultado(int ano, int mes)
        {
            BLTarifario enlace = new BLTarifario();
            Tarifario   tar    = enlace.ObtenerTarifario();

            System.Data.DataTable tablaInterna = new System.Data.DataTable();
            try
            {
                LogicaOrden     enlaceOrden = new LogicaOrden();
                List <object[]> resultados  = enlaceOrden.ObtenerReporteResultado(ano, mes);

                tablaInterna.Columns.Add("dni", typeof(string));
                tablaInterna.Columns.Add("nombre", typeof(string));
                tablaInterna.Columns.Add("apellido1", typeof(string));
                tablaInterna.Columns.Add("apellido2", typeof(string));
                tablaInterna.Columns.Add("edad", typeof(double));
                tablaInterna.Columns.Add("sexo", typeof(string));
                tablaInterna.Columns.Add("gestante", typeof(string));
                tablaInterna.Columns.Add("Examen", typeof(string));
                tablaInterna.Columns.Add("respuesta", typeof(string));
                tablaInterna.Columns.Add("nota", typeof(string));
                tablaInterna.Columns.Add("cobertura", typeof(string));
                tablaInterna.Columns.Add("estado", typeof(string));

                foreach (object[] obt in resultados)
                {
                    DataRow row = tablaInterna.NewRow();
                    row[0]  = obt[1].ToString();
                    row[1]  = obt[2].ToString();
                    row[2]  = obt[3].ToString();
                    row[3]  = obt[4].ToString();
                    row[4]  = obt[5];
                    row[5]  = DiccionarioGeneral.GetInstance().TipoSexo[(int)obt[6]];
                    row[6]  = Convert.ToBoolean(obt[7])?"SI":"NO";
                    row[7]  = Plantillas.GetInstance().GetPlantilla((int)obt[0]).Nombre;
                    row[8]  = obt[8].ToString().Replace('.', ',');
                    row[9]  = obt[9];
                    row[10] = DiccionarioGeneral.GetInstance().TipoCobertura[(int)obt[10]];
                    row[11] = DiccionarioGeneral.GetInstance().EstadoExamen[(int)obt[11]];

                    tablaInterna.Rows.Add(row);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(tablaInterna);
        }
コード例 #17
0
        public ActionResult DeleteConfirmed(string id)
        {
            Plantillas plantillas = db.PLANTILLAS.Find(id);

            if (plantillas.Estado == "I")
            {
                plantillas.Estado = "A";
            }
            else
            {
                plantillas.Estado = "I";
            }
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #18
0
 public IActionResult AddUser(Plantillas plantilla, int step)
 {
     if (plantilla.PlantillasPasosDetalle[step].PlantillasPasosUsuariosDetalle == null)
     {
         plantilla.PlantillasPasosDetalle[step].PlantillasPasosUsuariosDetalle = new List <PlantillasPasosUsuariosDetalle>
         {
             new PlantillasPasosUsuariosDetalle()
         };
     }
     else
     {
         plantilla.PlantillasPasosDetalle[step].PlantillasPasosUsuariosDetalle.Add(new PlantillasPasosUsuariosDetalle());
     }
     SetupCreateViewBag();
     return(View(nameof(Create), plantilla));
 }
コード例 #19
0
ファイル: VacacionesController.cs プロジェクト: IsraelBV/SUN
        public ActionResult Index()
        {
            var sucursal = Session["Sucursal"] as SucursalDatos;

            if (sucursal != null)
            {
                var        empleados = vaca.ObtenerEmpleadosPorSucursal(sucursal.IdSucursal);
                Plantillas pl        = new Plantillas();
                ViewBag.Plantillas = pl.GetPlantillasByTipo2((int)TipoPlantilla.Vacaciones, sucursal.IdCliente);
                return(View(empleados));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
コード例 #20
0
        //ReporteInconformidad
        private static void EnviarObservacion(string correo, string observacion)
        {
            Plantillas pl = new Plantillas();

            EmailModel model = new EmailModel()
            {
                To       = Constantes.Constantes.correoSoporte + "," + correo,
                Email    = Constantes.Constantes.correoEnvia,
                Password = Constantes.Constantes.passwordEnvia,
                Subject  = Constantes.Constantes.tituloCorreoObservacion,
                Body     = pl.ReporteInconformidad(observacion)
            };

            using (MailMessage mm = new MailMessage(model.Email, model.To))
            {
                mm.Subject = model.Subject;

                mm.Body = model.Body;
                if (model.Attachment != null)
                {
                    if (model.Attachment.ContentLength > 0)
                    {
                        string fileName = Path.GetFileName(model.Attachment.FileName);
                        mm.Attachments.Add(new Attachment(model.Attachment.InputStream, fileName));
                    }
                }

                mm.IsBodyHtml = true;
                using (SmtpClient smtp = new SmtpClient())
                {
                    smtp.Host      = "smtp.gmail.com";
                    smtp.EnableSsl = true;
                    NetworkCredential NetworkCred = new NetworkCredential(model.Email, model.Password);
                    smtp.UseDefaultCredentials = true;
                    smtp.Credentials           = NetworkCred;
                    smtp.Port = 587;
                    smtp.Send(mm);
                }
            }
        }
コード例 #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string _id = Request.QueryString["id"].ToString();

                DocMerger Doc     = new DocMerger();
                string    archivo = Server.MapPath(".");
                Doc.CorrePlantilla1(_id, archivo);
                Plantillas Marco   = new Plantillas();
                string     address = archivo + Marco.listado[0].UbicacionMerge + _id + ".docx";


                MemoryStream memoryStream = new MemoryStream();
                using (Stream input = File.OpenRead(address))
                {
                    byte[] buffer = new byte[32 * 1024]; // 32K buffer for example
                    int    bytesRead;
                    while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0)
                    {
                        memoryStream.Write(buffer, 0, bytesRead);
                    }
                }
                memoryStream.Position = 0;
                string filenamesend = "attachment; filename=" + _id.ToString() + ".docx";

                Response.Clear();
                Response.ContentType = "Application/msword";
                Response.AddHeader("Content-Disposition", filenamesend);
                Response.BinaryWrite(memoryStream.ToArray());
                // myMemoryStream.WriteTo(Response.OutputStream); //works too
                Response.Flush();
                Response.Close();
                Response.End();
            }
            catch (Exception es)
            {
                //  Helper.RegistrarEvento("Plantilla 1 " + es.Message);
            }
        }
コード例 #22
0
ファイル: PanelPerfil.cs プロジェクト: game8149/MinLab
        private void RellenarExamenesEnTabla()
        {
            LogicaCuenta oLCuenta     = new LogicaCuenta();
            LogicaExamen enlaceExamen = new LogicaExamen();

            if (ordenes.Count > 0)
            {
                tabla.Clear();

                Cuenta account;

                examenesGeneral = new Dictionary <int, Examen>();
                Orden orden = ordenes[(int)ComboBoxOrden.SelectedValue];
                Dictionary <int, Examen> temp = enlaceExamen.RecuperarExamenes(orden);
                foreach (Examen ex in temp.Values)
                {
                    if (ex.Estado == Examen.EstadoExamen.Terminado)
                    {
                        this.SuspendLayout();
                        examenesGeneral.Add(ex.IdData, ex);
                        DataRow row = tabla.NewRow();
                        row[0] = ex.IdOrdenDetalle; //Orden Detalle
                        row[1] = ex.IdData;         //Examen
                        String nombrePaquete   = ControlSistemaInterno.ListaAnalisis.GetInstance().GetAnalisisById(orden.Detalle[ex.IdOrdenDetalle].IdDataPaquete).Nombre;
                        String nombrePlantilla = Plantillas.GetInstance().GetPlantilla(ex.IdPlantilla).Nombre;
                        row[2]  = (nombrePaquete == nombrePlantilla) ? nombrePaquete : (nombrePaquete + ":" + nombrePlantilla);
                        account = oLCuenta.ObtenerCuenta(ex.IdCuenta);
                        row[3]  = (account.Nombre + account.PrimerApellido).ToUpper() + " (" + account.Dni + ")";
                        row[4]  = ex.UltimaModificacion;
                        row[5]  = orden.IdData;
                        tabla.Rows.Add(row);
                        this.ResumeLayout(false);
                    }
                }

                BtnPrint.Visible = examenesGeneral.Count > 0;
            }
        }
コード例 #23
0
        public ActionResult Create([Bind(Include = "Id,Descripcion,Estado,FechaDeInicio,FechaDeFin")] Plantillas plantillas)
        {
            if (ModelState.IsValid)
            {
                db.PLANTILLAS.Add(plantillas);
                string mensaje = Verificar(plantillas.Id);
                if (mensaje == "")
                {
                    db.SaveChanges();
                    TempData["Type"]    = "success";
                    TempData["Message"] = "El registro se realizó correctamente";
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ViewBag.Type    = "warning";
                    ViewBag.Message = mensaje;
                    return(View(plantillas));
                }
            }

            return(View(plantillas));
        }
コード例 #24
0
        private void SetupCreateViewBag(Plantillas plantilla)
        {
            var steps = new List <SelectListItem>();

            for (int i = 0; i < plantilla.PlantillasPasosDetalle.Count; i++)
            {
                if (plantilla.PlantillasPasosDetalle[i].PasoNavigation == null)
                {
                    break;
                }
                steps.Add(
                    new SelectListItem
                {
                    Text  = plantilla.PlantillasPasosDetalle[i].PasoNavigation.Nombre,
                    Value = i.ToString()
                });
            }
            ViewData["Steps"] = steps;
            var fields = new List <SelectListItem>();

            for (int i = 0; i < plantilla.PlantillasCamposDetalle.Count; i++)
            {
                if (string.IsNullOrEmpty(plantilla.PlantillasCamposDetalle[i].NombreCampo))
                {
                    break;
                }
                fields.Add(
                    new SelectListItem
                {
                    Text  = plantilla.PlantillasCamposDetalle[i].NombreCampo,
                    Value = i.ToString()
                });
            }
            ViewData["Fields"]    = fields;
            ViewData["DataTypes"] = new SelectList(_context.DatoTipo, "IdDatoTipo", "Nombre");
            ViewData["Users"]     = new SelectList(_userManager.Users, "Id", "UserName");
        }
コード例 #25
0
 public static Dictionary <int, PlantillaItem> GetAllItemsByPlantilla(int idPlantilla)
 {
     return(Plantillas.GetInstance().GetPlantilla(idPlantilla).ItemsIndexed);
 }
コード例 #26
0
ファイル: VacacionesController.cs プロジェクト: IsraelBV/SUN
        public string GenerarPlantillaVacaciones(int idPlantilla, int[] vacaciones)
        {
            Plantillas p = new Plantillas();

            return(p.FormarPlantilla(idPlantilla, (int)TipoPlantilla.Vacaciones, vacaciones));
        }
コード例 #27
0
ファイル: DocMerger.cs プロジェクト: ErikZeus/Plantillas
    private string Direccion(string archivo, string carta)
    {
        Plantillas Marco = new Plantillas();

        if (carta == "Carta envío ramo 9")
        {
            return(archivo + Marco.listado[0].UbicacionPlantilla);
        }
        if (carta == "Carta envío ramo 123")
        {
            return(archivo + Marco.listado[1].UbicacionPlantilla);
        }
        if (carta == "Carta envío todos excepto 9 y 123")
        {
            return(archivo + Marco.listado[2].UbicacionPlantilla);
        }
        if (carta == "Envío endosos ramo 9")
        {
            return(archivo + Marco.listado[3].UbicacionPlantilla);
        }
        if (carta == "Envío endosos ramo 123")
        {
            return(archivo + Marco.listado[4].UbicacionPlantilla);
        }
        if (carta == "Envío Endosos todos excepto 9 y 123")
        {
            return(archivo + Marco.listado[5].UbicacionPlantilla);
        }
        if (carta == "Envío de Documentos Incendio")
        {
            return(archivo + Marco.listado[6].UbicacionPlantilla);
        }
        if (carta == "Envío de Documentos Equipo Electronico")
        {
            return(archivo + Marco.listado[7].UbicacionPlantilla);
        }
        if (carta == "Envío de Documentos en blanco")
        {
            return(archivo + Marco.listado[8].UbicacionPlantilla);
        }
        if (carta == "Envío de Documentos Autos")
        {
            return(archivo + Marco.listado[9].UbicacionPlantilla);
        }
        if (carta == "Envío de Cartapacio")
        {
            return(archivo + Marco.listado[10].UbicacionPlantilla);
        }
        if (carta == "Aviso de Renovación con Condiciones Autos")
        {
            return(archivo + Marco.listado[11].UbicacionPlantilla);
        }
        if (carta == "Envíos Varios en Blanco")
        {
            return(archivo + Marco.listado[12].UbicacionPlantilla);
        }
        if (carta == "Aviso de Renovación con Condiciones Incendio")
        {
            return(archivo + Marco.listado[13].UbicacionPlantilla);
        }
        if (carta == "Envío de Renovación Autos y Daños")
        {
            return(archivo + Marco.listado[14].UbicacionPlantilla);
        }
        if (carta == "Envío de Endoso Autos y Daños")
        {
            return(archivo + Marco.listado[15].UbicacionPlantilla);
        }
        if (carta == "Envío de Renovación  Nueva Autos  Daños")
        {
            return(archivo + Marco.listado[16].UbicacionPlantilla);
        }
        if (carta == "Envío de Documentos")
        {
            return(archivo + Marco.listado[17].UbicacionPlantilla);
        }
        if (carta == "Envío de liquidación de reclamo")
        {
            return(archivo + Marco.listado[18].UbicacionPlantilla);
        }
        if (carta == "Envío de Cheque y Liquidación de reclamo")
        {
            return(archivo + Marco.listado[19].UbicacionPlantilla);
        }
        if (carta == "Envío de Facturación")
        {
            return(archivo + Marco.listado[20].UbicacionPlantilla);
        }
        if (carta == "Envío de Endoso Vida y Gastos Médicos")
        {
            return(archivo + Marco.listado[21].UbicacionPlantilla);
        }
        if (carta == "Envío de Renovación Vida y Gastos Médicos")
        {
            return(archivo + Marco.listado[22].UbicacionPlantilla);
        }

        return("");
    }
コード例 #28
0
        public string GenerarPlantillaBaja(int IdPlantilla, int[] empleados)
        {
            Plantillas p = new Plantillas();

            return(p.FormarPlantilla(IdPlantilla, (int)TipoPlantilla.Baja, empleados));
        }
コード例 #29
0
ファイル: ConstructorFicha.cs プロジェクト: game8149/MinLab
        public FormatoImpresion CrearDocumento(Orden orden, Paciente paciente, Dictionary <int, Examen> examenPorOrden)
        {
            List <Examen>    examenSelectedTemp;
            FormatoImpresion pagina = new FormatoImpresion();

            pagina.Orden    = "O" + orden.IdData;
            pagina.Nombre   = paciente.Nombre + " " + paciente.ApellidoPaterno + " " + paciente.ApellidoMaterno;
            pagina.Historia = paciente.Historia;
            pagina.Edad     = this.GetAge(paciente);
            FormatoImpresion.PaginaLinea lineaTemp;
            foreach (OrdenDetalle detalle in orden.Detalle.Values)
            {
                examenSelectedTemp = GetExamenes(examenPorOrden, detalle);
                string nombreTar = Tarifario.GetInstance().Paquetes[detalle.IdDataTarifa].Nombre;
                string nombreEx  = null;
                lineaTemp           = new FormatoImpresion.PaginaLinea();
                lineaTemp.TipoLinea = FormatoImpresion.PaginaLinea.TipoPaginaLinea.TituloInicio;
                lineaTemp.Nombre    = nombreTar;
                pagina.Detalles.Add(lineaTemp);
                foreach (Examen ex in examenSelectedTemp)
                {
                    nombreEx = Plantillas.GetInstance().GetPlantilla(ex.IdPlantilla).Nombre;
                    if (!nombreEx.Equals(nombreTar))
                    {
                        lineaTemp           = new FormatoImpresion.PaginaLinea();
                        lineaTemp.TipoLinea = FormatoImpresion.PaginaLinea.TipoPaginaLinea.SubTitulo;
                        lineaTemp.Nombre    = nombreEx;
                        pagina.Detalles.Add(lineaTemp);
                    }
                    Dictionary <int, PlantillaDetalle> detalles = Plantillas.GetInstance().GetPlantilla(ex.IdPlantilla).Detalle;
                    for (int i = 0; i < detalles.Count; i++)
                    {
                        switch (detalles[i].Tipo)
                        {
                        case PlantillaDetalle.TipoDetalle.Grupo:
                            lineaTemp           = new FormatoImpresion.PaginaLinea();
                            lineaTemp.TipoLinea = FormatoImpresion.PaginaLinea.TipoPaginaLinea.GrupoInicio;
                            lineaTemp.Nombre    = detalles[i].Grupo.Nombre;
                            pagina.Detalles.Add(lineaTemp);
                            if (detalles[i].Grupo.IdData == 4)    //Para el grupo especial Medicina // Luego se puede mejorar Agregando un elemento deseado incorporandolo
                            {
                                foreach (Item itemG in detalles[i].Grupo.Items.Values)
                                {
                                    lineaTemp           = new FormatoImpresion.PaginaLinea();
                                    lineaTemp.TipoLinea = FormatoImpresion.PaginaLinea.TipoPaginaLinea.ItemSimple;
                                    lineaTemp.Nombre    = " * " + itemG.Nombre;
                                    int indice = Convert.ToInt32(ex.DetallesByItem[itemG.IdData].Campo);
                                    if (indice != 0)
                                    {
                                        lineaTemp.Resultado = itemG.OpcionesByIndice[indice];
                                        pagina.Detalles.Add(lineaTemp);
                                    }
                                }
                            }
                            else
                            {
                                foreach (Item itemG in detalles[i].Grupo.Items.Values)
                                {
                                    lineaTemp           = new FormatoImpresion.PaginaLinea();
                                    lineaTemp.TipoLinea = FormatoImpresion.PaginaLinea.TipoPaginaLinea.ItemSimple;
                                    lineaTemp.Nombre    = " * " + itemG.Nombre;
                                    switch (itemG.TipoCampo)
                                    {
                                    case TipoCampo.Input:
                                        lineaTemp.Resultado = ex.DetallesByItem[itemG.IdData].Campo.ToString();
                                        if (itemG.TieneUnidad)
                                        {
                                            lineaTemp.Resultado += itemG.Unidad;
                                        }
                                        lineaTemp.Resultado += ClasificarItem(paciente, ex.DetallesByItem[itemG.IdData]);
                                        break;

                                    case TipoCampo.Lista:
                                        lineaTemp.Resultado = itemG.OpcionesByIndice[Convert.ToInt32(ex.DetallesByItem[itemG.IdData].Campo)];
                                        break;

                                    case TipoCampo.Texto:
                                        lineaTemp.TipoLinea = FormatoImpresion.PaginaLinea.TipoPaginaLinea.ItemTexto;
                                        lineaTemp.Resultado = ex.DetallesByItem[itemG.IdData].Campo.ToString();
                                        break;
                                    }
                                    pagina.Detalles.Add(lineaTemp);
                                }
                            }
                            lineaTemp           = new FormatoImpresion.PaginaLinea();
                            lineaTemp.TipoLinea = FormatoImpresion.PaginaLinea.TipoPaginaLinea.GrupoFin;
                            break;

                        case PlantillaDetalle.TipoDetalle.Item:
                            Item item = detalles[i].Item;
                            lineaTemp           = new FormatoImpresion.PaginaLinea();
                            lineaTemp.TipoLinea = FormatoImpresion.PaginaLinea.TipoPaginaLinea.ItemSimple;
                            if (!nombreEx.Equals(item.Nombre))
                            {
                                lineaTemp.Nombre = item.Nombre;
                            }
                            else
                            {
                                lineaTemp.Nombre = "RESULTADO";
                            }
                            switch (item.TipoCampo)
                            {
                            case TipoCampo.Input:
                                lineaTemp.Resultado = ex.DetallesByItem[item.IdData].Campo.ToString();
                                if (item.TieneUnidad)
                                {
                                    lineaTemp.Resultado += "  " + item.Unidad;
                                }
                                switch (item.TipoDato)
                                {
                                case TipoDato.Entero:
                                    lineaTemp.Resultado += ClasificarItem(paciente, ex.DetallesByItem[item.IdData]);
                                    break;

                                case TipoDato.Decimal:
                                    lineaTemp.Resultado += ClasificarItem(paciente, ex.DetallesByItem[item.IdData]);
                                    break;
                                }
                                break;

                            case TipoCampo.Lista:
                                lineaTemp.Resultado = item.OpcionesByIndice[Convert.ToInt32(ex.DetallesByItem[item.IdData].Campo)];
                                break;

                            case TipoCampo.Texto:
                                lineaTemp.TipoLinea = FormatoImpresion.PaginaLinea.TipoPaginaLinea.ItemTexto;
                                lineaTemp.Resultado = ex.DetallesByItem[item.IdData].Campo.ToString();
                                break;
                            }
                            pagina.Detalles.Add(lineaTemp);
                            break;
                        }
                    }
                }
            }
            return(pagina);
        }
コード例 #30
0
 public IActionResult AddUser(Plantillas plantilla, int step)
 {
     plantilla.PlantillasPasosDetalle[step].PlantillasPasosUsuariosDetalle.Add(new PlantillasPasosUsuariosDetalle());
     SetupCreateViewBag(plantilla);
     return(View(nameof(Create), plantilla));
 }