Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id          = Convert.ToInt16(Session["USERID"].ToString());
            int rankingUp   = 0;
            int rankingDown = 0;
            var currentUser = db.Users.Where(x => x.Id == id).FirstOrDefault();

            username.InnerText      = currentUser.Username;
            fullName.InnerText      = currentUser.FullName;
            nameOfPatient.InnerText = currentUser.FullName;
            Mobile.InnerText        = currentUser.MobileNumber;
            city.InnerText          = currentUser.City;


            userType.InnerText = "مريض";
            if (currentUser.ProfilePhoto != null)
            {
                Image.ImageUrl = function.image_retrive(id);
            }
            Session["reportedUser"] = currentUser.Id;
            foreach (var rate in db.Ratings)
            {
                if (rate.RatedForUser == id && rate.RateValue > 2)
                {
                    rankingUp += 1;
                }
                if (rate.RatedForUser == id && rate.RateValue <= 2)
                {
                    rankingDown += 1;
                }
            }
            ratesUp.InnerText   = rankingUp.ToString();
            ratesDown.InnerText = rankingDown.ToString();
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string username    = Session["doctorid"].ToString();
            int    rankingUp   = 0;
            int    rankingDown = 0;
            var    currentUser = db.Users.Where(x => x.Username == username).FirstOrDefault();
            int    id          = currentUser.Id;

            doctorName.InnerText = currentUser.FullName;
            FullName.InnerText   = currentUser.FullName;
            Major.InnerText      = currentUser.Major;
            City.InnerText       = currentUser.City + "-" + currentUser.Address;
            Price.InnerText      = currentUser.Price;
            if (currentUser.UserType == 1)
            {
                userType.InnerText = "دكتور";
            }
            if (currentUser.UserType == 2)
            {
                userType.InnerText = "ممرض";
            }

            if (currentUser.ProfilePhoto != null)
            {
                image.ImageUrl = function.image_retrive(id);
            }
            Session["reportedUser"] = currentUser.Id;
            foreach (var rate in db.Ratings)
            {
                if (rate.RatedForUser == id && rate.RateValue >= 2)
                {
                    rankingUp += 1;
                }
                if (rate.RatedForUser == id && rate.RateValue < 2)
                {
                    rankingDown += 1;
                }
            }
            ratesUp.InnerText   = rankingUp.ToString();
            ratesDown.InnerText = rankingDown.ToString();
        }