Exemplo n.º 1
0
        private void UpdateLaboratorio()
        {
            LaboratorioBLL capanegocios = new LaboratorioBLL();
            LaboratorioBE  objeto       = new LaboratorioBE();

            try
            {
                objeto.IdLaboratorio    = Convert.ToInt32(HideIdLaboratorio.Value);
                objeto.OrdenServicio    = Convert.ToString(txtEOrden.Text.Trim());
                objeto.IdEnsayo         = Convert.ToInt32(ddlEEnsayo.SelectedValue);
                objeto.IdAnalista       = Convert.ToInt32(ddlEAnalista.SelectedValue);
                objeto.FechaVencimiento = Convert.ToDateTime(txtEFecVenc.Text.Trim());
                objeto.FechaEntregaMax  = Convert.ToDateTime(txtEFecEntrega.Text.Trim());
                objeto.Confirmacion     = Convert.ToString(txtEConfirmacion.Text);
                objeto.Pesquisa         = Convert.ToString(txtEPesquisa.Text);
                objeto.EnsayoHPLC       = Convert.ToString(txtEEnsayoHPLC.Text);
                objeto.Condicion        = Convert.ToString(txtECondicion.Text);
                objeto.Observaciones    = Convert.ToString(txtEObservacion.Text);

                capanegocios.UpdateLaboratorio(objeto);
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
Exemplo n.º 2
0
        public Boolean UpdateLaboratorio(LaboratorioBE objLaboratorio)
        {
            Dictionary <string, object> parameters = null;

            try
            {
                parameters = new Dictionary <string, object>()
                {
                    { "@IdLaboratorio", objLaboratorio.IdLaboratorio },
                    { "@OrdenServicio", objLaboratorio.OrdenServicio },
                    { "@IdEnsayo", objLaboratorio.IdEnsayo },
                    { "@IdAnalista", objLaboratorio.IdAnalista },
                    { "@FechaVencimiento", objLaboratorio.FechaVencimiento },
                    { "@FechaEntregaMax", objLaboratorio.FechaEntregaMax },
                    { "@Confirmacion", objLaboratorio.Confirmacion },
                    { "@Pesquisa", objLaboratorio.Pesquisa },
                    { "@EnsayoHPLC", objLaboratorio.EnsayoHPLC },
                    { "@Condicion", objLaboratorio.Condicion },
                    { "@Observaciones", objLaboratorio.Observaciones }
                };

                SqlHelper.ExecuteNonQuery("pUpdateLaboratorio", parameters);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
                return(false);
            }
        }
Exemplo n.º 3
0
 public Boolean DeleteLaboratorio(LaboratorioBE objLaboratorio)
 {
     try
     {
         return(new LaboratorioDAL().DeleteLaboratorio(objLaboratorio));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
 public List <LaboratorioBE> GetLaboratorio(LaboratorioBE objLaboratorio)
 {
     try
     {
         return(new LaboratorioDAL().GetLaboratorio(objLaboratorio));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 5
0
        public List <LaboratorioBE> GetLaboratorio(LaboratorioBE objLaboratorio)
        {
            List <LaboratorioBE>        lstlaboratorio   = null;
            Dictionary <string, object> searchParameters = null;

            try
            {
                searchParameters = new Dictionary <string, object>()
                {
                    { "@IdLaboratorio", objLaboratorio.IdLaboratorio }
                };

                SqlDataReader reader = SqlHelper.GetDataReader("pGetLaboratorio", searchParameters);

                if (reader.HasRows)
                {
                    lstlaboratorio = new List <LaboratorioBE>();

                    while (reader.Read())
                    {
                        LaboratorioBE oLaboratorio = new LaboratorioBE();

                        oLaboratorio.IdExpediente  = Convert.ToInt32(reader["IdExpediente"]);
                        oLaboratorio.IdLaboratorio = Convert.ToInt32(reader["IdLaboratorio"]);
                        oLaboratorio.IdEnsayo      = Convert.ToInt32(reader["IdEnsayo"]);
                        oLaboratorio.IdAnalista    = Convert.ToInt32(reader["IdAnalista"]);

                        if (!Convert.IsDBNull(reader["FechaVencimiento"]))
                        {
                            oLaboratorio.FechaVencimiento = Convert.ToDateTime(reader["FechaVencimiento"]);
                        }

                        if (!Convert.IsDBNull(reader["FechaEntregaMax"]))
                        {
                            oLaboratorio.FechaEntregaMax = Convert.ToDateTime(reader["FechaEntregaMax"]);
                        }

                        oLaboratorio.Confirmacion  = Convert.ToString(reader["Confirmacion"]);
                        oLaboratorio.Pesquisa      = Convert.ToString(reader["Pesquisa"]);
                        oLaboratorio.EnsayoHPLC    = Convert.ToString(reader["EnsayoHPLC"]);
                        oLaboratorio.Condicion     = Convert.ToString(reader["Condicion"]);
                        oLaboratorio.Observaciones = Convert.ToString(reader["Observaciones"]);

                        lstlaboratorio.Add(oLaboratorio);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(lstlaboratorio);
        }
Exemplo n.º 6
0
        private void DeleteLaboratorio(int pIdLaboratorio)
        {
            LaboratorioBLL capanegocios = new LaboratorioBLL();
            LaboratorioBE  objeto       = new LaboratorioBE();

            try
            {
                objeto.IdLaboratorio = pIdLaboratorio;

                capanegocios.DeleteLaboratorio(objeto);
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
Exemplo n.º 7
0
        private void ListLaboratorio(int pIdExpediente)
        {
            LaboratorioBLL capanegocios = new LaboratorioBLL();
            LaboratorioBE  objeto       = new LaboratorioBE();

            try
            {
                objeto.IdExpediente = pIdExpediente;
                var lstLaboratorio = new LaboratorioBLL().List(objeto);

                gdvLaboratorio.DataSource = lstLaboratorio;
                gdvLaboratorio.DataBind();
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
Exemplo n.º 8
0
        public Boolean DeleteLaboratorio(LaboratorioBE objLaboratorio)
        {
            Dictionary <string, object> parameters = null;

            try
            {
                parameters = new Dictionary <string, object>()
                {
                    { "@IdLaboratorio", objLaboratorio.IdLaboratorio }
                };

                SqlHelper.ExecuteNonQuery("pDeleteLaboratorio", parameters);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
                return(false);
            }
        }
Exemplo n.º 9
0
        private void GetLaboratorio(int pIdLaboratorio)
        {
            LaboratorioBLL capanegocios = new LaboratorioBLL();
            LaboratorioBE  objeto       = new LaboratorioBE();

            try
            {
                objeto.IdLaboratorio = pIdLaboratorio;
                var lstLaboratorio = new LaboratorioBLL().GetLaboratorio(objeto);


                foreach (LaboratorioBE oLabotorio in lstLaboratorio)
                {
                    txtEOrden.Text = oLabotorio.OrdenServicio;

                    ListEnsayo();
                    ddlEEnsayo.SelectedValue = Convert.ToString(oLabotorio.IdEnsayo);

                    ListEvaluador();
                    ddlEAnalista.SelectedValue = Convert.ToString(oLabotorio.IdAnalista);

                    txtEFecVenc.Text    = string.Format("{0:d}", oLabotorio.FechaVencimiento);
                    txtEFecEntrega.Text = string.Format("{0:d}", oLabotorio.FechaEntregaMax);

                    txtEConfirmacion.Text = Convert.ToString(oLabotorio.Confirmacion);
                    txtEPesquisa.Text     = Convert.ToString(oLabotorio.Pesquisa);
                    txtEEnsayoHPLC.Text   = Convert.ToString(oLabotorio.EnsayoHPLC);
                    txtECondicion.Text    = Convert.ToString(oLabotorio.Condicion);
                    txtEObservacion.Text  = Convert.ToString(oLabotorio.Observaciones);
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }