Ejemplo n.º 1
0
        public async Task <IEnumerable <ReportVmOffice> > grafica003(ReportVmOffice Item)
        {
            List <ReportVmOffice> mostrar = null;

            using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["CallCloud"].ConnectionString))
            {
                cn.Open();
                string proc = "Rsp_Report_Office_Day";
                using (SqlCommand cmd = new SqlCommand(proc, cn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    SqlParameter param1 = cmd.Parameters.AddWithValue("@office", Item.pk_office ?? "");
                    SqlParameter param2 = cmd.Parameters.AddWithValue("@Year", Item.YearPa ?? "");
                    SqlParameter param3 = cmd.Parameters.AddWithValue("@Month", Item.MonthPa ?? "");

                    using (SqlDataReader dr = await cmd.ExecuteReaderAsync(CommandBehavior.SingleResult))
                    {
                        if (dr != null)
                        {
                            mostrar = new List <ReportVmOffice>();
                            while (await dr.ReadAsync())
                            {
                                Item             = new ReportVmOffice();
                                Item.MountDay    = Convert.ToDateTime(dr["DateCreated"]).ToShortDateString();
                                Item.cantidadDay = Convert.ToInt32(dr["Quantity"]);
                                mostrar.Add(Item);
                            }
                        }
                    }
                }
            }
            return(mostrar);
        }
Ejemplo n.º 2
0
        //graficas por oficina
        public async Task <IEnumerable <ReportVmOffice> > grafica01(ReportVmOffice Item)
        {
            List <ReportVmOffice> mostrar = null;

            using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["CallCloud"].ConnectionString))
            {
                cn.Open();
                SqlCommand cmd = new SqlCommand
                {
                    CommandText = "Rsp_Report_Office_Year",
                    CommandType = CommandType.StoredProcedure,
                    Connection  = cn
                };
                SqlParameter parma1 = cmd.Parameters.AddWithValue("@Enterpresi", Item.codigoEmpresa ?? "");
                parma1.Direction = ParameterDirection.Input;

                using (SqlDataReader dr = await cmd.ExecuteReaderAsync())
                {
                    if (dr != null)
                    {
                        mostrar = new List <ReportVmOffice>();
                        while (await dr.ReadAsync())
                        {
                            Item                = new ReportVmOffice();
                            Item.añoofi         = dr["Year"].ToString();
                            Item.cantidadoffice = Convert.ToInt32(dr["Quantity"]);
                            Item.pk_off         = dr["Office"].ToString();
                            Item.name_office    = dr["Name_office"].ToString();
                            mostrar.Add(Item);
                        }
                    }
                }
            }
            return(mostrar);
        }
Ejemplo n.º 3
0
        public async Task <IEnumerable <ReportVmOffice> > graficas002(ReportVmOffice Item)
        {
            List <ReportVmOffice> mostrar = null;

            using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["CallCloud"].ConnectionString))
            {
                cn.Open();
                string proc = "Rsp_Report_Office_Month";
                using (SqlCommand cmd = new SqlCommand(proc, cn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    SqlParameter param1 = cmd.Parameters.AddWithValue("@office", Item.codigoOff ?? "");
                    param1.Direction = ParameterDirection.Input;
                    SqlParameter param2 = cmd.Parameters.AddWithValue("@Year", Item.añooff ?? "");
                    param2.Direction = ParameterDirection.Input;
                    using (SqlDataReader dr = await cmd.ExecuteReaderAsync(CommandBehavior.SingleResult))
                    {
                        if (dr != null)
                        {
                            mostrar = new List <ReportVmOffice>();
                            while (await dr.ReadAsync())
                            {
                                Item              = new ReportVmOffice();
                                Item.mesof        = dr["Month"].ToString();
                                Item.cantidadOfic = Convert.ToInt32(dr["Quantity"]);
                                Item.name         = dr["Name_Office"].ToString();
                                Item.pk_office11  = dr["Office"].ToString();

                                mostrar.Add(Item);
                            }
                        }
                    }
                }
            }
            return(mostrar);
        }