protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Butonvisible(true);
         panelVisible(false, true, false, false);
         RefList.DataSource = (from l in db.Language select l).ToList();
         RefList.DataBind();
     }
     ((Master)this.Master).Path     = "Diller";
     ((Master)this.Master).PathLink = "LanguagePage.aspx";
 }
        protected void filter()
        {
            string languageValue = ddlFilterLanguage.SelectedValue;
            string refValue      = ddlFilterReferanceType.SelectedValue;

            if (languageValue != "0" && refValue != "0")
            {
                Language language = (from l in db.Language
                                     where l.LanguageName == languageValue
                                     select l).FirstOrDefault();

                RefList.DataSource = (from r in db.Referance
                                      where r.LanguageID == language.ID &&
                                      r.ReferanceType == refValue
                                      select r).ToList();
                RefList.DataBind();
            }
            else if (languageValue != "0" && refValue == "0")
            {
                Language language = (from l in db.Language
                                     where l.LanguageName == languageValue
                                     select l).FirstOrDefault();

                RefList.DataSource = (from r in db.Referance
                                      where r.LanguageID == language.ID
                                      select r).ToList();
                RefList.DataBind();
            }
            else if (languageValue == "0" && refValue != "0")
            {
                RefList.DataSource = (from r in db.Referance
                                      where r.ReferanceType == refValue
                                      select r).ToList();
                RefList.DataBind();
            }
            else
            {
                RefList.DataSource = (from r in db.Referance
                                      select r).ToList();
                RefList.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    Butonvisible(true);
                    panelVisible(false, true, false, false);

                    List <string> languageList = (from l in db.Language
                                                  where l.IsActive == true
                                                  select l.LanguageName).ToList();
                    ddlLanguage.DataSource = languageList;
                    ddlLanguage.DataBind();

                    ddlFilterLanguage.DataSource = languageList;
                    ddlFilterLanguage.DataBind();
                    ddlFilterLanguage.Items.Insert(0, new ListItem("Dil Seçiniz..", "0"));
                    ddlFilterLanguage.SelectedIndex = 0;

                    ddlFilterReferanceType.DataSource = (from r in db.Referance
                                                         group r.ReferanceType by r.ReferanceType into g
                                                         select g.Key).ToList();;
                    ddlFilterReferanceType.DataBind();
                    ddlFilterReferanceType.Items.Insert(0, new ListItem("Referans tipi Seçiniz..", "0"));
                    ddlFilterReferanceType.SelectedIndex = 0;
                }
                RefList.DataSource = (from r in db.Referance select r).ToList();
                RefList.DataBind();
                ((Master)this.Master).Path     = "Referanslar";
                ((Master)this.Master).PathLink = "ReferancePage.aspx";
            }
            catch (Exception)
            {
                Uyari("Bir Hata Oluştu!", false);
                pnlAlert.Visible = true;
            }
        }