Exemple #1
0
        private void BindGrid()
        {
            int             roleId  = Convert.ToInt32(Session["RoleId"]);
            ResourceHandler rs      = new ResourceHandler();
            List <Resource> reslist = rs.GetResourceList();

            //
            if (roleId == 38 || roleId == 37)
            {
                reslist = rs.GetResourceList().Where(w => w.Location == "ملاصدرا").ToList();
            }
            if (roleId == 39 || roleId == 40)
            {
                reslist = rs.GetResourceList().Where(w => w.Location == "ساختمان رام").ToList();
            }
            if (chkbLocationByRole.Checked)
            {
                reslist = rs.GetResourceList();
            }
            //if (drpLocation.SelectedIndex == 1)
            //{
            //    reslist = rs.GetResourceList().Where(w => w.Location == "ملاصدرا").ToList();
            //}

            //if (drpLocation.SelectedIndex == 2)
            //{
            //    reslist = rs.GetResourceList().Where(w => w.Location == "ساختمان رام").ToList();
            //}

            //
            grdResourceList.DataSource = reslist;
            grdResourceList.DataBind();
        }
Exemple #2
0
        private void BindData()
        {
            List <Category> allcats = new List <Category>();
            CategoryHandler cth     = new CategoryHandler();

            allcats = cth.GetCategoryList();
            LoadListControl <Category>(drpChooseCategory, allcats, "name", "ID");

            List <Option> options = new List <Option>();
            OptionHandler opt     = new OptionHandler();

            options = opt.GetOptionList();
            LoadListControl <Option>(chkblSelecetOptions, options, "name", "ID");

            LocationHandler locH    = new LocationHandler();
            List <Location> loclist = locH.GetAllLocation();

            drpNewResLocation.DataSource     = loclist;
            drpNewResLocation.DataTextField  = "name";
            drpNewResLocation.DataValueField = "id";
            drpNewResLocation.DataBind();

            List <Resource> reslist = new List <Resource>();
            ResourceHandler rs      = new ResourceHandler();

            reslist = rs.GetResourceList();
            grdResourceList.DataSource = reslist;
            grdResourceList.DataBind();
        }
Exemple #3
0
        private void BindGrid(string category, List <Telerik.Web.UI.RadComboBoxItem> selected)
        {
            ResourceHandler rs         = new ResourceHandler();
            List <Resource> reslist    = rs.GetResourceList();
            Resource        res        = null;
            List <Resource> newResList = new List <Resource>();

            foreach (RadComboBoxItem item in RadComboBox1.Items)
            {
                if (item.Checked == true)
                {
                    res = rs.GetResourceDetails(Convert.ToInt32(item.Value));
                    newResList.Add(res);
                }
            }
            //foreach (var item in selected)
            //{
            //    res = rs.GetResourceDetails(Convert.ToInt32(item.Value));
            //    newResList.Add(res);
            //}
            grdResourceList.DataSource = newResList;
            grdResourceList.DataBind();
        }