Exemple #1
0
        protected void drpCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            catID = Convert.ToInt32(drpCategory.SelectedValue);
            ViewState.Add("CatID", catID);
            if (drpLocation.SelectedIndex != 0)
            {
                LocID = Convert.ToInt32(ViewState["LocID"]);
                ResourceHandler resHandler = new ResourceHandler();
                List <Resource> resList    = resHandler.GetResourceListByCatIDandLocation(catID, Convert.ToInt32(drpLocation.SelectedValue));
                if (resList != null)
                {
                    RadComboBox1.DataSource     = resList;
                    RadComboBox1.DataTextField  = "name";
                    RadComboBox1.DataValueField = "ID";
                    RadComboBox1.DataBind();
                }
                else
                {
                    RadComboBox1.Items.Clear();
                }
            }
            else
            {
                int roleId = Convert.ToInt32(Session["RoleId"]);
                LocID = Convert.ToInt32(ViewState["LocID"]);
                ResourceHandler resHandler = new ResourceHandler();
                List <Resource> resList    = new List <Resource>();

                if (roleId == 37 || roleId == 38)//edari molasadra
                {
                    resList = resHandler.GetResourceListByCatIDandLocation(catID, 1);
                }
                if (roleId == 39 || roleId == 40)//edari ram
                {
                    resList = resHandler.GetResourceListByCatIDandLocation(catID, 2);
                }
                if (resList != null)
                {
                    RadComboBox1.DataSource     = resList;
                    RadComboBox1.DataTextField  = "name";
                    RadComboBox1.DataValueField = "ID";
                    RadComboBox1.DataBind();
                }
                else
                {
                    RadComboBox1.Items.Clear();
                }
            }
            string scrp = "var objCal1 = new AMIB.persianCalendar('ContentPlaceHolder1_pcal1', {extraInputID: 'ContentPlaceHolder1_pcal1',extraInputFormat: 'yyyy/mm/dd'}); ";

            ScriptManager.RegisterStartupScript(this, GetType(), ClientID, scrp, true);
        }
Exemple #2
0
 protected void drpChooseToEditCategory_SelectedIndexChanged(object sender, EventArgs e)
 {
     catID = Convert.ToInt32(drpChooseToEditCategory.SelectedValue);
     ViewState.Add("CatID", catID);
     if (drpChooseToEditCategory.SelectedIndex != 0)
     {
         LocID = Convert.ToInt32(ViewState["LocID"]);
         ResourceHandler resHandler = new ResourceHandler();
         List <Resource> resList    = resHandler.GetResourceListByCatIDandLocation(catID, Convert.ToInt32(drpResourceNewLocation.SelectedValue));
         LoadListControl <Resource>(drpChoosToEditResource, resList, "name", "ID");
         ViewState.Add("reslist", resList);
     }
 }
Exemple #3
0
        private void BindGrid(string category)
        {
            LocID = Convert.ToInt32(ViewState["LocID"]);
            catID = Convert.ToInt32(ViewState["CatID"]);
            List <Resource> reslist;
            ResourceHandler rs = new ResourceHandler();

            if (LocID == 0)
            {
                reslist = rs.GetResourceListByCatID(catID);
            }
            else
            {
                reslist = rs.GetResourceListByCatIDandLocation(Convert.ToInt32(category), LocID);
            }

            grdResourceList.DataSource = reslist;
            grdResourceList.DataBind();
        }