Beispiel #1
0
        public FileResult Download(int id)
        {
            MedList a = obj1.MedLists.Where(m => m.id == id).FirstOrDefault();

            return(File(a.data, a.datatype, a.dataname));
        }
Beispiel #2
0
        private void alight()
        {
            string top = string.Empty, down = string.Empty;
            int    iindex = 0, jindex = 0;

            if (SelectedInput != string.Empty && SelectedGoal != string.Empty)
            {
                MED.MED med = MedList.First(x => x.Name == SelectedGoal);
                for (int i = med.ResPtr.Count - 1; i >= 0; i--)
                {
                    if (med.ResPtr[i] == trak.insertion)
                    {
                        top  += "*";
                        down += SelectedGoal[jindex++];
                    }
                    if (med.ResPtr[i] == trak.deletion)
                    {
                        top  += SelectedInput[iindex++];
                        down += "*";
                    }
                    if (med.ResPtr[i] == trak.substitution)
                    {
                        top  += SelectedInput[iindex++];
                        down += SelectedGoal[jindex++];
                    }
                }
            }
            StackPanel sp = new StackPanel
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center
            };
            StackPanel sp1 = new StackPanel {
                Height = 50, Orientation = Orientation.Horizontal
            };
            StackPanel sp2 = new StackPanel {
                Height = 50, Orientation = Orientation.Horizontal
            };
            StackPanel sp3 = new StackPanel {
                Height = 50, Orientation = Orientation.Horizontal
            };

            sp.Children.Add(sp1);
            sp.Children.Add(sp2);
            sp.Children.Add(sp3);
            foreach (var item in top)
            {
                TextBlock tb = new TextBlock
                {
                    Width         = 50,
                    Text          = item.ToString(),
                    TextAlignment = TextAlignment.Center,
                    FontSize      = 20
                };
                sp1.Children.Add(tb);
            }
            foreach (var item in top)
            {
                Path p = new Path
                {
                    Data            = Geometry.Parse("M7.2064977,0L14.334524,0C14.639518,0,14.843499,0.20404053,14.843499,0.5090332L14.843499,17.820007C14.843499,18.126038,15.04754,18.330017,15.352535,18.330017L20.138569,18.330017C21.36056,18.330017,21.767544,19.042053,20.953576,20.061035L11.788491,31.466003C11.279516,32.17804,10.159516,32.17804,9.6495032,31.466003L0.3834657,19.857056C-0.32955072,19.042053,-0.023579955,18.330017,1.0964209,18.330017L6.1874495,18.330017C6.4934817,18.330017,6.6964855,18.126038,6.6964855,17.820007L6.6964855,0.5090332C6.6964855,0.20404053,6.900466,0,7.2064977,0z"),
                    Width           = 50,
                    Stretch         = Stretch.Uniform,
                    Fill            = Brushes.DarkRed,
                    Stroke          = Brushes.Black,
                    StrokeThickness = 0.1
                };
                sp2.Children.Add(p);
            }
            foreach (var item in down)
            {
                TextBlock tb = new TextBlock
                {
                    Width         = 50,
                    Text          = item.ToString(),
                    TextAlignment = TextAlignment.Center,
                    FontSize      = 20
                };
                sp3.Children.Add(tb);
            }
            alignment.Children.Clear();
            alignment.Children.Add(sp);
            //Console.WriteLine(top);
            //Console.WriteLine(down);
        }
Beispiel #3
0
 private void Update()
 {
     DP.Children.Clear();
     if (SelectedInput != string.Empty && SelectedGoal != string.Empty)
     {
         MED.MED med = MedList.First(x => x.Name == SelectedGoal);
         Viewbox vb  = new Viewbox();
         List <List <TextBlock> > tbl = new List <List <TextBlock> >();
         TextBlock  tb;
         StackPanel isp;
         StackPanel sp = new StackPanel()
         {
             VerticalAlignment   = VerticalAlignment.Center,
             HorizontalAlignment = HorizontalAlignment.Center
         };
         for (int i = SelectedInput.Length - 1; i >= 0; i--)
         {
             string pasvalue = SelectedInput[i].ToString();
             isp = new StackPanel()
             {
                 Orientation = Orientation.Horizontal
             };
             tb = new TextBlock
             {
                 Width      = 15,
                 Text       = pasvalue,
                 Foreground = Brushes.Blue,
                 Padding    = new Thickness(3, 0, 3, 0)
             };
             isp.Children.Add(tb);
             sp.Children.Add(isp);
         }
         isp = new StackPanel()
         {
             Orientation = Orientation.Horizontal
         };
         tb = new TextBlock
         {
             Width      = 15,
             Text       = "#",
             Foreground = Brushes.Blue,
             Padding    = new Thickness(3, 0, 3, 0)
         };
         isp.Children.Add(tb);
         sp.Children.Add(isp);
         isp = new StackPanel()
         {
             Orientation = Orientation.Horizontal
         };
         tb = new TextBlock
         {
             Width      = 15,
             Text       = " ",
             Foreground = Brushes.Blue,
             Padding    = new Thickness(3, 0, 3, 0)
         };
         isp.Children.Add(tb);
         sp.Children.Add(isp);
         isp = (sp.Children[sp.Children.Count - 1] as StackPanel);
         tb  = new TextBlock
         {
             Width      = 15,
             Text       = "#",
             Foreground = Brushes.Blue,
             Padding    = new Thickness(3, 0, 3, 0)
         };
         isp.Children.Add(tb);
         foreach (var item in SelectedGoal)
         {
             string pasvalue = item.ToString();
             isp = (sp.Children[sp.Children.Count - 1] as StackPanel);
             tb  = new TextBlock
             {
                 Width      = 15,
                 Text       = pasvalue,
                 Foreground = Brushes.Blue,
                 Padding    = new Thickness(3, 0, 3, 0)
             };
             isp.Children.Add(tb);
             //sp.Children.Add(isp);
         }
         //vb.Child = sp;
         for (int i = 0; i < med.res.GetLength(0); i++)
         {
             List <TextBlock> tblis = new List <TextBlock>();
             isp = (sp.Children[i] as StackPanel);
             for (int j = 0; j < med.res.GetLength(1); j++)
             {
                 tb = new TextBlock
                 {
                     Width      = 15,
                     Text       = med.res[i, j].ToString(),
                     Foreground = Brushes.Black,
                     Padding    = new Thickness(3, 0, 3, 0)
                 };
                 isp.Children.Add(tb);
                 tblis.Add(tb);
             }
             tbl.Add(tblis);
         }
         int ith     = med.res.GetLength(0) - 1;
         int ithtemp = med.res.GetLength(0) - 1;
         int jth     = med.res.GetLength(1) - 1;
         tbl[ithtemp - ith][jth].Background = Brushes.LightGreen;
         foreach (var item in med.ResPtr)
         {
             if (item == trak.deletion)
             {
                 ith = ith - 1;
             }
             else if (item == trak.insertion)
             {
                 jth = jth - 1;
             }
             else
             {
                 ith = ith - 1;
                 jth = jth - 1;
             }
             tbl[ithtemp - ith][jth].Background = Brushes.LightGreen;
         }
         DP.Children.Add(sp);
     }
     alight();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["ChequeoID"] == null)
            {
                Response.Redirect("~/Home/Index");
            }
            var chequeoIDText = Request.QueryString["ChequeoID"].Trim().ToString();

            if (string.IsNullOrEmpty(chequeoIDText))
            {
                var message = "No se encuentra ID";

                ClientScript.RegisterStartupScript(GetType(), "alerte",
                                                   $"alert({message});"
                                                   , true);
            }

            try
            {
                using (var db = new Data.VetSoftDBEntities())
                {
                    int.TryParse(chequeoIDText, out int res);
                    var check = db.Chequeo.FirstOrDefault(x => x.ID.Equals(res));

                    if (check == null)
                    {
                        Response.Redirect("~/Home/Index");
                    }
                    var pacmodel    = new Models.PacienteSingleModel(check.Paciente);
                    var props       = (new Models.PacienteViewModel(check.Paciente)).Propietarios;
                    var propietario = new Models.PropietarioViewModel();
                    if (props.Count > 0)
                    {
                        propietario = props
                                      .First(x => x.Tipo.Equals((int)Data.TipoPropietario.Propietario_Actual)).Propietario;
                    }
                    PacID.Text     = pacmodel.ID.ToString();
                    PacName.Text   = pacmodel.FullName;
                    PacChip.Text   = pacmodel.Microchip_Licencia;
                    PacFechaI.Text = pacmodel.FechaIngreso.ToShortDateString();
                    PacEsp.Text    = pacmodel.Raza.Especie.Nombre;
                    PacRaza.Text   = pacmodel.Raza.Nombre;
                    PacPeso.Text   = check.Peso.ToString();
                    PacGenero.Text = pacmodel.Genero.Value.ToString();
                    PacColor.Text  = pacmodel.Color;
                    PacNac.Text    = pacmodel.FechaNac.ToShortDateString();
                    if (propietario != null)
                    {
                        PropName.Text = propietario.FullName();
                        PropDir.Text  = propietario.Direccion;
                        PropID.Text   = propietario.ID.ToString();
                        PropTel.Text  = propietario.Telefono;
                    }
                    var query = check.Medicacion.ToList()
                                .Select(x =>
                    {
                        var f = x.Chequeo.Fecha.ToShortDateString();
                        var p = " N/A ";
                        var m = x.Medicamento.Nombre;
                        var t = x.Medicamento.Tipo.Nombre;
                        if (x.Fecha.HasValue)
                        {
                            p = x.Fecha.Value.ToShortDateString();
                        }
                        return(new
                        {
                            Fecha = f,
                            Tipo = t,
                            Med = m,
                            Prox = p
                        });
                    }).ToList();
                    MedList.DataSource = query;
                    MedList.DataBind();
                    GoBackID.NavigateUrl = $"../../Chequeos/Paciente/{pacmodel.ID}";
                }
            }
            catch (Exception ex)
            {
                var message = ex.Message;
            }
        }