예제 #1
0
        public Boolean SaveCotizacion(ExpedienteBE objExpediente)
        {
            Dictionary <string, object> parameters = null;

            try
            {
                parameters = new Dictionary <string, object>()
                {
                    { "@CodigoExpediente", objExpediente.CodigoExpediente },
                    { "@CodigoCotizacion", objExpediente.CodigoCotizacion },
                    { "@IdTipoCliente", objExpediente.IdTipoCliente },
                    { "@FechaCotizacion", objExpediente.FechaCotizacion },
                    { "@Correo", objExpediente.Correo },
                    { "@DocumentoFisico", objExpediente.DocumentoFisico },
                    { "@DocumentoAnexo", objExpediente.DocumentoAnexo },
                    { "@IdUsuarioRegistro", objExpediente.IdUsuario },
                    { "@Oficio", objExpediente.Oficio },
                    { "@FechaOficio", objExpediente.FechaOficio },
                    { "@ActaPesquisa", objExpediente.ActaPesquisa },
                    { "@FechaPesquisa", objExpediente.FechaPesquisa }
                };

                SqlHelper.ExecuteNonQuery("pSaveCotizacion", parameters);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
                return(false);
            }
        }
        private void EnviarExpediente()
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            try
            {
                ArrayList ArrayList    = new ArrayList();
                CheckBox  ChkBoxHeader = (CheckBox)gdvExpediente.HeaderRow.FindControl("chkboxSelectAll");

                foreach (GridViewRow row in gdvExpediente.Rows)
                {
                    CheckBox ChkBoxRows = (CheckBox)row.FindControl("chkboxSelect");

                    if (ChkBoxRows.Checked == true)
                    {
                        objeto.IdEstado = Convert.ToInt32(Constante.Estados.Enviado);

                        String IdExpediente = Convert.ToString(gdvExpediente.DataKeys[row.RowIndex]["IDEXPEDIENTE"]);

                        objeto.IdExpediente       = Convert.ToInt32(IdExpediente);
                        objeto.IdUsuarioActualiza = 1;
                        capanegocios.UpdateEstadoExpediente(objeto);
                    }
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
예제 #3
0
        public Boolean UpdateCotizacionRM(ExpedienteBE objExpediente)
        {
            Dictionary <string, object> parameters = null;

            try
            {
                parameters = new Dictionary <string, object>()
                {
                    { "@IdExpediente", objExpediente.IdExpediente },
                    { "@CodigoExpediente", objExpediente.CodigoExpediente },
                    { "@IdTipoCliente", objExpediente.IdTipoCliente },
                    { "@Oficio", objExpediente.Oficio },
                    { "@FechaOficio", objExpediente.FechaOficio },
                    { "@FechaRecepcion", objExpediente.FechaRecepcion },
                    { "@IdUsuarioActualiza", objExpediente.IdUsuarioActualiza }
                };

                SqlHelper.ExecuteNonQuery("pUpdateCotizacionRM", parameters);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
                return(false);
            }
        }
예제 #4
0
        public Boolean UpdateExpedienteFacturacion(ExpedienteBE objExpediente)
        {
            Dictionary <string, object> parameters = null;

            try
            {
                parameters = new Dictionary <string, object>()
                {
                    { "@IdExpediente", objExpediente.IdExpediente },
                    { "@FechaRecepcionIE", objExpediente.FechaRecepcionIE },
                    { "@InformeEnsayo", objExpediente.InformeEnsayo },
                    { "@Conclusion", objExpediente.Conclusion },
                    { "@Proforma", objExpediente.Proforma },
                    { "@Factura", objExpediente.Factura },
                    { "@FechaEntregaPool", objExpediente.FechaEntregaPool },
                    { "@Muestras", objExpediente.Muestras },
                    { "@IdUsuarioActualiza", objExpediente.IdUsuarioActualiza }
                };

                SqlHelper.ExecuteNonQuery("pUpdateExpedienteFacturacion", parameters);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
                return(false);
            }
        }
예제 #5
0
        public Boolean UpdateExpedienteCustodia(ExpedienteBE objExpediente)
        {
            Dictionary <string, object> parameters = null;

            try
            {
                parameters = new Dictionary <string, object>()
                {
                    { "@IdExpediente", objExpediente.IdExpediente },
                    { "@FechaIngreso", objExpediente.FechaIngreso },
                    { "@DocumentoCustodia", objExpediente.DocumentoCustodia },
                    { "@IdTipoProducto", objExpediente.IdTipoProducto },
                    { "@IdClaseProducto", objExpediente.IdClaseProducto },
                    { "@CantidadCustodia", objExpediente.CantidadCustodia },
                    { "@CondicionAmbiental", objExpediente.CondicionAmbiental },
                    { "@ContraMuestra", objExpediente.ContraMuestra },
                    { "@CamaraFria", objExpediente.CamaraFria },
                    { "@PreCamara", objExpediente.PreCamara },
                    { "@IdUsuarioActualiza", objExpediente.IdUsuarioActualiza }
                };

                SqlHelper.ExecuteNonQuery("pUpdateExpedienteCustodia", parameters);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
                return(false);
            }
        }
        private void SaveCotizacion()
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            try
            {
                objeto.CodigoExpediente = txtExpediente.Text.Trim();
                objeto.CodigoCotizacion = txtCotizacion.Text.Trim();
                objeto.IdTipoCliente    = Convert.ToInt32(ddlTipoCliente.SelectedValue);
                objeto.FechaCotizacion  = Convert.ToDateTime(txtFecCotizacion.Text.Trim());
                objeto.Correo           = txtCorreo.Text.Trim();
                objeto.DocumentoFisico  = txtDocFisico.Text.Trim();
                objeto.DocumentoAnexo   = txtDocAnexo.Text.Trim();
                objeto.Oficio           = string.Empty;
                objeto.FechaOficio      = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());
                objeto.ActaPesquisa     = string.Empty;
                objeto.FechaPesquisa    = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());
                objeto.IdUsuario        = 1;

                capanegocios.SaveCotizacion(objeto);
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
        private void GetExpedientebyId(int pIdExpediente)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            try
            {
                objeto.IdExpediente = pIdExpediente;

                var lstExpediente = new ExpedienteBLL().GetExpediente(objeto);

                foreach (ExpedienteBE oExpediente in lstExpediente)
                {
                    ListTipoCliente();
                    ddlTipoCliente.SelectedValue = Convert.ToString(oExpediente.IdTipoCliente);
                    txtCotizacion.Text           = oExpediente.CodigoCotizacion;
                    txtExpediente.Text           = oExpediente.CodigoExpediente;
                    txtFecCotizacion.Text        = string.Format("{0:d}", oExpediente.FechaCotizacion);
                    txtCliente.Text        = oExpediente.Cliente;
                    txtProducto.Text       = oExpediente.Producto;
                    txtLote.Text           = oExpediente.Lote;
                    txtFecVencimiento.Text = string.Format("{0:d}", oExpediente.FechaVencimiento);
                    txtCorreo.Text         = oExpediente.Correo;
                    txtDocFisico.Text      = oExpediente.DocumentoFisico;
                    txtDocAnexo.Text       = oExpediente.DocumentoAnexo;
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
예제 #8
0
        public Boolean UpdateExpedienteContraMuestra(ExpedienteBE objExpediente)
        {
            Dictionary <string, object> parameters = null;

            try
            {
                parameters = new Dictionary <string, object>()
                {
                    { "@IdExpediente", objExpediente.IdExpediente },
                    { "@FechaIngresoLab", objExpediente.FechaIngresoLab },
                    { "@FechaEntregaCliente", objExpediente.FechaEntregaCliente },
                    { "@ContramuestraCER", objExpediente.ContramuestraCER },
                    { "@ContramuestraFQ", objExpediente.ContramuestraFQ },
                    { "@ContramuestraMicrob", objExpediente.ContramuestraMicrob },
                    { "@MuestraOficio", objExpediente.MuestraOficio },
                    { "@MuestraCantidad", objExpediente.MuestraCantidad },
                    { "@IdAreaRetiro1", objExpediente.IdAreaRetiro1 },
                    { "@CantidadRetiro1", objExpediente.CantidadRetiro1 },
                    { "@IdAreaRetiro2", objExpediente.IdAreaRetiro2 },
                    { "@CantidadRetiro2", objExpediente.CantidadRetiro2 },
                    { "@Saldo", objExpediente.Saldo },
                    { "@MuestraUbicacion", objExpediente.MuestraUbicacion },
                    { "@IdUsuarioActualiza", objExpediente.IdUsuarioActualiza }
                };

                SqlHelper.ExecuteNonQuery("pUpdateExpedienteContraMuestra", parameters);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
                return(false);
            }
        }
예제 #9
0
        public List <ExpedienteBE> GetExpediente(ExpedienteBE objExpediente)
        {
            List <ExpedienteBE>         lstExpediente    = null;
            Dictionary <string, object> searchParameters = null;

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

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

                if (reader.HasRows)
                {
                    lstExpediente = new List <ExpedienteBE>();

                    while (reader.Read())
                    {
                        ExpedienteBE oExpediente = new ExpedienteBE();

                        oExpediente.IdExpediente     = Convert.ToInt32(reader["IdExpediente"]);
                        oExpediente.CodigoExpediente = Convert.ToString(reader["Expediente"]);
                        oExpediente.CodigoCotizacion = Convert.ToString(reader["CodigoCotizacion"]);

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

                        oExpediente.Cliente         = Convert.ToString(reader["Cliente"]);
                        oExpediente.IdTipoCliente   = Convert.ToInt32(reader["IdTipoCliente"]);
                        oExpediente.Producto        = Convert.ToString(reader["Producto"]);
                        oExpediente.Lote            = Convert.ToString(reader["Lote"]);
                        oExpediente.Correo          = Convert.ToString(reader["Correo"]);
                        oExpediente.DocumentoFisico = Convert.ToString(reader["DocumentoFisico"]);
                        oExpediente.DocumentoAnexo  = Convert.ToString(reader["DocumentoAnexo"]);
                        oExpediente.Estado          = Convert.ToString(reader["flgEstado"]);
                        oExpediente.MotivoAnulacion = Convert.ToString(reader["MotivoAnulacion"]);

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

                        lstExpediente.Add(oExpediente);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(lstExpediente);
        }
예제 #10
0
 public List <ExpedienteBE> GetExpediente(ExpedienteBE objExpediente)
 {
     try
     {
         return(new ExpedienteDAL().GetExpediente(objExpediente));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #11
0
 public List <ExpedienteBE> ListExpedienteFisicoQuimico(ExpedienteBE objExpediente)
 {
     try
     {
         return(new ExpedienteDAL().ListExpedienteFisicoQuimico(objExpediente));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #12
0
 public Boolean UpdateExpedienteContraMuestra(ExpedienteBE objExpediente)
 {
     try
     {
         return(new ExpedienteDAL().UpdateExpedienteContraMuestra(objExpediente));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #13
0
 public Boolean UpdateEstadoExpediente(ExpedienteBE objExpediente)
 {
     try
     {
         return(new ExpedienteDAL().UpdateEstadoExpediente(objExpediente));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #14
0
 public Boolean UpdateCotizacion(ExpedienteBE objExpediente)
 {
     try
     {
         return(new ExpedienteDAL().UpdateCotizacion(objExpediente));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void AnularCotizacion(int IdExpediente)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            try
            {
                objeto.IdExpediente    = IdExpediente;
                objeto.MotivoAnulacion = txtanulacion.Text.Trim();

                capanegocios.UpdateAnulacionCotizacion(objeto);
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
예제 #16
0
        public Boolean UpdateAnulacionCotizacion(ExpedienteBE objExpediente)
        {
            Dictionary <string, object> parameters = null;

            try
            {
                parameters = new Dictionary <string, object>()
                {
                    { "@IdExpediente", objExpediente.IdExpediente },
                    { "@MotivoAnulacion", objExpediente.MotivoAnulacion }
                };

                SqlHelper.ExecuteNonQuery("pUpdateCotizacionAnulacion", parameters);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
                return(false);
            }
        }
예제 #17
0
        public Boolean UpdateEstadoExpediente(ExpedienteBE objExpediente)
        {
            Dictionary <string, object> parameters = null;

            try
            {
                parameters = new Dictionary <string, object>()
                {
                    { "@IdExpediente", objExpediente.IdExpediente },
                    { "@IdEstado", objExpediente.IdEstado },
                    { "@IdUsuarioActualiza", objExpediente.IdUsuarioActualiza }
                };

                SqlHelper.ExecuteNonQuery("pUpdateEstadoExpediente", parameters);

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
                return(false);
            }
        }
        private void UpdateCotizacion(int pIdExpediente)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            try
            {
                objeto.IdExpediente       = pIdExpediente;
                objeto.CodigoExpediente   = txtExpediente.Text.Trim();
                objeto.CodigoCotizacion   = txtCotizacion.Text.Trim();
                objeto.IdTipoCliente      = Convert.ToInt32(ddlTipoCliente.SelectedValue);
                objeto.FechaCotizacion    = Convert.ToDateTime(txtFecCotizacion.Text.Trim());
                objeto.Correo             = txtCorreo.Text.Trim();
                objeto.DocumentoFisico    = txtDocFisico.Text.Trim();
                objeto.DocumentoAnexo     = txtDocAnexo.Text.Trim();
                objeto.IdUsuarioActualiza = 1;

                capanegocios.UpdateCotizacion(objeto);
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
예제 #19
0
        public List <ExpedienteBE> ListExpedienteFisicoQuimico(ExpedienteBE objExpediente)
        {
            List <ExpedienteBE>         lstExpediente    = null;
            Dictionary <string, object> searchParameters = null;

            try
            {
                searchParameters = new Dictionary <string, object>()
                {
                    { "@inStartRowIndex", objExpediente.StartRowIndex },
                    { "@inEndRoowIndex", objExpediente.EndRowIndex },
                    { "@CodigoExpediente", objExpediente.CodigoExpediente },
                    { "@CodigoCotizacion", objExpediente.CodigoCotizacion },
                    { "@IdTipoCliente", objExpediente.IdTipoCliente },
                    { "@Cliente", objExpediente.Cliente },
                    { "@Producto", objExpediente.Producto },
                    { "@IdEstado", objExpediente.IdEstado },
                    { "@IdEnsayo", objExpediente.IdEnsayo },
                    { "@IdAnalista", objExpediente.IdAnalista },
                    { "@FecCotizacion", objExpediente.FechaCotizacion }
                };

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

                if (reader.HasRows)
                {
                    lstExpediente = new List <ExpedienteBE>();

                    while (reader.Read())
                    {
                        ExpedienteBE oExpediente = new ExpedienteBE();

                        oExpediente.IdExpediente     = Convert.ToInt32(reader["IdExpediente"]);
                        oExpediente.CodigoExpediente = Convert.ToString(reader["Expediente"]);
                        oExpediente.CodigoCotizacion = Convert.ToString(reader["CodigoCotizacion"]);

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

                        oExpediente.Cliente          = Convert.ToString(reader["Cliente"]);
                        oExpediente.TipoCliente      = Convert.ToString(reader["Tipo_Cliente"]);
                        oExpediente.Situacion        = Convert.ToString(reader["Situacion"]);
                        oExpediente.Producto         = Convert.ToString(reader["Producto"]);
                        oExpediente.Lote             = Convert.ToString(reader["Lote"]);
                        oExpediente.Estado           = Convert.ToString(reader["Estado"]);
                        oExpediente.Evaluador        = new EvaluadorBE();
                        oExpediente.Evaluador.Nombre = Convert.ToString(reader["Analista"]);

                        oExpediente.Ensayo        = new EnsayoBE();
                        oExpediente.Ensayo.Nombre = Convert.ToString(reader["Ensayo"]);

                        oExpediente.Usuario           = new UsuarioBE();
                        oExpediente.Usuario.Login     = Convert.ToString(reader["Usuario"]);
                        oExpediente.NroExpediente     = Convert.ToInt32(reader["Total"]);
                        oExpediente.Alerta            = Convert.ToInt32(reader["Alerta"]);
                        oExpediente.NroReprogramacion = Convert.ToInt32(reader["NroReprogramacion"]);
                        oExpediente.NroEvaluacion     = Convert.ToInt32(reader["NroEvaluacion"]);

                        /*Fisico Quimica*/
                        oExpediente.DCI           = Convert.ToString(reader["DCI"]);
                        oExpediente.Clasificacion = Convert.ToString(reader["Clasificacion"]);

                        if (!Convert.IsDBNull(reader["Red"]))
                        {
                            oExpediente.Red = Convert.ToInt32(reader["Red"]);
                        }

                        oExpediente.Norma = Convert.ToString(reader["Norma"]);

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

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

                        lstExpediente.Add(oExpediente);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(lstExpediente);
        }
예제 #20
0
        private void ListbyCriteriosExpediente(int pIdArea, bool aIsCompleteData)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();
            Double        Total;


            try
            {
                inStartRowIndex = ((currentPageNumber - 1) * PAGE_SIZE) + 1;

                if (aIsCompleteData)
                {
                    inEndRowIndex = (currentPageNumber * PAGE_SIZE);
                }
                else
                {
                    inEndRowIndex = (currentPageNumber * PAGE_SIZE);
                }

                objeto.StartRowIndex = inStartRowIndex;
                objeto.EndRowIndex   = inEndRowIndex;

                if (txtFilExpediente.Text.Trim() != string.Empty)
                {
                    objeto.CodigoExpediente = txtFilExpediente.Text.Trim();
                }
                else
                {
                    objeto.CodigoExpediente = "*";
                }

                if (txtFilCotizacion.Text.Trim() != string.Empty)
                {
                    objeto.CodigoCotizacion = txtFilCotizacion.Text.Trim();
                }
                else
                {
                    objeto.CodigoCotizacion = "*";
                }

                objeto.IdTipoCliente = Convert.ToInt32(ddlFilTipoCliente.SelectedValue);

                if (txtFilCliente.Text.Trim() != string.Empty)
                {
                    objeto.Cliente = txtFilCliente.Text.Trim();
                }
                else
                {
                    objeto.Cliente = "*";
                }

                objeto.Producto = txtFilProducto.Text.Trim();

                if (txtFilFecCotiz.Text == string.Empty)
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());
                }
                else
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(txtFilFecCotiz.Text);
                }


                objeto.FechaIngreso = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());


                objeto.IdEstado      = Convert.ToInt32(ddlFilEstado.SelectedValue);
                objeto.IdEnsayo      = Convert.ToInt32(ddlFilEnsayo.SelectedValue);
                objeto.IdAnalista    = Convert.ToInt32(ddlFilAnalista.SelectedValue);
                objeto.IdProcedencia = Convert.ToInt32(Constante.Numeros.Cero);

                var lstExpediente = new ExpedienteBLL().ListExpedienteFisicoQuimico(objeto);
                gdvExpediente.DataSource = lstExpediente;
                gdvExpediente.DataBind();

                if (lstExpediente.Count > 0)
                {
                    Total = lstExpediente[0].NroExpediente;

                    lblContador.Text = "Total de Expediente(s): " + Total + " registro(s).";

                    lblTotalPages.Text = GetTotalPages(Total).ToString();

                    ddlPage.Items.Clear();
                    for (int i = 1; i < Convert.ToInt32(lblTotalPages.Text) + 1; i++)
                    {
                        ddlPage.Items.Add(new ListItem(i.ToString()));
                    }
                    ddlPage.SelectedValue = currentPageNumber.ToString();
                }

                if (currentPageNumber == 1)
                {
                    lnkbtnPre.Enabled    = false;
                    lnkbtnPre.CssClass   = "GridPagePreviousInactive";
                    lnkbtnFirst.Enabled  = false;
                    lnkbtnFirst.CssClass = "GridPageFirstInactive";

                    if (Int32.Parse(lblTotalPages.Text) > 0)
                    {
                        lnkbtnNext.Enabled  = true;
                        lnkbtnNext.CssClass = "GridPageNextActive";
                        lnkbtnLast.Enabled  = true;
                        lnkbtnLast.CssClass = "GridPageLastActive";
                    }
                    else
                    {
                        lnkbtnNext.Enabled  = false;
                        lnkbtnNext.CssClass = "GridPageNextInactive";
                        lnkbtnLast.Enabled  = false;
                        lnkbtnLast.CssClass = "GridPageLastInactive";
                    }
                }

                else
                {
                    lnkbtnPre.Enabled    = true;
                    lnkbtnPre.CssClass   = "GridPagePreviousActive";
                    lnkbtnFirst.Enabled  = true;
                    lnkbtnFirst.CssClass = "GridPageFirstActive";

                    if (currentPageNumber == Int32.Parse(lblTotalPages.Text))
                    {
                        lnkbtnNext.Enabled  = false;
                        lnkbtnNext.CssClass = "GridPageNextInactive";
                        lnkbtnLast.Enabled  = false;
                        lnkbtnLast.CssClass = "GridPageLastInactive";
                    }
                    else
                    {
                        lnkbtnNext.Enabled  = true;
                        lnkbtnNext.CssClass = "GridPageNextActive";
                        lnkbtnLast.Enabled  = true;
                        lnkbtnLast.CssClass = "GridPageLastActive";
                    }
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
예제 #21
0
        public List <ExpedienteBE> GetExpedienteRecepcionMuestraId(ExpedienteBE objExpediente)
        {
            List <ExpedienteBE>         lstExpediente    = null;
            Dictionary <string, object> searchParameters = null;

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

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

                if (reader.HasRows)
                {
                    lstExpediente = new List <ExpedienteBE>();

                    while (reader.Read())
                    {
                        ExpedienteBE oExpediente = new ExpedienteBE();

                        oExpediente.IdExpediente     = Convert.ToInt32(reader["IdExpediente"]);
                        oExpediente.CodigoExpediente = Convert.ToString(reader["CodigoExpediente"]);

                        oExpediente.IdTipoCliente = Convert.ToInt32(reader["IdTipoCliente"]);

                        oExpediente.Oficio = Convert.ToString(reader["Oficio"]);

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

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

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

                        oExpediente.DocumentoCustodia = Convert.ToString(reader["DocumentoCustodia"]);

                        if (!Convert.IsDBNull(reader["IdClaseProducto"]))
                        {
                            oExpediente.IdClaseProducto = Convert.ToInt32(reader["IdClaseProducto"]);
                        }

                        oExpediente.ClaseProducto = Convert.ToString(reader["ClaseProducto"]);

                        if (!Convert.IsDBNull(reader["IdTipoProducto"]))
                        {
                            oExpediente.IdTipoProducto = Convert.ToInt32(reader["IdTipoProducto"]);
                        }

                        oExpediente.TipoProducto = Convert.ToString(reader["TipoProducto"]);

                        if (!Convert.IsDBNull(reader["CantidadCustodia"]))
                        {
                            oExpediente.CantidadCustodia = Convert.ToInt32(reader["CantidadCustodia"]);
                        }

                        oExpediente.CondicionAmbiental = Convert.ToString(reader["CondicionAmbiental"]);
                        oExpediente.ContraMuestra      = Convert.ToString(reader["Contramuestra"]);
                        oExpediente.CamaraFria         = Convert.ToString(reader["CamaraFria"]);
                        oExpediente.PreCamara          = Convert.ToString(reader["PreCamara"]);

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

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

                        oExpediente.ContramuestraCER    = Convert.ToString(reader["ContramuestraCER"]);
                        oExpediente.ContramuestraFQ     = Convert.ToString(reader["ContramuestraFQ"]);
                        oExpediente.ContramuestraMicrob = Convert.ToString(reader["ContramuestraMicrob"]);
                        oExpediente.MuestraOficio       = Convert.ToString(reader["MuestraOficio"]);

                        if (!Convert.IsDBNull(reader["MuestraCantidad"]))
                        {
                            oExpediente.MuestraCantidad = Convert.ToInt32(reader["MuestraCantidad"]);
                        }

                        if (!Convert.IsDBNull(reader["IdAreaRetiro1"]))
                        {
                            oExpediente.IdAreaRetiro1 = Convert.ToInt32(reader["IdAreaRetiro1"]);
                        }

                        oExpediente.AreaRetiro1 = Convert.ToString(reader["AREA1"]);

                        if (!Convert.IsDBNull(reader["CantidadRetiro1"]))
                        {
                            oExpediente.CantidadRetiro1 = Convert.ToInt32(reader["CantidadRetiro1"]);
                        }

                        if (!Convert.IsDBNull(reader["IdAreaRetiro2"]))
                        {
                            oExpediente.IdAreaRetiro2 = Convert.ToInt32(reader["IdAreaRetiro2"]);
                        }

                        oExpediente.AreaRetiro2 = Convert.ToString(reader["AREA2"]);

                        if (!Convert.IsDBNull(reader["CantidadRetiro2"]))
                        {
                            oExpediente.CantidadRetiro2 = Convert.ToInt32(reader["CantidadRetiro2"]);
                        }

                        if (!Convert.IsDBNull(reader["CantidadRetiro2"]))
                        {
                            oExpediente.Saldo = Convert.ToDecimal(reader["Saldo"]);
                        }

                        oExpediente.MuestraUbicacion = Convert.ToString(reader["MuestraUbicacion"]);

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

                        oExpediente.InformeEnsayo = Convert.ToString(reader["InformeEnsayo"]);

                        if (!Convert.IsDBNull(reader["Conclusion"]))
                        {
                            oExpediente.Conclusion = Convert.ToInt32(reader["Conclusion"]);
                        }

                        oExpediente.NombreConclusion = Convert.ToString(reader["NombreConclusion"]);

                        oExpediente.Proforma = Convert.ToString(reader["Proforma"]);
                        oExpediente.Factura  = Convert.ToString(reader["Factura"]);

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

                        if (!Convert.IsDBNull(reader["Muestras"]))
                        {
                            oExpediente.Muestras = Convert.ToInt32(reader["Muestras"]);
                        }

                        oExpediente.NombreMuestras = Convert.ToString(reader["NombreMuestra"]);

                        lstExpediente.Add(oExpediente);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(lstExpediente);
        }
예제 #22
0
        public List <ExpedienteBE> ExportExpediente(ExpedienteBE objExpediente)
        {
            List <ExpedienteBE>         lstExpediente    = null;
            Dictionary <string, object> searchParameters = null;

            try
            {
                searchParameters = new Dictionary <string, object>()
                {
                    { "@CodigoExpediente", objExpediente.CodigoExpediente },
                    { "@CodigoCotizacion", objExpediente.CodigoCotizacion },
                    { "@IdTipoCliente", objExpediente.IdTipoCliente },
                    { "@Cliente", objExpediente.Cliente },
                    { "@Producto", objExpediente.Producto },
                    { "@IdEstado", objExpediente.IdEstado },
                    { "@IdEnsayo", objExpediente.IdEnsayo },
                    { "@IdAnalista", objExpediente.IdAnalista },
                    { "@FecCotizacion", objExpediente.FechaCotizacion },
                    { "@Procede", objExpediente.IdProcedencia }
                };

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

                if (reader.HasRows)
                {
                    lstExpediente = new List <ExpedienteBE>();

                    while (reader.Read())
                    {
                        ExpedienteBE oExpediente = new ExpedienteBE();

                        oExpediente.IdExpediente     = Convert.ToInt32(reader["IdExpediente"]);
                        oExpediente.CodigoExpediente = Convert.ToString(reader["Expediente"]);
                        oExpediente.CodigoCotizacion = Convert.ToString(reader["CodigoCotizacion"]);

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

                        oExpediente.Cliente         = Convert.ToString(reader["Cliente"]);
                        oExpediente.TipoCliente     = Convert.ToString(reader["Tipo_Cliente"]);
                        oExpediente.Situacion       = Convert.ToString(reader["Situacion"]);
                        oExpediente.Producto        = Convert.ToString(reader["Producto"]);
                        oExpediente.Lote            = Convert.ToString(reader["Lote"]);
                        oExpediente.Correo          = Convert.ToString(reader["Correo"]);
                        oExpediente.DocumentoFisico = Convert.ToString(reader["DocumentoFisico"]);
                        oExpediente.DocumentoAnexo  = Convert.ToString(reader["DocumentoAnexo"]);
                        oExpediente.Estado          = Convert.ToString(reader["Estado"]);
                        oExpediente.MotivoAnulacion = Convert.ToString(reader["Motivo_Anulacion"]);
                        oExpediente.NroEvaluacion   = Convert.ToInt32(reader["NroEvaluacion"]);

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

                        oExpediente.Evaluacion         = new EvaluacionBE();
                        oExpediente.Evaluacion.Procede = Convert.ToString(reader["Procede"]);

                        oExpediente.Evaluador        = new EvaluadorBE();
                        oExpediente.Evaluador.Nombre = Convert.ToString(reader["Analista"]);

                        oExpediente.Ensayo        = new EnsayoBE();
                        oExpediente.Ensayo.Nombre = Convert.ToString(reader["Ensayo"]);

                        oExpediente.Usuario       = new UsuarioBE();
                        oExpediente.Usuario.Login = Convert.ToString(reader["Usuario"]);

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

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

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

                        oExpediente.DocumentoCustodia = Convert.ToString(reader["DocumentoCustodia"]);

                        oExpediente.InformeEnsayo = Convert.ToString(reader["InformeEnsayo"]);

                        lstExpediente.Add(oExpediente);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(lstExpediente);
        }
예제 #23
0
        private void ExportarExcelPlantilla(System.Web.HttpResponse Response)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            DataTable dtExpediente = new DataTable();

            try
            {
                if (txtFilExpediente.Text.Trim() != string.Empty)
                {
                    objeto.CodigoExpediente = txtFilExpediente.Text.Trim();
                }
                else
                {
                    objeto.CodigoExpediente = "*";
                }

                if (txtFilCotizacion.Text.Trim() != string.Empty)
                {
                    objeto.CodigoCotizacion = txtFilCotizacion.Text.Trim();
                }
                else
                {
                    objeto.CodigoCotizacion = "*";
                }

                objeto.IdTipoCliente = Convert.ToInt32(ddlFilTipoCliente.SelectedValue);

                if (txtFilCliente.Text.Trim() != string.Empty)
                {
                    objeto.Cliente = txtFilCliente.Text.Trim();
                }
                else
                {
                    objeto.Cliente = "*";
                }

                objeto.Producto = txtFilProducto.Text.Trim();

                if (txtFilFecCotiz.Text == string.Empty)
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());
                }
                else
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(txtFilFecCotiz.Text);
                }


                objeto.FechaIngreso = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());


                objeto.IdEstado      = Convert.ToInt32(ddlFilEstado.SelectedValue);
                objeto.IdEnsayo      = Convert.ToInt32(ddlFilEnsayo.SelectedValue);
                objeto.IdAnalista    = Convert.ToInt32(ddlFilAnalista.SelectedValue);
                objeto.IdProcedencia = Convert.ToInt32(Constante.Numeros.Cero);

                var lstExpediente = new ExpedienteBLL().ExportExpediente(objeto);

                //crear datatable para enviar al metodo de descarga
                var dataTableDescargar = new System.Data.DataTable(Guid.NewGuid().ToString());
                var Expediente         = new DataColumn("Expediente", typeof(string));
                var Cliente            = new DataColumn("Cliente", typeof(string));
                var TipoCliente        = new DataColumn("TipoCliente", typeof(string));
                var Producto           = new DataColumn("Producto", typeof(string));
                var Lote              = new DataColumn("Lote", typeof(string));
                var DCI               = new DataColumn("DCI", typeof(string));
                var Clasificacion     = new DataColumn("Clasificacion", typeof(string));
                var Red               = new DataColumn("Red", typeof(string));
                var Norma             = new DataColumn("Norma", typeof(string));
                var Estado            = new DataColumn("Estado", typeof(string));
                var FechaIngreso      = new DataColumn("FechaIngreso", typeof(string));
                var FechaIngresoSIGEL = new DataColumn("FechaIngresoSIGEL", typeof(string));

                dataTableDescargar.Columns.AddRange(new DataColumn[] {
                    Expediente, Cliente, TipoCliente, Producto, Lote, DCI, Clasificacion, Red, Norma, Estado, FechaIngreso, FechaIngresoSIGEL
                });

                //Llenar data al datatable
                foreach (ExpedienteBE oExpediente in lstExpediente)
                {
                    DataRow RowFile = dataTableDescargar.NewRow();

                    RowFile["Expediente"]    = oExpediente.CodigoExpediente;
                    RowFile["Cliente"]       = oExpediente.Cliente;
                    RowFile["TipoCliente"]   = oExpediente.TipoCliente;
                    RowFile["Producto"]      = oExpediente.Producto;
                    RowFile["Lote"]          = oExpediente.Lote;
                    RowFile["DCI"]           = oExpediente.DCI;
                    RowFile["Clasificacion"] = oExpediente.Clasificacion;
                    RowFile["Red"]           = oExpediente.Red;
                    RowFile["Norma"]         = oExpediente.Norma;
                    RowFile["Estado"]        = oExpediente.Estado;

                    if (oExpediente.FechaIngreso != Convert.ToDateTime("01/01/1901"))
                    {
                        RowFile["FechaIngreso"] = string.Format("{0:d}", oExpediente.FechaIngreso);
                    }
                    else
                    {
                        RowFile["FechaIngreso"] = string.Empty;
                    }

                    if (oExpediente.FechaIngresoSIGEL != Convert.ToDateTime("01/01/1901"))
                    {
                        RowFile["FechaIngresoSIGEL"] = string.Format("{0:d}", oExpediente.FechaIngresoSIGEL);
                    }
                    else
                    {
                        RowFile["FechaIngresoSIGEL"] = string.Empty;
                    }

                    dataTableDescargar.Rows.Add(RowFile);
                }

                ExportarUtils ObjExporExcel = new ExportarUtils();

                object[] pNombreCabeceras = new object[] { "Expediente", "Cliente", "Tipo Cliente", "Producto", "Lote", "DCI", "Clasificacion", "Red", "Norma", "Estado", "Fecha Ingreso", "Fecha Ingreso SIGEL" };
                object[] pEstilos         = new object[] { new object[] { 11, OleDbType.Date }, new object[] { 12, OleDbType.Date } };
                string   MessageOut       = ObjExporExcel.DescargarDataTableToExcel(dataTableDescargar, "Archivo Seguimiento Expediente", pNombreCabeceras, pEstilos, Page.Response);

                if (MessageOut != "OK")
                {
                    //objMsgBox.MsgBoxCC(lblMensaje, MessageOut, "Error");
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }
        private void ExportarExcelPlantilla(System.Web.HttpResponse Response)
        {
            ExpedienteBLL capanegocios = new ExpedienteBLL();
            ExpedienteBE  objeto       = new ExpedienteBE();

            DataTable dtExpediente = new DataTable();

            try
            {
                if (txtFilExpediente.Text.Trim() != string.Empty)
                {
                    objeto.CodigoExpediente = txtFilExpediente.Text.Trim();
                }
                else
                {
                    objeto.CodigoExpediente = "*";
                }

                if (txtFilCotizacion.Text.Trim() != string.Empty)
                {
                    objeto.CodigoCotizacion = txtFilCotizacion.Text.Trim();
                }
                else
                {
                    objeto.CodigoCotizacion = "*";
                }

                objeto.IdTipoCliente = Convert.ToInt32(ddlFilTipoCliente.SelectedValue);

                if (txtFilCliente.Text.Trim() != string.Empty)
                {
                    objeto.Cliente = txtFilCliente.Text.Trim();
                }
                else
                {
                    objeto.Cliente = "*";
                }

                objeto.Producto = txtFilProducto.Text.Trim();

                if (txtFilFecCotiz.Text == string.Empty)
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(doMain.Utils.FechaNulaUtils.FechaNula());
                }
                else
                {
                    objeto.FechaCotizacion = Convert.ToDateTime(txtFilFecCotiz.Text);
                }

                objeto.IdEstado      = Convert.ToInt32(ddlFilEstado.SelectedValue);
                objeto.IdEnsayo      = Convert.ToInt32(ddlFilEnsayo.SelectedValue);
                objeto.IdAnalista    = Convert.ToInt32(ddlFilAnalista.SelectedValue);
                objeto.IdProcedencia = Convert.ToInt32(ddlFilProcede.SelectedValue);

                var lstExpediente = new ExpedienteBLL().ExportExpediente(objeto);

                //crear datatable para enviar al metodo de descarga
                var dataTableDescargar = new System.Data.DataTable(Guid.NewGuid().ToString());
                var Expediente         = new DataColumn("Expediente", typeof(string));
                var Cotizacion         = new DataColumn("Cotizacion", typeof(string));
                var FechaCotizacion    = new DataColumn("FechaCotizacion", typeof(string));
                var Cliente            = new DataColumn("Cliente", typeof(string));
                var TipoCliente        = new DataColumn("TipoCliente", typeof(string));
                var Producto           = new DataColumn("Producto", typeof(string));
                var Lote            = new DataColumn("Lote", typeof(string));
                var Correo          = new DataColumn("Correo", typeof(string));
                var DocumentoFisico = new DataColumn("DocumentoFisico", typeof(string));
                var DocumentoAnexo  = new DataColumn("DocumentoAnexo", typeof(string));
                var Ubicacion       = new DataColumn("Ubicacion", typeof(string));
                var Estado          = new DataColumn("Estado", typeof(string));
                var Ensayo          = new DataColumn("Ensayo", typeof(string));
                var Analista        = new DataColumn("Analista", typeof(string));
                var Procede         = new DataColumn("Procede", typeof(string));
                var Situacion       = new DataColumn("Situacion", typeof(string));
                var MotivoAnulacion = new DataColumn("MotivoAnulacion", typeof(string));

                dataTableDescargar.Columns.AddRange(new DataColumn[] {
                    Expediente, Cotizacion, FechaCotizacion, Cliente, TipoCliente, Producto, Lote, Correo, DocumentoFisico, DocumentoAnexo, Ubicacion, Estado, Ensayo, Analista, Procede, Situacion, MotivoAnulacion
                });

                //Llenar data al datatable
                foreach (ExpedienteBE oExpediente in lstExpediente)
                {
                    DataRow RowFile = dataTableDescargar.NewRow();

                    RowFile["Expediente"] = oExpediente.CodigoExpediente;
                    RowFile["Cotizacion"] = oExpediente.CodigoCotizacion;

                    if (oExpediente.FechaCotizacion != Convert.ToDateTime("01/01/1901"))
                    {
                        RowFile["FechaCotizacion"] = string.Format("{0:d}", oExpediente.FechaCotizacion);
                    }
                    else
                    {
                        RowFile["FechaCotizacion"] = string.Empty;
                    }

                    RowFile["Cliente"]         = oExpediente.Cliente;
                    RowFile["TipoCliente"]     = oExpediente.TipoCliente;
                    RowFile["Producto"]        = oExpediente.Producto;
                    RowFile["Lote"]            = oExpediente.Lote;
                    RowFile["Correo"]          = oExpediente.Correo;
                    RowFile["DocumentoFisico"] = oExpediente.DocumentoFisico;
                    RowFile["DocumentoAnexo"]  = oExpediente.DocumentoAnexo;
                    RowFile["Ubicacion"]       = oExpediente.Usuario.Login;
                    RowFile["Estado"]          = oExpediente.Estado;
                    RowFile["Ensayo"]          = oExpediente.Ensayo.Nombre;
                    RowFile["Analista"]        = oExpediente.Evaluador.Nombre;
                    RowFile["Procede"]         = oExpediente.Evaluacion.Procede;
                    RowFile["Situacion"]       = oExpediente.Situacion;
                    RowFile["MotivoAnulacion"] = oExpediente.MotivoAnulacion;

                    dataTableDescargar.Rows.Add(RowFile);
                }

                ExportarUtils ObjExporExcel = new ExportarUtils();

                object[] pNombreCabeceras = new object[] { "Expediente", "Cotizacion", "Fecha Cotizacion", "Cliente", "Tipo Cliente", "Producto", "Lote", "Correo", "Documento Fisico", "Documento Anexo", "Ubicacion", "Estado", "Ensayo", "Analista", "Procede", "Situacion", "Motivo Anulacion" };
                object[] pEstilos         = new object[] { new object[] { 3, OleDbType.Date } };
                string   MessageOut       = ObjExporExcel.DescargarDataTableToExcel(dataTableDescargar, "Archivo Seguimiento Expediente", pNombreCabeceras, pEstilos, Page.Response);

                if (MessageOut != "OK")
                {
                    //objMsgBox.MsgBoxCC(lblMensaje, MessageOut, "Error");
                }
            }
            catch (Exception ex)
            {
                errores = ex.Message;
            }
        }