コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HyperLink activeHyp = Master.FindControl("HypDashBoard") as HyperLink;

            activeHyp.CssClass += " active";

            using (PTCLEntities db = new PTCLEntities())
            {
                if (Session["AdminID"] != null)
                {
                    var totalCustomerCount = db.GetPtclUsers().ToList();
                    int counCustomer       = totalCustomerCount.Count;
                    lblTotalCustomers.Text = counCustomer.ToString();

                    var totalAdminCount = db.GetPtclAdmins().ToList();
                    int counAdmins      = totalAdminCount.Count;
                    LblTotalAdmins.Text = counAdmins.ToString();

                    var totalComplaints   = db.GetComplaints().ToList();
                    int mytotalComplaints = totalComplaints.Count;
                    lblTotalComplaints.Text = mytotalComplaints.ToString();
                }
            }
        }