protected void drpChooseDanshkade_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (drpChooseDanshkade.SelectedIndex > 0)
     {
         //RadComboBoxField.Enabled = true;
         int            daneshID  = Convert.ToInt32(Session["DaneshId"]);
         RC_UserHandler usrH      = new RC_UserHandler();
         List <RC_User> listostad = usrH.GetOstadListByDaneshID(Convert.ToInt32(drpChooseDanshkade.SelectedValue));
         if (listostad?.Count > 0)
         {
             for (int i = 0; i <= listostad.Count - 1; i++)
             {
                 listostad[i].Name = listostad[i].Name.Replace("ي", "ی");
             }
         }
         if (listostad != null)
         {
             RadComboBoxField.DataSource = listostad.Distinct();
         }
         RadComboBoxField.Items.Clear();
         RadComboBoxField.DataTextField  = "name";
         RadComboBoxField.DataValueField = "ID";
         RadComboBoxField.DataBind();
         RadComboBoxField.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("جستجو و انتخاب کنید"));
     }
     //else
     //{
     //    resetform();
     //}
 }
        protected void BindGrid()
        {
            RequestHandler rq = new RequestHandler();

            _reqlist = rq.GetDeletedRequestListOfTermJari();/*.Where(x=>x.Issue_time == pcal1.Text).ToList();*/
            grdDeletedRequest.DataSource = _reqlist;
            grdDeletedRequest.DataBind();
            List <string> issuerNames = new List <string>();

            foreach (var x in _reqlist)
            {
                issuerNames.Add(x.IssuerName);
            }

            //drpIssureName.DataSource = issuerNames;
            //drpIssureName.DataBind();
            //drpIssureName.Items.Insert(0, "انتخاب کنید");

            Daneshkade item = new Daneshkade();

            item.NameDanesh = "--انتخاب کنید--";
            item.ID         = -1;
            DaneshkadeHandler dnsh = new DaneshkadeHandler();

            dnshList = dnsh.GetAllDaneshkade();
            dnshList.Insert(0, item);
            //  drpChooseDanshkade.Items.Clear();
            drpChooseDanshkade.DataSource     = dnshList;
            drpChooseDanshkade.DataTextField  = "NameDanesh";
            drpChooseDanshkade.DataValueField = "ID";
            drpChooseDanshkade.DataBind();

            RC_UserHandler usrH = new RC_UserHandler();

            daneshID = Convert.ToInt32(Session["DaneshId"]);
            List <RC_User> listostad = usrH.GetOstadListByDaneshID(daneshID);//need to get list of ostad of one daneshkade

            if (listostad != null)
            {
                for (int i = 0; i <= listostad.Count - 1; i++)
                {
                    listostad[i].Name = listostad[i].Name.Replace("ي", "ی");
                }
            }

            RadComboBoxField.DataSource     = listostad;
            RadComboBoxField.DataTextField  = "name";
            RadComboBoxField.DataValueField = "ID";
            RadComboBoxField.DataBind();
            RadComboBoxField.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("جستجو و انتخاب کنید"));
        }
        private void ToAddMode()
        {
            CategoryHandler cth = new CategoryHandler();

            catlist = cth.GetCategoryList();
            drpCategory.DataSource     = catlist;
            drpCategory.DataTextField  = "name";
            drpCategory.DataValueField = "ID";
            drpCategory.DataBind();
            drpCategory.Items.Insert(0, "انتخاب کنید");
            trOptions.Visible   = false;
            drpLocation.Enabled = false;
            RC_UserHandler usrH = new RC_UserHandler();

            daneshID = Convert.ToInt32(Session["DaneshId"]);
            List <RC_User> listostad = usrH.GetOstadListByDaneshID(daneshID);//need to get list of ostad of one daneshkade

            if (listostad != null)
            {
                for (int i = 0; i <= listostad.Count - 1; i++)
                {
                    listostad[i].Name = listostad[i].Name.Replace("ي", "ی");
                }
            }

            RadComboBoxField.DataSource     = listostad;
            RadComboBoxField.DataTextField  = "name";
            RadComboBoxField.DataValueField = "ID";
            RadComboBoxField.DataBind();
            RadComboBoxField.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("جستجو و انتخاب کنید"));
            drpCourse.Items.Insert(0, "انتخاب کنید");
            lblHeader.Text        = "ثبت درخواست";
            btnAddRquest.Enabled  = true;
            btnAddRquest.Visible  = true;
            trDaneshkadeh.Visible = false;
        }
        protected void drpCategory_SelectedIndexChanged1(object sender, EventArgs e)
        {
            chkMeeting.Checked = false;
            chkMeeting_CheckedChanged(sender, e);
            if ((drpCategory.SelectedIndex == 1) || (drpCategory.SelectedIndex == 2) || (drpCategory.SelectedIndex == 3))
            {
                if (drpCategory.SelectedIndex == 1)
                {
                    txtCapacity.Text     = 1.ToString();
                    txtCapacity.ReadOnly = true;
                }
                else
                {
                    txtCapacity.ReadOnly = false;
                }
                trOptions.Visible   = true;
                chblOptions.Enabled = true;
                drpLocation.Enabled = true;
                LocationHandler locH = new LocationHandler();
                drpLocation.Items.Clear();
                drpLocation.DataSource     = locH.GetLocationListByCatID(Convert.ToInt32(drpCategory.SelectedValue)).Distinct();
                drpLocation.DataTextField  = "name";
                drpLocation.DataValueField = "ID";
                drpLocation.DataBind();
                drpLocation.Items.Insert(0, "انتخاب کنید");
                OptionHandler opt = new OptionHandler();
                optlist = opt.GetOptionListByCatID(Convert.ToInt32(drpCategory.SelectedValue));
                chblOptions.Items.Clear();
                chblOptions.DataSource     = optlist;
                chblOptions.DataTextField  = "name";
                chblOptions.DataValueField = "ID";
                chblOptions.DataBind();

                trDaneshkadeh.Visible = userID == 1;
                Daneshkade item = new Daneshkade();
                item.NameDanesh = "--انتخاب کنید--";
                item.ID         = -1;
                DaneshkadeHandler dnsh = new DaneshkadeHandler();
                dnshList = dnsh.GetAllDaneshkade();
                dnshList.Insert(0, item);
                drpChooseDanshkade.Items.Clear();
                drpChooseDanshkade.DataSource     = dnshList;
                drpChooseDanshkade.DataTextField  = "NameDanesh";
                drpChooseDanshkade.DataValueField = "ID";
                drpChooseDanshkade.DataBind();


                if (drpCategory.SelectedIndex == 3 || drpCategory.SelectedIndex == 2)
                {
                    chkMeeting.Visible = true;
                    if (drpCategory.SelectedIndex == 2)
                    {
                        chkMeeting.Text = "بدون استاد";
                    }
                    else
                    {
                        chkMeeting.Text = " تخصیص سالن کنفرانس جهت برگزاری جلسات";
                    }
                }
                else
                {
                    chkMeeting.Visible = false;
                }
            }
            else
            {
                trOptions.Visible   = false;
                chblOptions.Enabled = false;
                drpLocation.Enabled = false;
                chkMeeting.Visible  = false;
            }
            ////////////////////////////////////////////
            RadComboBoxField.Enabled = true;
            RC_UserHandler usrH      = new RC_UserHandler();
            List <RC_User> listostad = usrH.GetOstadListByDaneshID(Convert.ToInt32(Session["DaneshId"]));

            if (listostad != null)
            {
                for (int i = 0; i <= listostad.Count - 1; i++)
                {
                    listostad[i].Name = listostad[i].Name.Replace("ي", "ی");
                }
            }
            RadComboBoxField.Items.Clear();
            RadComboBoxField.DataSource     = listostad;
            RadComboBoxField.DataTextField  = "name";
            RadComboBoxField.DataValueField = "ID";
            RadComboBoxField.DataBind();
            RadComboBoxField.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("جستجو و انتخاب کنید"));


            ///////////////////////////////////////////
        }