Esempio n. 1
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            string username = txtUsername.Text;
            string password = txtPassword.Text;

            GlobalData.pass = password;
            Login(username, password);
            if (s.role == 1)
            {
                IndexAdmin f = new IndexAdmin(s);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            if (s.role == 2)
            {
                QLSP f = new QLSP(s);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
            if (s.role == 3)
            {
                IndexBanHang f = new IndexBanHang(s);
                this.Hide();
                f.ShowDialog();
                this.Show();
            }
        }
        public ActionResult Index()
        {
            Dashboard        model      = IndexAdmin.GetItem();
            List <DataPoint> dataPoints = new List <DataPoint>();
            var listpost = db.USP_GetPostCountBydate();

            foreach (USP_GetPostCountBydate_Result a in listpost)
            {
                dataPoints.Add(new DataPoint(String.Format("{0:d}", a.date), Convert.ToDouble(a.count)));
            }


            ViewBag.DataPoints = JsonConvert.SerializeObject(dataPoints);
            return(View(model));
        }