Exemplo n.º 1
0
        private void BindInstitutes()
        {
            var Institutes = _regDal.GetInstitutes();

            if (Session["TeamID"] != null)
            {
                int    userId = Convert.ToInt32(Session["UserId"]);
                UserBo user   = _tcDal.GetUserDetailsByUserId(userId);
                Institutes = Institutes.Where(ins => ins.InstituteId == user.InstituteID).ToList();
            }

            if (Institutes != null)
            {
                ddlInstitute.DataSource     = Institutes;
                ddlInstitute.DataTextField  = "InstituteName";
                ddlInstitute.DataValueField = "InstituteId";
                ddlInstitute.DataBind();
            }

            ddlInstitute.Items.Insert(0, new ListItem("SELECT", "0"));
        }