Ejemplo n.º 1
0
        //jhonatan fernandez



        public async Task <IEnumerable <ReportVmAgent> > Agent_LLamad(ReportVmAgent Item)
        {
            List <ReportVmAgent> mostrar = null;

            using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["CallCloud"].ConnectionString))
            {
                cn.Open();
                SqlCommand cmd = new SqlCommand
                {
                    CommandText = "Rsp_Report_Agent_Call",
                    CommandType = CommandType.StoredProcedure,
                    Connection  = cn
                };
                SqlParameter param1 = cmd.Parameters.AddWithValue("@pk_agente", (Item != null) ? Item.Para_pkagente : "");
                param1.Direction = ParameterDirection.Input;
                SqlParameter param2 = cmd.Parameters.AddWithValue("@data", (Item != null) ? Convert.ToDateTime(Item.para_fecha).ToShortDateString() : "");
                param2.Direction = ParameterDirection.Input;

                using (SqlDataReader dr = await cmd.ExecuteReaderAsync(CommandBehavior.SingleResult))
                {
                    if (dr != null)
                    {
                        mostrar = new List <ReportVmAgent>();
                        while (await dr.ReadAsync())
                        {
                            Item             = new ReportVmAgent();
                            Item.cantidad000 = Convert.ToInt32(dr["Quantity"]);
                            Item.hora        = dr["Hors"].ToString();
                            mostrar.Add(Item);
                        }
                    }
                }
            }
            return(mostrar);
        }
Ejemplo n.º 2
0
        //Grafica por Agente

        public async Task <IEnumerable <ReportVmAgent> > graph_Year_Agent(ReportVmAgent Item)
        {
            List <ReportVmAgent> mostrar = null;

            using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["CallCloud"].ConnectionString))
            {
                cn.Open();
                SqlCommand cmd = new SqlCommand
                {
                    CommandText = "Rsp_Report_Agent_Year",
                    CommandType = CommandType.StoredProcedure,
                    Connection  = cn
                };
                SqlParameter param1 = cmd.Parameters.AddWithValue("@pk_Boss", Item.pk_supervisor ?? "");
                param1.Direction = ParameterDirection.Input;
                using (SqlDataReader dr = await cmd.ExecuteReaderAsync(CommandBehavior.SingleResult))
                {
                    if (dr != null)
                    {
                        mostrar = new List <ReportVmAgent>();
                        while (await dr.ReadAsync())
                        {
                            Item               = new ReportVmAgent();
                            Item.codigo        = dr["Agent"].ToString();
                            Item.cantidad      = Convert.ToInt32(dr["Quantity"]);
                            Item.año           = Convert.ToInt32(dr["Year"]);
                            Item.nombre_agente = dr["Name_Agent"].ToString();
                            mostrar.Add(Item);
                        }
                    }
                }
            }
            return(mostrar);
        }
Ejemplo n.º 3
0
        public async Task <IEnumerable <ReportVmAgent> > graph_Day_Agent(ReportVmAgent Item)
        {
            List <ReportVmAgent> mostrar = null;

            using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["CallCloud"].ConnectionString))
            {
                cn.Open();
                SqlCommand cmd = new SqlCommand
                {
                    CommandText = "Rsp_Report_Agent_Day",
                    CommandType = CommandType.StoredProcedure,
                    Connection  = cn
                };
                SqlParameter param1 = cmd.Parameters.AddWithValue("@pk_Agent", (Item != null) ? Item.pk_Boss_param : "");
                param1.Direction = ParameterDirection.Input;
                SqlParameter param2 = cmd.Parameters.AddWithValue("@month", (Item != null) ? Item.Month_param : "");
                param2.Direction = ParameterDirection.Input;
                SqlParameter param3 = cmd.Parameters.AddWithValue("@Year", (Item != null) ? Item.YearParam : "");
                using (SqlDataReader dr = await cmd.ExecuteReaderAsync(CommandBehavior.SingleResult))
                {
                    if (dr != null)
                    {
                        mostrar = new List <ReportVmAgent>();
                        while (await dr.ReadAsync())
                        {
                            Item             = new ReportVmAgent();
                            Item.dias        = Convert.ToDateTime(dr["DateCreated"]).ToShortDateString();
                            Item.cantidad2   = Convert.ToInt32(dr["Quantity"]);
                            Item.name_agentt = dr["name_Agent"].ToString();
                            mostrar.Add(Item);
                        }
                    }
                }
            }
            return(mostrar);
        }