protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Master.SelectedBox = "Ostalo";
         Master.Title       = "Ostalo";
         if (!Master.Uporabnik.Pravice.Contains("ostalo"))
         {
             throw new Exception("Nimate pravice!");
         }
         msg = Request.QueryString["msg"] ?? "";
         //_prihodkiodhodki_znesek = Convert.ToDouble(PrihodkiOdhodki.GetSkupaj(Master.Date).Rows[0]["znesek"]);
         //_osnovnasredstva_znesek = OsnovnaSredstva.GetSkupaj(Master.Date);
         _uporabniki_stetje = Uporabniki.Get().Rows.Count;
         _countrys_stetje   = Countrys.Get_d().Rows.Count;
         _posts_stetje      = Posts.Get_d().Rows.Count;
         _stranke_stetje    = Stranke.Get_d().Rows.Count;
         //_artikli_stetje = Artikli.Get("").Rows.Count;
         _subtypes_stetje = SubTypes.Get_d().Rows.Count;
         //_sporocila_stetje = Sporocila.Get().Rows.Count;
         //_posi_stetje = Posi.Get().Rows.Count;
         //poslovni_prostori_stetje = PoslovniProstori.Get().Rows.Count;
         if (!string.IsNullOrWhiteSpace(msg))
         {
             Master.SetMessage(msg);
         }
     }
     catch (Exception ee)
     {
         Master.SetMessage(ee);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Master.SelectedBox = "Ostalo";
         Master.Title       = "Države";
         if (!Master.Uporabnik.Pravice.Contains("drzave"))
         {
             throw new Exception("Nimate pravice!");
         }
         msg   = Request.QueryString["msg"] ?? "";
         _sort = Request.QueryString["sort"] ?? "";
         if (string.IsNullOrWhiteSpace(_sort))
         {
             _sort = Convert.ToString(Session["sort_countrys"]);
             if (string.IsNullOrWhiteSpace(_sort))
             {
                 _sort = "acTitle asc";
             }
         }
         else
         {
             Session["sort_countrys"] = _sort;
         }
         _persistence = Convert.ToString(Session["persistence_countrys"]) ?? "";
         DataTable dt = Countrys.Get_d();
         if (dt.Rows.Count > 0)
         {
             if (Request.QueryString["a"] == "csv")
             {
                 Response.Clear();
                 byte[] csv = Encoding.Default.GetBytes(Splosno.Csv(dt, "drzave"));
                 Response.ContentType = "application/csv; name=Stranke.csv";
                 Response.AddHeader("content-transfer-encoding", "binary");
                 Response.AddHeader("Content-Disposition", "attachment; filename=Drzave.csv");
                 Response.OutputStream.Write(csv, 0, csv.Length);
                 Response.Flush();
                 Response.End();
             }
             else
             {
                 r_countrys.DataSource = dt.Select("", _sort).CopyToDataTable();
                 r_countrys.DataBind();
             }
         }
         if (!string.IsNullOrWhiteSpace(msg))
         {
             Master.SetMessage(msg);
         }
     }
     catch (Exception ee)
     {
         Master.SetMessage(ee);
     }
 }