protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string   mId    = Request.QueryString["id"].ToString();
         string[] id     = mId.ToString().Split(new char[] { '@' });
         string   menuId = "";
         for (int i = 0; i < id[1].Length; i++)
         {
             string s = id[1].Substring(i + 1, 1);
             if (s != "-")
             {
                 menuId += s;
             }
             else
             {
                 break;
             }
             Session[sessionNames.menuID] = menuId;
         }
         AccessControl1.MenuId = Session[sessionNames.menuID].ToString();
         AccessControl1.UserId = Session[sessionNames.userID_Karbar].ToString();
         Business.Common.CommonBusiness CB = new Business.Common.CommonBusiness();
         rsht = CB.SelectAllField(0);
         setComboBind();
     }
 }
Exemple #2
0
        private void setResh()
        {
            Business.Common.CommonBusiness Resh = new Business.Common.CommonBusiness();
            var re = Resh.SelectAllField(Convert.ToInt32(drpdDanesh.SelectedItem.Value));

            drpdResh.DataSource     = re;
            drpdResh.DataValueField = "id";
            drpdResh.DataTextField  = "nameresh";
            drpdResh.DataBind();
            ListItem l = new ListItem("تمام رشته ها", "0");

            drpdResh.Items.Insert(0, l);
            //DropDownListItem l = new DropDownListItem("انتخاب کنید", "0");
            //drpdResh.Items.Insert(0,l);
            //drp.DataSource = re;
            //drp.DataValueField = "id";
            //drp.DataTextField = "nameresh";
            //drp.DataBind();
        }
        private void setFieldSource()
        {
            Business.Common.CommonBusiness cb = new Business.Common.CommonBusiness();
            DataTable fields = new DataTable();

            if (ddlDaneshkade.CheckedItems.Count > 0)
            {
                foreach (var a in ddlDaneshkade.CheckedItems)
                {
                    if (a.Checked)
                    {
                        fields.Merge(cb.SelectAllField(Convert.ToInt32(a.Value)));
                    }
                }
            }
            ddlField.DataSource     = fields;
            ddlField.DataValueField = "id";
            ddlField.DataTextField  = "nameresh";
            ddlField.DataBind();
            //if(ddlField.CheckedItems.Count==0)
            //    ddlField.ch
        }