예제 #1
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (this.TextBox1.Text.Length > 0 && this.TextBox2.Text.Length > 0)
     {
         string rez = Baza.DodajPoslovalnico(Int32.Parse(this.DropDownList1.SelectedValue), this.TextBox1.Text, this.TextBox2.Text);
         if (rez == "")
         {
             Response.Redirect("index.aspx");
         }
         else
         {
             this.peter.InnerHtml = rez;
         }
     }
 }
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (this.TextBox1.Text.Length > 0)
     {
         string rez = Baza.VnesiZnamko(this.TextBox1.Text);
         if (rez == "")
         {
             Response.Redirect("index.aspx");
         }
         else
         {
             this.peter.InnerHtml = rez;
         }
     }
 }
예제 #3
0
        private void OnClick(object sender, EventArgs e)
        {
            Button button   = (Button)sender;
            string buttonId = button.ID;
            int    idn      = Int32.Parse(button.ID);
            string bri      = Baza.BrisiNarocilo(idn);

            if (bri == "")
            {
                Response.Redirect("index.aspx");
            }
            else
            {
                this.peter.InnerHtml = bri;
            }
        }
예제 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.peter.Style.Add("text-align", "center");
     if (Session["neki"] == null)
     {
         Session["neki"] = "Nakljucno blabla!";
     }
     if (Session["neki"] == "Nakljucno blabla!")
     {
         this.peter.InnerHtml = "Spremenjeno besedilo!";
         Session["neki"]      = "Spremenjeno besedilo!";
     }
     else
     {
         Session["neki"]      = "Nakljucno blabla!";
         this.peter.InnerHtml = "Nakljucno blabla";
     }
     this.peter.InnerHtml = Baza.NekaFunkcija();
 }
예제 #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.TextBox1.Text.Length != 0 && this.TextBox2.Text.Length != 0 && this.TextBox3.Text.Length != 0 && this.TextBox4.Text.Length != 0 && this.TextBox5.Text.Length != 0 && this.TextBox6.Text.Length != 0 && this.TextBox7.Text.Length != 0)
            {
                if (this.TextBox6.Text.Contains("@") && this.TextBox7.Text.All(Char.IsDigit))
                {
                    if (this.TextBox2.Text.Equals(this.TextBox3.Text))
                    {
                        int stanje = Baza.registriraj(this.TextBox1.Text, this.TextBox2.Text, this.TextBox4.Text, this.TextBox5.Text, this.TextBox6.Text, this.TextBox7.Text);
                        if (stanje == 0)
                        {
                            Response.Redirect("index.aspx");
                        }
                        else if (stanje == 2)
                        {
                            this.peter.InnerHtml = "To uporabniško ime že obstaja";
                        }
                        else
                        {
                            this.peter.InnerHtml = "Napaka s podatkovno bazo poskusite kasneje";
                        }
                    }
                    else
                    {
                        this.peter.InnerHtml = "Gesli se ne ujemata!";
                    }
                }
                else
                {
                    this.peter.InnerHtml = "Telefon in/ali email nista pravilnega formata";
                }
            }
            else
            {
                this.peter.InnerHtml = "Vsi podatki niso izpolnjeni!";
            }

            /*
             * this.peter.InnerHtml = this.TextBox5.Text;
             * Response.Redirect("index.aspx");
             */
        }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["uporabnik"] == null || Session["stanje"] == null)
     {
         Response.Redirect("index.aspx");
     }
     else if ((int)Session["stanje"] != 3)
     {
         Response.Redirect("index.aspx");
     }
     if (!IsPostBack)
     {
         Dictionary <string, int> dictionary = new Dictionary <string, int>();
         dictionary = Baza.DobiPoslovalnice();
         foreach (KeyValuePair <string, int> entry in dictionary)
         {
             this.DropDownList1.Items.Insert(0, new ListItem(entry.Key, entry.Value.ToString()));
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["uporabnik"] == null || Session["stanje"] == null)
            {
                Response.Redirect("index.aspx");
            }
            else if ((int)Session["stanje"] != 2)
            {
                Response.Redirect("index.aspx");
            }

            int idz = Baza.DobiZaposlenega((int)Session["uporabnik"]);
            int idp = Baza.DobiPoslovalnico((int)Session["uporabnik"]);
            Dictionary <string, int> dictionary = new Dictionary <string, int>();

            dictionary = Baza.DobiNarocilaOdobrena(idp);
            foreach (KeyValuePair <string, int> entry in dictionary)
            {
                //this.DropDownList2.Items.Insert(0, new ListItem(entry.Key, entry.Value.ToString()));
                TableRow tRow = new TableRow();
                this.Table1.Rows.Add(tRow);
                TableCell tCell1 = new TableCell();
                TableCell tCell2 = new TableCell();
                TableCell tCell3 = new TableCell();
                tCell1.Text = entry.Key;
                Button bt = new Button();
                bt.Text   = "Opravi";
                bt.ID     = entry.Value.ToString();
                bt.Click += OnClick;
                Button bt1 = new Button();
                bt1.Text   = "Briši";
                bt1.ID     = "0" + entry.Value.ToString();
                bt1.Click += OnClick;
                tRow.Cells.Add(tCell1);
                tCell2.Controls.Add(bt);
                tRow.Cells.Add(tCell2);
                tCell3.Controls.Add(bt1);
                tRow.Cells.Add(tCell3);
            }
        }
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (this.TextBox1.Text.Length > 0)
     {
         int    idv  = Int32.Parse(this.DropDownList1.SelectedValue);
         int    idp  = Int32.Parse(this.DropDownList2.SelectedValue);
         int    dan  = Int32.Parse(this.DropDownList3.SelectedValue);
         int    mes  = Int32.Parse(this.DropDownList8.SelectedValue);
         int    leto = Int32.Parse(this.DropDownList5.SelectedValue);
         int    ura  = Int32.Parse(this.DropDownList6.SelectedValue);
         int    min  = Int32.Parse(this.DropDownList7.SelectedValue);
         string opis = this.TextBox1.Text;
         string rez  = Baza.VnesiNarocilo(idv, idp, ura, min, dan, mes, leto, opis);
         if (rez == "")
         {
             Response.Redirect("index.aspx");
         }
         else
         {
             this.peter.InnerHtml = rez;
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["uporabnik"] == null || Session["stanje"] == null)
            {
                Response.Redirect("index.aspx");
            }
            else if ((int)Session["stanje"] != 1)
            {
                Response.Redirect("index.aspx");
            }
            int ids = Baza.DobiStranko((int)Session["uporabnik"]);
            Dictionary <string, int> dictionary = new Dictionary <string, int>();

            dictionary = Baza.DobiOpravljenaNarocila(ids);
            foreach (KeyValuePair <string, int> entry in dictionary)
            {
                //this.DropDownList2.Items.Insert(0, new ListItem(entry.Key, entry.Value.ToString()));
                TableRow tRow = new TableRow();
                this.Table1.Rows.Add(tRow);
                TableCell tCell1 = new TableCell();
                tCell1.Text = entry.Key;
                tRow.Cells.Add(tCell1);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["stanje"] == null)
            {
                Response.Redirect("index.aspx");
            }
            else if ((int)Session["stanje"] != 1)
            {
                Response.Redirect("index.aspx");
            }
            if (!IsPostBack)
            {
                Dictionary <string, int> dictionary = new Dictionary <string, int>();
                dictionary = Baza.DobiPoslovalnice();
                foreach (KeyValuePair <string, int> entry in dictionary)
                {
                    this.DropDownList2.Items.Insert(0, new ListItem(entry.Key, entry.Value.ToString()));
                }
                dictionary = new Dictionary <string, int>();
                int stranka = Baza.DobiStranko((int)Session["uporabnik"]);
                dictionary = Baza.DobiVozila(stranka);
                foreach (KeyValuePair <string, int> entry in dictionary)
                {
                    this.DropDownList1.Items.Insert(0, new ListItem(entry.Key, entry.Value.ToString()));
                }
                for (int i = 2100; i > 2017; i--)
                {
                    this.DropDownList5.Items.Insert(0, new ListItem(i.ToString(), i.ToString()));
                }
                this.DropDownList8.Items.Insert(0, new ListItem("December", "12"));
                this.DropDownList8.Items.Insert(0, new ListItem("November", "11"));
                this.DropDownList8.Items.Insert(0, new ListItem("Oktober", "10"));
                this.DropDownList8.Items.Insert(0, new ListItem("Setember", "9"));
                this.DropDownList8.Items.Insert(0, new ListItem("August", "8"));
                this.DropDownList8.Items.Insert(0, new ListItem("Julij", "7"));
                this.DropDownList8.Items.Insert(0, new ListItem("Junij", "6"));
                this.DropDownList8.Items.Insert(0, new ListItem("Maj", "5"));
                this.DropDownList8.Items.Insert(0, new ListItem("April", "4"));
                this.DropDownList8.Items.Insert(0, new ListItem("Marec", "3"));
                this.DropDownList8.Items.Insert(0, new ListItem("Februar", "2"));
                this.DropDownList8.Items.Insert(0, new ListItem("Januar", "1"));

                for (int i = 23; i >= 0; i--)
                {
                    this.DropDownList6.Items.Insert(0, new ListItem(i.ToString(), i.ToString()));
                }
                for (int i = 59; i >= 0; i--)
                {
                    this.DropDownList7.Items.Insert(0, new ListItem(i.ToString(), i.ToString()));
                }
            }
            int j;

            if (this.DropDownList8.SelectedValue.Equals("1") || this.DropDownList8.SelectedValue.Equals("3") || this.DropDownList8.SelectedValue.Equals("5") || this.DropDownList8.SelectedValue.Equals("7") || this.DropDownList8.SelectedValue.Equals("8") || this.DropDownList8.SelectedValue.Equals("10") || this.DropDownList8.SelectedValue.Equals("12"))
            {
                j = 31;
            }
            else if (this.DropDownList8.SelectedValue.Equals("2"))
            {
                j = 28;
            }
            else
            {
                j = 30;
            }
            this.DropDownList3.Items.Clear();
            for (int i = 1; i < j + 1; i++)
            {
                this.DropDownList3.Items.Insert(0, new ListItem(i.ToString(), i.ToString()));
            }
        }