예제 #1
0
        //aktualizacj naglowka WZ
        public void fAktualizujWZGlowka(string sIDWz, string sNetto, string sVat, string sBrutto)
        {
            //string sReturn = "Error";
            string query = "update GM_WZ set " +
                                "WAL_WARTOSC_NETTO = " + sNetto.Replace(",", ".") + ", " +
                                "WAL_KWOTA_VAT = " + sVat.Replace(",", ".") + ", " +
                                "WAL_WARTOSC_BRUTTO = " + sBrutto.Replace(",", ".") + ", " +
                                "PLN_WARTOSC_NETTO = " + sNetto.Replace(",", ".") + ", " +
                                "WARTOSC_ROZRACHUNKU = " + sBrutto.Replace(",", ".") + ", " +
                                "PLN_KWOTA_VAT = " + sVat.Replace(",", ".") + ", " +
                                "PLN_WARTOSC_BRUTTO = " + sBrutto.Replace(",", ".") + "  " +
                                 "   where (ID = " + sIDWz + ") ";

            //Open connection
            if (this.OpenConnection() == true)
            {
                //create command and assign the query and connection from the constructor
                FbCommand cmd = new FbCommand(query, connection);

                //Execute command
                cmd.ExecuteNonQuery();

                //close connection
                this.CloseConnection();
            }
            fbLogowanie = new fblog();
            fbLogowanie.sLOG(settings.IDLogin, settings.osoba, "2", settings.login, settings.pass, query);
        }
예제 #2
0
        public void fAktualizujWZStawkiVat(string sIDWz, string sNetto, string sVat, string sBrutto)
        {
            //string sReturn = "Error";
            string query = "update GM_SPRZEDAZ_VAT set " +
                                "NETTO = " + sNetto.Replace(",",".") + ", " +
                                "VAT = " + sVat.Replace(",", ".") + ", " +
                                "BRUTTO = " + sBrutto.Replace(",", ".") + "  " +
                                 "   where (ID_WZ = " + sIDWz + ") ";

            //Open connection
            if (this.OpenConnection() == true)
            {
                //create command and assign the query and connection from the constructor
                FbCommand cmd = new FbCommand(query, connection);

                //Execute command
                cmd.ExecuteNonQuery();

                //close connection
                this.CloseConnection();
            }

            fbLogowanie = new fblog();
            fbLogowanie.sLOG(settings.IDLogin, settings.osoba, "2", settings.login, settings.pass, query);
        }
예제 #3
0
        public void fAktualizujWZPoz(string sIDPoz, string sNetto, string sBrutto)
        {
            //string sReturn = "Error";
            string query = "update GM_WZPOZ set " +
                                "CENA_SPRZEDAZY_PO = " + sNetto.Replace(",", ".") + ", " +
                                "CENA_NETTO_SPRZ_PO_RAB_PO = " + sNetto.Replace(",", ".") + ", " +
                                "CENA_SPRZ_WAL_PO_RAB_PO = " + sNetto.Replace(",", ".") + ", " +
                                "CENA_SP_NETTO_ALT_PO = " + sNetto.Replace(",", ".") + ", " +
                                "CENA_SP_PLN_ALT_PO = " + sNetto.Replace(",", ".") + ", " +
                                "CENA_KATALOGOWA = " + sNetto.Replace(",", ".") + ", " +
                                "CENA_BRUTTO_SPRZ_PO_RAB_PO = " + sBrutto.Replace(",", ".") + ",  " +
                                "CENA_SP_BRUTTO_ALT_PO = " + sBrutto.Replace(",", ".") + "  " +
                                 "   where (ID = " + sIDPoz + ") ";

            //Open connection
            if (this.OpenConnection() == true)
            {
                //create command and assign the query and connection from the constructor
                FbCommand cmd = new FbCommand(query, connection);

                //Execute command
                cmd.ExecuteNonQuery();

                //close connection
                this.CloseConnection();
            }
            fbLogowanie = new fblog();
            fbLogowanie.sLOG(settings.IDLogin, settings.osoba, "2", settings.login, settings.pass, query);
        }
예제 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            //InitializeConnStr();
            string sLogin = ""; string sPass = "";
            //if (textBox3.Text != "0")
            //{
            //    sLogin = "******";
            //    sPass = "******";
            //}
            //else
            //{
                sLogin = textBox1.Text;
                sPass = textBox2.Text;
            //}

            fbLogowanie = new fblog();
            List<string>[] lstLogin = fbLogowanie.sLogowanie(sLogin, sPass);

            if (lstLogin[0].Count == 0)
            {
                MessageBox.Show("Nie znaleziono użytkownika. \r\n Spróbuj ponownie.");
                fbLogowanie.sLOGErr(sLogin, sPass);
                textBox2.Text = "";
                return;
            }

            if (lstLogin[4][0].ToString() == "0")
            {
                MessageBox.Show("Użytkownik  " + sLogin + " ma wyłaczone konto\nSkontaktuj się z administratorem");
                fbLogowanie.sLOGErr(sLogin, sPass, true);
                textBox2.Text = "";
                return;
            }
            fbLogowanie.sLOG(lstLogin[0][0].ToString(),lstLogin[3][0].ToString(),"1",sLogin, sPass);

            settings.IDLogin = lstLogin[0][0].ToString();
            settings.osoba = lstLogin[3][0].ToString();
            settings.login = sLogin;
            settings.pass = sPass;
            settings.Save();

            //frmWZ = new zt();
            //frmWZ.Show();
            frmZnaczniki = new znaczniki();
            frmZnaczniki.Show();

            this.Visible = false;
            //this.Close();
        }