Пример #1
0
 public GeoInfoReport(GeoInfoReportModel m)
 {
     idReporte     = m.idReporte;
     Name          = m.Name;
     Categorie     = m.Categorie;
     Chain         = m.Chain;
     BusinessName  = m.BusinessName;
     Direction     = m.Direction;
     UserName      = m.UserName;
     IdPDV         = m.IdPDV;
     CreationDate  = m.CreationDate;
     CloseDate     = m.CloseDate;
     SendDate      = m.SendDate;
     ReceptionDate = m.ReceptionDate;
     UpdateDate    = m.UpdateDate;
     Signature     = m.Signature;
 }
Пример #2
0
        public GeoInfoReportModel GetInfoReporte(int idReporte)
        {
            GeoInfoReportModel infoRep = null;

            using (SqlConnection cn = new SqlConnection((new RepContext()).Database.Connection.ConnectionString.ToString()))
            {
                SqlCommand cmd = new SqlCommand("GetInfoReporteGeo", cn)
                {
                    CommandType = CommandType.StoredProcedure
                };
                cmd.Parameters.Add("@IdReporte", SqlDbType.Int).Value = idReporte;

                cn.Open();

                SqlDataReader r = cmd.ExecuteReader();

                if (r.HasRows && r.Read())
                {
                    infoRep = new GeoInfoReportModel
                    {
                        idReporte     = int.Parse(r["idReporte"].ToString()),
                        Name          = r["puntoDeVenta"].ToString(),
                        Categorie     = r["categoria"].ToString(),
                        Chain         = r["cadena"].ToString(),
                        BusinessName  = r["razonSocial"].ToString(),
                        Direction     = r["direccion"].ToString(),
                        UserName      = r["usuario"].ToString(),
                        IdPDV         = int.Parse(r["idPuntoDeVenta"].ToString()),
                        CreationDate  = r["fechaCreacion"].ToString(),
                        CloseDate     = r["fechaCierre"].ToString(),
                        SendDate      = r["fechaEnvio"].ToString(),
                        ReceptionDate = r["fechaRecepcion"].ToString(),
                        UpdateDate    = r["fechaActualizacion"].ToString(),
                        Signature     = (r["firma"].ToString() == "1")
                    };
                }
            }
            return(infoRep);
        }