Beispiel #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);
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox2.Text == "")
            {
                MessageBox.Show("Brak nazwy (loginu) lub hasła. Nie można zapisać takiego użytkownika");
                return;
            }

            string sAktywny = "0";
            fbLogowanie = new fblog();
            if (checkBox1.Checked == true) sAktywny = "1";
            if (textBox4.Text != "")
                fbLogowanie.fAktualizujUser(textBox1.Text, textBox2.Text, textBox3.Text, sAktywny);
            else
            {
                if (fbLogowanie.fCzyJestLogin(textBox1.Text) == "0")
                    fbLogowanie.fDodajUserRAKS(textBox1.Text, textBox3.Text, textBox2.Text, sAktywny);
                else
                    MessageBox.Show("Już jest użytkownik o identyfikatorze(Login): " + textBox1.Text + "", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            fUserList();
            textBox1.Text = "";
            textBox2.Text = "";
            textBox3.Text = "";
            textBox4.Text = "";
            checkBox1.Checked = false;
            textBox1.Enabled = true;
        }
Beispiel #3
0
        public void fSpisMagazynow()
        {
            fbLogowanie = new fblog();
            List<string>[] lstDokumenty = fbLogowanie.fUPRMAg(settings.IDLogin);

            dataGridView3.Rows.Clear();
            dataGridView4.Rows.Clear();

            for (int i = 0; i < lstDokumenty[0].Count; i++)
            {
                int number = dataGridView4.Rows.Add();
                dataGridView4.Rows[number].Cells[0].Value = lstDokumenty[0][i].ToString();
                dataGridView4.Rows[number].Cells[1].Value = lstDokumenty[1][i].ToString();
                dataGridView4.Rows[number].Cells[2].Value = lstDokumenty[2][i].ToString();
            }
        }
Beispiel #4
0
        private void fUserList()
        {
            fbLogowanie = new fblog();
            List<string>[] lstUsers = fbLogowanie.fUsers();

            dataGridView2.Rows.Clear();

            for (int i = 0; i < lstUsers[0].Count; i++)
            {
                int number = dataGridView2.Rows.Add();
                dataGridView2.Rows[number].Cells[0].Value = lstUsers[0][i].ToString();
                dataGridView2.Rows[number].Cells[1].Value = lstUsers[1][i].ToString();
                dataGridView2.Rows[number].Cells[2].Value = lstUsers[2][i].ToString();
                dataGridView2.Rows[number].Cells[3].Value = lstUsers[3][i].ToString();
                dataGridView2.Rows[number].Cells[4].Value = lstUsers[4][i].ToString();
                if (lstUsers[2][i].ToString() == "") dataGridView2.Rows[number].DefaultCellStyle.BackColor = Color.Tomato;
            }
        }
Beispiel #5
0
 private void checkBox1_Click(object sender, EventArgs e)
 {
     //MessageBox.Show(checkBox1.Checked.ToString(), "");
     string sBlokadaPZ = "0";
     if (checkBox1.Checked) sBlokadaPZ = "1";
     fbLogowanie = new fblog();
     fbLogowanie.fAktualizujBlokadaPZ(sBlokadaPZ);
 }
Beispiel #6
0
        private void dataGridView4_Click(object sender, EventArgs e)
        {
            try
            {
                textBox8.Text = dataGridView4.CurrentRow.Cells[0].Value.ToString();
                textBox6.Text = dataGridView4.CurrentRow.Cells[1].Value.ToString();
                textBox3.Text = "";
                try
                {
                    string sIdMag = dataGridView4.CurrentRow.Cells[0].Value.ToString();
                    fbLogowanie = new fblog();
                    List<string>[] lstDokumenty = fbLogowanie.fUPRKodDlaMAg(settings.IDLogin, sIdMag);

                    dataGridView3.Rows.Clear();

                    for (int i = 0; i < lstDokumenty[0].Count; i++)
                    {
                        int number = dataGridView3.Rows.Add();
                        dataGridView3.Rows[number].Cells[0].Value = lstDokumenty[0][i].ToString();
                        dataGridView3.Rows[number].Cells[1].Value = lstDokumenty[1][i].ToString();
                        dataGridView3.Rows[number].Cells[2].Value = lstDokumenty[2][i].ToString();
                    }
                }
                catch (NullReferenceException) { }

            }
            catch (NullReferenceException) { }
        }
Beispiel #7
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);
        }
Beispiel #8
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);
        }
Beispiel #9
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();
        }
Beispiel #10
0
        private void dataGridView3_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                if (textBox4.Text == "")
                {
                    MessageBox.Show("Wybierz użytkownika, któremu chcesz dodać obsługę magazynu", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                //DialogResult dlr;
                string sID = dataGridView3.CurrentRow.Cells[0].Value.ToString();
                string sNumer = dataGridView3.CurrentRow.Cells[1].Value.ToString();
                string sNazwa = dataGridView3.CurrentRow.Cells[2].Value.ToString();
                string sMaska = dataGridView3.CurrentRow.Cells[3].Value.ToString();
                string sDok = dataGridView3.CurrentRow.Cells[4].Value.ToString();

                fbLogowanie = new fblog();
                if (fbLogowanie.fCzyJestMagazyn(sID) == "0")
                {
                    //dodawanie do spisu
                    fbLogowanie.fDodajMagazyn(sID, sNumer, sNazwa, sMaska, sDok);
                }
                else
                {
                    //edycja
                    /*zmiana w programie. poniewaz nie używam tabeli pośredniej dla magazynów aktualizację trzeba zrobićbez pytania */
                    //dlr = MessageBox.Show("Już dodano magazyn o ID: " + sID + "\nCzy aktualizowac istniejący wpis?","",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
                    //if (dlr == DialogResult.Yes)
                    //{
                    //aktualizacja wpisu
                    fbLogowanie.fAktualizujMagazyn(sID, sNumer, sNazwa, sMaska, sDok);
                    //}
                }

                /*Zmiana w programie.  poniewaz nie używam tabeli pośredniej dla magazynów to po dodaniu magazynu od razu musze dodać uprawnienia do wybranego magazynu*/
                string sIdUser = ""; //, sIdMag = "";
                if (textBox4.Text != "")
                {
                    sIdUser = textBox4.Text;
                    //sIdMag = dataGridView5.CurrentRow.Cells[0].Value.ToString();
                    fbLogowanie = new fblog();
                    if (fbLogowanie.fCzyJestUPR(sIdUser, sID) == "0")
                        fbLogowanie.fDodajUPRMag(sIdUser, sID);

                }
                fMagazynyListUPR(textBox4.Text);

                //fMagazynyList();
            }
            catch (NullReferenceException) { }
        }
Beispiel #11
0
 private void fBlokadaPZLoad()
 {
     fbLogowanie = new fblog();
     fbLogowanie._TableSERIA();
     string sBlokadaPZ = fbLogowanie.fBlokadaPZ();
     fBlokPZ = sBlokadaPZ;
     if (sBlokadaPZ == "1")
         checkBox1.Checked = true;
     else
         checkBox1.Checked = false;
 }
Beispiel #12
0
        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                DialogResult dlr;
                //string sID = dataGridView1.CurrentRow.Cells[0].Value.ToString();
                string sLogin = dataGridView1.CurrentRow.Cells[0].Value.ToString();
                //string sPass = dataGridView1.CurrentRow.Cells[2].Value.ToString();
                string sNazwisko = dataGridView1.CurrentRow.Cells[1].Value.ToString();
                //string sAktywny = dataGridView2.CurrentRow.Cells[4].Value.ToString();

                fbLogowanie = new fblog();
                if (fbLogowanie.fCzyJestLogin(sLogin) == "0")
                {
                    //dodawanie do spisu
                    fbLogowanie.fDodajUserRAKS(sLogin, sNazwisko);
                }
                else
                {
                    //edycja
                    dlr = MessageBox.Show("Już jest użytkownik o identyfikatorze(Login): " + sLogin + "", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    if (dlr == DialogResult.Yes)
                    {
                        //aktualizacja wpisu
                        //fbLogowanie.fAktualizujMagazyn(sID, sNumer, sNazwa, sMaska, sDok);
                    }
                }
                fUserList();
            }
            catch (NullReferenceException) { }
        }
Beispiel #13
0
 //druga zakłaka
 private void fRodzajDOK()
 {
     fbLogowanie = new fblog();
     textBox5.Text = fbLogowanie.fIDRodzajuDOK();
 }
Beispiel #14
0
        private void fMagazynyListUPR(string sIDUser)
        {
            fbLogowanie = new fblog();
            List<string>[] lstMagazyny = fbLogowanie.fUPRMAg(sIDUser);

            dataGridView4.Rows.Clear();

            for (int i = 0; i < lstMagazyny[0].Count; i++)
            {
                int number = dataGridView4.Rows.Add();
                dataGridView4.Rows[number].Cells[0].Value = lstMagazyny[0][i].ToString();
                dataGridView4.Rows[number].Cells[1].Value = lstMagazyny[1][i].ToString();
                dataGridView4.Rows[number].Cells[2].Value = lstMagazyny[2][i].ToString();

            }
        }
Beispiel #15
0
        private void dataGridView6_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                string sID = dataGridView6.CurrentRow.Cells[0].Value.ToString();
                string sKod = dataGridView6.CurrentRow.Cells[1].Value.ToString();
                string sNazwa = dataGridView6.CurrentRow.Cells[2].Value.ToString();
                string sMaska = dataGridView6.CurrentRow.Cells[3].Value.ToString();

                fbLogowanie = new fblog();
                //dodawanie kodu do spisu kodów w programie
                if (fbLogowanie.fCzyJestKOD(sID) == "0")
                    fbLogowanie.fDodajKOD(sID, sKod, sNazwa, sMaska);

                if (textBox6.Text != "")
                {
                    //dodawania uprawnienia user->magazyn->koddokumentu
                    if (fbLogowanie.fCzyJestUPRKodMag(textBox4.Text, textBox6.Text, sID) == "0")
                        fbLogowanie.fDodajUPRKodMag(textBox4.Text, textBox6.Text, sID);

                    //odświeżanie listy kodów dla magazynu
                    List<string>[] lstDokumenty = fbLogowanie.fUPRKodDlaMAg(textBox4.Text, textBox6.Text);

                    dataGridView5.Rows.Clear();

                    for (int i = 0; i < lstDokumenty[0].Count; i++)
                    {
                        int number = dataGridView5.Rows.Add();
                        dataGridView5.Rows[number].Cells[0].Value = lstDokumenty[0][i].ToString();
                        dataGridView5.Rows[number].Cells[1].Value = lstDokumenty[1][i].ToString();
                        dataGridView5.Rows[number].Cells[2].Value = lstDokumenty[2][i].ToString();
                    }
                }
                else
                    MessageBox.Show("Wybierz magazyn do którego chcesz przyłaczyć kod dokumentu");
            }
            catch (NullReferenceException) { }
        }
Beispiel #16
0
        private void dataGridView5_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                fbLogowanie = new fblog();
                fbLogowanie.fUsunUPRKodMag(textBox4.Text, textBox6.Text, dataGridView5.CurrentRow.Cells[0].Value.ToString());

                try
                {
                    textBox6.Text = dataGridView4.CurrentRow.Cells[0].Value.ToString();
                    fbLogowanie = new fblog();
                    List<string>[] lstDokumenty = fbLogowanie.fUPRKodDlaMAg(textBox4.Text, textBox6.Text);

                    dataGridView5.Rows.Clear();

                    for (int i = 0; i < lstDokumenty[0].Count; i++)
                    {
                        int number = dataGridView5.Rows.Add();
                        dataGridView5.Rows[number].Cells[0].Value = lstDokumenty[0][i].ToString();
                        dataGridView5.Rows[number].Cells[1].Value = lstDokumenty[1][i].ToString();
                        dataGridView5.Rows[number].Cells[2].Value = lstDokumenty[2][i].ToString();
                    }
                }
                catch (NullReferenceException) { }

            }
            catch (NullReferenceException) { }
        }
Beispiel #17
0
        private void dataGridView4_DoubleClick(object sender, EventArgs e)
        {
            string sIdUser = "", sIdMag = "";
            if (textBox4.Text != "")
            {
                sIdUser = textBox4.Text;
                sIdMag = dataGridView4.CurrentRow.Cells[0].Value.ToString();
                fbLogowanie = new fblog();
                fbLogowanie.fUsunUPRMag(sIdUser, sIdMag);

            }
            fMagazynyListUPR(textBox4.Text);
        }
Beispiel #18
0
        private void fSpisDokProgram()
        {
            fbLogowanie = new fblog();
            List<string>[] lstDokumenty = fbLogowanie.fKody();

            dataGridView3.Rows.Clear();

            for (int i = 0; i < lstDokumenty[0].Count; i++)
            {
                int number = dataGridView3.Rows.Add();
                dataGridView3.Rows[number].Cells[0].Value = lstDokumenty[1][i].ToString();
                dataGridView3.Rows[number].Cells[1].Value = lstDokumenty[2][i].ToString();
            }
        }
Beispiel #19
0
 private void button4_Click(object sender, EventArgs e)
 {
     fbLogowanie = new fblog();
     fbLogowanie.fAktualizujRodzajDOK(textBox5.Text);
 }