Ejemplo n.º 1
0
        protected void GridViewInvoices_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!BaseConnection.openConnection())
            {
                return;
            }

            string query = "select main.Name, reciever.Name, Issue_date, Due_date, Payment_Method.Name from Invoices " +
                           "inner join Contractors as main on main.Id = Id_contractor left join Contractors as reciever on reciever.Id = Id_receiver " +
                           "inner join Payment_Method on Id_payment = Payment_Method.Id where Invoices.Id =" + GridViewInvoices.DataKeys[GridViewInvoices.SelectedIndex].Value.ToString();
            SqlDataReader reader = BaseConnection.execReader(query);

            while (reader.Read())
            {
                LabelContractor.Text = reader.GetString(0);
                if (!reader.IsDBNull(1))
                {
                    LabelReciever.Text = reader.GetString(1);
                }
                LabelIssueDate.Text = reader.GetDateTime(2).ToShortDateString();
                LabelDueDate.Text   = reader.GetDateTime(3).ToShortDateString();
                LabelPayment.Text   = reader.GetString(4);
            }

            BaseConnection.closeConnection();

            LabelTitle.Text = (GridViewInvoices.Rows[GridViewInvoices.SelectedIndex].Cells[2].Controls[1] as Label).Text;

            SqlDataSourceProducts.SelectCommand = "select Products.Name,Units.Name, Tax_rates.Name,Tax_rates.Value, Amount, Price from Invoice_Products " +
                                                  "inner join Tax_rates on Id_tax = Tax_rates.Id inner join Products on Id_product = Products.Id " +
                                                  "inner join Units on Products.Id_unit = Units.Id where Id_invoice=" + GridViewInvoices.DataKeys[GridViewInvoices.SelectedIndex].Value.ToString();
            ClientScript.RegisterStartupScript(this.GetType(), "Popup", "showInfo();", true);
        }
        public void ButtonSave_Click(object sender, EventArgs e)
        {
            if (!BaseConnection.openConnection())
            {
                return;
            }

            string command = "select * from (select Name from Contractors inner join Users on Contractors.Id_User = Users.id where Users.id ="
                             + Session["User"] + ") as tabelka where tabelka.Name = '" + TextBoxName.Text + "'; ";

            // check if already added
            if (BaseConnection.execScalar(command) != null)
            {
                BaseConnection.closeConnection();
                string title = "Błąd";
                string body  = "Kontrahent o takiej nazwie już isnieje!";
                ClientScript.RegisterStartupScript(this.GetType(), "Popup", "showModalError('" + title + "', '" + body + "');", true);
                return;
            }

            Dictionary <string, string> pair = new Dictionary <string, string>();

            pair.Add("@userId", Session["User"].ToString());
            pair.Add("@name", TextBoxName.Text);
            pair.Add("@postTown", TextBoxPostTown.Text);
            pair.Add("@postCode", TextBoxPostCode.Text);
            pair.Add("@city", TextBoxCity.Text);
            pair.Add("@street", TextBoxStreet.Text);
            if (!String.IsNullOrEmpty(TextBoxNIP.Text))
            {
                pair.Add("@nip", TextBoxNIP.Text);
            }
            else
            {
                pair.Add("@nip", "null");
            }
            pair.Add("@regon", "null");
            if (!String.IsNullOrEmpty(TextBoxPESEL.Text))
            {
                pair.Add("@pesel", TextBoxPESEL.Text);
            }
            else
            {
                pair.Add("@pesel", "null");
            }

            BaseConnection.execProcedure("AddContractor", pair);

            BaseConnection.closeConnection();

            Response.Redirect("Contractors.aspx");
        }
Ejemplo n.º 3
0
        private void deleteContractor(int index)
        {
            if (!BaseConnection.openConnection())
            {
                return;
            }
            string query =
                "delete from Contractors where id=" + GridViewContractors.DataKeys[index].Value.ToString();

            BaseConnection.execCommand(query);
            BaseConnection.closeConnection();
            Response.Redirect(Request.RawUrl);
        }
Ejemplo n.º 4
0
        protected void GridViewContractors_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!BaseConnection.openConnection())
            {
                return;
            }
            var query =
                "select Name,Post_town,Post_code, City, Street, NIP, REGON, PESEL from Contractors where Id = " + GridViewContractors.DataKeys[GridViewContractors.SelectedIndex].Value;
            var reader = BaseConnection.execReader(query);

            while (reader.Read())
            {
                LabelName.Text     = LabelTitle.Text = reader.GetString(0);
                LabelPostTown.Text = reader.GetString(1);
                LabelPostCode.Text = reader.GetString(2);
                LabelCity.Text     = reader.GetString(3);
                LabelStreet.Text   = reader.GetString(4);
                if (!reader.IsDBNull(5))
                {
                    LabelNIP.Text = reader.GetString(5);
                }
                if (!reader.IsDBNull(6))
                {
                    LabelREGON.Text = reader.GetString(6);
                }
            }
            BaseConnection.closeConnection();

            if (!string.IsNullOrEmpty(LabelNIP.Text))
            {
                var gus = GusApiHelper.DataSearchSubjects(LabelNIP.Text);
                var mf  = MfApiHelper.SearchNip(LabelNIP.Text);
                if (gus == null || mf == null)
                {
                    ButtonDetails.Enabled = false;
                }
                else
                {
                    ButtonDetails.Enabled = true;
                }
            }
            else
            {
                ButtonDetails.Enabled = false;
            }



            ClientScript.RegisterStartupScript(GetType(), "Popup", "showInfo();", true);
        }
Ejemplo n.º 5
0
        protected void ButtonSave_Click(object sender, EventArgs e)
        {
            if (!BaseConnection.openConnection())
            {
                return;
            }

            string id = Request.QueryString["id"];

            Dictionary <string, string> pair = new Dictionary <string, string>();

            pair.Add("@userId", id);
            pair.Add("@name", TextBoxName.Text);
            pair.Add("@postTown", TextBoxPostTown.Text);
            pair.Add("@postCode", TextBoxPostCode.Text);
            pair.Add("@city", TextBoxCity.Text);
            pair.Add("@street", TextBoxStreet.Text);
            if (!string.IsNullOrEmpty(TextBoxNIP.Text))
            {
                pair.Add("@nip", TextBoxNIP.Text);
            }
            else
            {
                pair.Add("@nip", "null");
            }
            if (!string.IsNullOrEmpty(TextBoxREGON.Text))
            {
                pair.Add("@regon", TextBoxREGON.Text);
            }
            else
            {
                pair.Add("@regon", "null");
            }
            if (!string.IsNullOrEmpty(TextBoxPESEL.Text))
            {
                pair.Add("@pesel", TextBoxPESEL.Text);
            }
            else
            {
                pair.Add("@pesel", "null");
            }

            BaseConnection.execProcedure("EditContractor", pair);

            BaseConnection.closeConnection();

            Response.Redirect("Contractors.aspx");
        }
Ejemplo n.º 6
0
        protected void ButtonLogIn_Click(object sender, EventArgs e)
        {
            if (!BaseConnection.openConnection())
            {
                string title = "Błąd";
                string body  = "Błąd serwera. Proszę wrócić później.";
                ClientScript.RegisterStartupScript(
                    GetType(),
                    "Popup",
                    "showModalError('" + title + "', '" + body + "');",
                    true
                    );
                return;
            }
            var para = new Dictionary <string, string>
            {
                {
                    "@e_mail",
                    TextBoxAddres.Text
                },
                {
                    "@password",
                    TextBoxPassword.Text
                }
            };
            var result = new SqlParameter("@result", SqlDbType.NVarChar, 50);

            BaseConnection.execProcedure("LogInUser", para, result);
            BaseConnection.closeConnection();
            Debug.WriteLine((string)result.Value);
            if ((string)result.Value == "null")
            {
                System.Diagnostics.Debug.WriteLine("brak w bazie");
                string title = "Błąd logowania";
                string body  = "Podano błędny adres e-mail lub hasło.";
                ClientScript.RegisterStartupScript(
                    GetType(),
                    "Popup",
                    "showModalError('" + title + "', '" + body + "');",
                    true
                    );
                return;
            }
            Session["User"] = (string)result.Value;
            BaseConnection.closeConnection();
            Response.Redirect("/Default.aspx");
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];

            if (string.IsNullOrEmpty(id))
            {
                Response.Redirect("Default.aspx");
            }

            if (IsPostBack)
            {
                return;
            }

            if (!BaseConnection.openConnection())
            {
                return;
            }

            string        query  = "select Name,Post_town,Post_code, City, Street, NIP, REGON, PESEL from Contractors where Id = " + id;
            SqlDataReader reader = BaseConnection.execReader(query);



            while (reader.Read())
            {
                TextBoxName.Text     = reader.GetString(0);
                TextBoxPostTown.Text = reader.GetString(1);
                TextBoxPostCode.Text = reader.GetString(2);
                TextBoxCity.Text     = reader.GetString(3);
                TextBoxStreet.Text   = reader.GetString(4);
                if (!reader.IsDBNull(5))
                {
                    TextBoxNIP.Text = reader.GetString(5);
                }
                if (!reader.IsDBNull(6))
                {
                    TextBoxREGON.Text = reader.GetString(6);
                }
            }

            BaseConnection.closeConnection();
        }
Ejemplo n.º 8
0
        public GenerateInvoice(int idUser, int invoiceId, string nr)
        {
            _stringWriter = new StringWriter();
            _writer       = new HtmlTextWriter(_stringWriter);


            _idInvoice = invoiceId;
            _nr        = nr;
            _idUser    = idUser;
            if (!BaseConnection.openConnection())
            {
                return;
            }

            string query = "select Id_contractor from Invoices where Id =" + invoiceId;

            _idContractor = (int)BaseConnection.execScalar(query);

            BaseConnection.closeConnection();
        }
Ejemplo n.º 9
0
        private void deleteInvoice(int index)
        {
            string idInvoice = GridViewInvoices.DataKeys[index].Value.ToString();

            if (!BaseConnection.openConnection())
            {
                return;
            }

            string q1    = "delete from Invoice_Products where Id_invoice=" + idInvoice;
            string q2    = "delete from Invoices where id=" + idInvoice;
            string query = q1 + "; " + q2;

            BaseConnection.execCommand(query);


            BaseConnection.closeConnection();

            Response.Redirect(Request.RawUrl);
        }
Ejemplo n.º 10
0
        protected void ButtonAddProduct_Click(object sender, EventArgs e)
        {
            if (!BaseConnection.openConnection())
            {
                return;
            }

            string command = "select * from Products where Name='" + TextBoxName.Text + "' and Id_user="******"User"];

            if (BaseConnection.execScalar(command) != null)
            {
                BaseConnection.closeConnection();
                string title = "Błąd";
                string body  = "Taki produkt już istnieje!";
                ClientScript.RegisterStartupScript(this.GetType(), "Popup", "showModalError('" + title + "', '" + body + "');", true);

                return;
            }

            command = "insert into Products values (" + Session["User"] + ",'" + TextBoxName.Text + "'," + DropDownListUnit.SelectedValue + " )";

            if ((int)BaseConnection.execCommand(command) == 1)
            {
                LabelError.Text     = "Produkt dodany";
                LabelError.CssClass = "text-success";
                LabelError.Visible  = true;
            }
            else
            {
                LabelError.Text     = "Nie udało się dodać do bazy";
                LabelError.CssClass = "text-danger";
                LabelError.Visible  = true;
            }


            BaseConnection.closeConnection();

            Response.Redirect("Product.aspx");
        }
Ejemplo n.º 11
0
        private void loadCompanyDetail()
        {
            if (!BaseConnection.openConnection())
            {
                return;
            }

            List <string> list = new List <string>();

            string        query  = "SELECT [Name], [Post_town], [Post_code], [City], [Street], [NIP], [REGON], [Bank], [Bank_account] FROM [User_Detail] WHERE ([Id_user] =" + Session["User"] + ")";
            SqlDataReader reader = BaseConnection.execReader(query);

            while (reader.Read())
            {
                LabelName.Text     = reader.GetString(0);
                LabelPostTown.Text = reader.GetString(1);
                LabelPostCode.Text = reader.GetString(2);
                LabelCity.Text     = reader.GetString(3);
                LabelStreet.Text   = reader.GetString(4);
                if (!reader.IsDBNull(5))
                {
                    LabelNIP.Text = reader.GetString(5);
                }
                if (!reader.IsDBNull(6))
                {
                    LabelREGON.Text = reader.GetString(6);
                }
                LabelBank.Text        = reader.GetString(7);
                LabelBankAccount.Text = reader.GetString(8);

                /*for (int i = 0; i < reader.FieldCount; ++i)
                 * {
                 *      System.Diagnostics.Debug.WriteLine(reader.GetString(i));
                 * }*/
            }
            BaseConnection.closeConnection();
        }
Ejemplo n.º 12
0
        public void head()
        {
            string issueDate = "", dueDate = "", type = "Oryginał";

            if (!BaseConnection.openConnection())
            {
                return;
            }

            string query = "select Issue_date, Due_date , Payment_Method.Name from Invoices " +
                           "inner join Payment_Method on Invoices.Id_payment = Payment_Method.Id where Invoices.Id=" + _idInvoice;

            type = "Oryginał";
            SqlDataReader reader = BaseConnection.execReader(query);

            while (reader.Read())
            {
                issueDate = reader.GetDateTime(0).ToShortDateString();
                dueDate   = reader.GetDateTime(1).ToShortDateString();
                _payment  = reader.GetString(2);
            }


            BaseConnection.closeConnection();



            _writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            _writer.AddAttribute(HtmlTextWriterAttribute.Class, "h-25");
            _writer.RenderBeginTag(HtmlTextWriterTag.Div);             // open div row h-25
            {
                _writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-6");
                _writer.RenderBeginTag(HtmlTextWriterTag.Div);                 // open div col-6
                {
                    _writer.AddAttribute(HtmlTextWriterAttribute.Style, "width: 50%; height: 90%");
                    //_writer.AddAttribute(HtmlTextWriterAttribute.Class, "p-2");
                    //_writer.AddAttribute(HtmlTextWriterAttribute.Src, "file:\\" + HttpContext.Current.Server.MapPath( "Images/Logo.jpg"));
                    //_writer.AddAttribute(HtmlTextWriterAttribute.Src, IronPdf.Util.ImageToDataUri(System.Drawing.Image.FromFile(HttpContext.Current.Server.MapPath("Images/Logo.jpg"))));
                    _writer.RenderBeginTag(HtmlTextWriterTag.Img);                     // img logo
                    _writer.RenderEndTag();
                }
                _writer.RenderEndTag();                 // close  div col-6

                _writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-6");
                _writer.RenderBeginTag(HtmlTextWriterTag.Div);                 // open div col-6
                {
                    _writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
                    _writer.RenderBeginTag(HtmlTextWriterTag.Table);                     // open table
                    {
                        _writer.RenderBeginTag(HtmlTextWriterTag.Tbody);                 // open tbody
                        {
                            _writer.RenderBeginTag(HtmlTextWriterTag.Tr);                //open tr
                            {
                                _writer.RenderBeginTag(HtmlTextWriterTag.Td);            //Invoice
                                _writer.Write("Faktura");
                                _writer.RenderEndTag();

                                _writer.RenderBeginTag(HtmlTextWriterTag.Td);                                   // Invoice nr
                                _writer.Write(_nr);
                                _writer.RenderEndTag();
                            }
                            _writer.RenderEndTag();                             // close tr
                            _writer.RenderBeginTag(HtmlTextWriterTag.Tr);       //open tr
                            {
                                _writer.RenderBeginTag(HtmlTextWriterTag.Td);   //Issue date
                                _writer.Write("Data wystawienia:");
                                _writer.RenderEndTag();

                                _writer.RenderBeginTag(HtmlTextWriterTag.Td);
                                _writer.Write(issueDate);
                                _writer.RenderEndTag();
                            }
                            _writer.RenderEndTag();                             // close tr
                            _writer.RenderBeginTag(HtmlTextWriterTag.Tr);       //open tr
                            {
                                _writer.RenderBeginTag(HtmlTextWriterTag.Td);   //Due date
                                _writer.Write("Termin zapłaty:");
                                _writer.RenderEndTag();

                                _writer.RenderBeginTag(HtmlTextWriterTag.Td);
                                _writer.Write(dueDate);
                                _writer.RenderEndTag();
                            }
                            _writer.RenderEndTag();                             // close tr
                            _writer.RenderBeginTag(HtmlTextWriterTag.Tr);       //open tr
                            {
                                _writer.RenderBeginTag(HtmlTextWriterTag.Td);   //Payment
                                _writer.Write("Metoda płatności:");
                                _writer.RenderEndTag();

                                _writer.RenderBeginTag(HtmlTextWriterTag.Td);
                                _writer.Write(_payment);
                                _writer.RenderEndTag();
                            }
                            _writer.RenderEndTag();                             // close tr
                            _writer.RenderBeginTag(HtmlTextWriterTag.Tr);       //open tr
                            {
                                _writer.RenderBeginTag(HtmlTextWriterTag.Td);   //Payment
                                _writer.Write("Typ dokumentu:");
                                _writer.RenderEndTag();

                                _writer.RenderBeginTag(HtmlTextWriterTag.Td);
                                _writer.Write(type);
                                _writer.RenderEndTag();
                            }
                            _writer.RenderEndTag();                                                                    // close tr
                        }
                        _writer.RenderEndTag();                                                                        //close tbody
                    }
                    _writer.RenderEndTag();                                                                            //close table
                }
                _writer.RenderEndTag();                                                                                // close  div col-6
            }
            _writer.RenderEndTag();                                                                                    // close  div row h-25

            _writer.AddAttribute(HtmlTextWriterAttribute.Style, "color: black; height: 2px; background-color:black;"); //hr
            _writer.RenderBeginTag(HtmlTextWriterTag.Hr);
            _writer.RenderEndTag();
            _writer.RenderBeginTag(HtmlTextWriterTag.Br);             //br
            _writer.RenderEndTag();
        }
Ejemplo n.º 13
0
        public void products()
        {
            if (!BaseConnection.openConnection())
            {
                return;
            }


            string query = "select Products.Name, Units.Name, Invoice_Products.Amount, Tax_rates.Name, Tax_rates.Value, Invoice_Products.Price " +
                           "from Invoice_Products inner join Invoices on Invoice_Products.Id_invoice = Invoices.Id " +
                           "inner join Products on Invoice_Products.Id_product = Products.Id " +
                           "inner join Units on Units.Id = Products.Id_unit inner join Tax_rates on Tax_rates.Id = Invoice_Products.Id_tax " +
                           "where Invoices.Id = " + _idInvoice;


            decimal           sum          = 0;
            List <ProductRow> productsList = new List <ProductRow>();
            SqlDataReader     reader       = BaseConnection.execReader(query);

            while (reader.Read())
            {
                ProductRow productRow = new ProductRow();
                productRow.name         = reader.GetString(0);
                productRow.unit         = reader.GetString(1);
                productRow.amount       = reader.GetInt32(2);
                productRow.taxRate      = reader.GetString(3);
                productRow.taxRateValue = reader.GetDecimal(4);
                productRow.price        = reader.GetDecimal(5);
                productsList.Add(productRow);
            }


            BaseConnection.closeConnection();


            _writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
            _writer.RenderBeginTag(HtmlTextWriterTag.Table);             // open table
            {
                _writer.AddAttribute(HtmlTextWriterAttribute.Class, "thead-dark");
                _writer.RenderBeginTag(HtmlTextWriterTag.Thead);                 // open thead
                {
                    _writer.RenderBeginTag(HtmlTextWriterTag.Tr);                //open tr
                    {
                        _writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                        _writer.RenderBeginTag(HtmlTextWriterTag.Th);                           //Product
                        _writer.Write("Produkt");
                        _writer.RenderEndTag();

                        _writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                        _writer.RenderBeginTag(HtmlTextWriterTag.Th);                           //Unit
                        _writer.Write("Jedn.");
                        _writer.RenderEndTag();

                        _writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                        _writer.RenderBeginTag(HtmlTextWriterTag.Th);                           //Amount
                        _writer.Write("Ilość");
                        _writer.RenderEndTag();

                        _writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                        _writer.RenderBeginTag(HtmlTextWriterTag.Th);                           //Vat
                        _writer.Write("Stawka");
                        _writer.RenderEndTag();

                        _writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                        _writer.RenderBeginTag(HtmlTextWriterTag.Th);                           //Price netto
                        _writer.Write("Cena netto");
                        _writer.RenderEndTag();

                        _writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                        _writer.RenderBeginTag(HtmlTextWriterTag.Th);                           //Price brutto
                        _writer.Write("Cena brutto");
                        _writer.RenderEndTag();
                    }
                    _writer.RenderEndTag();                      // close tr
                }
                _writer.RenderEndTag();                          //close thead

                _writer.RenderBeginTag(HtmlTextWriterTag.Tbody); // open tbody
                {
                    foreach (var ele in productsList)
                    {
                        _writer.RenderBeginTag(HtmlTextWriterTag.Tr);                         //open tr
                        {
                            _writer.RenderBeginTag(HtmlTextWriterTag.Td);                     // Product
                            _writer.Write(ele.name);
                            _writer.RenderEndTag();

                            _writer.RenderBeginTag(HtmlTextWriterTag.Td);                               // Unit
                            _writer.Write(ele.unit);
                            _writer.RenderEndTag();

                            _writer.RenderBeginTag(HtmlTextWriterTag.Td);                               // Amount
                            _writer.Write(ele.amount);
                            _writer.RenderEndTag();

                            _writer.RenderBeginTag(HtmlTextWriterTag.Td);                               // VAT
                            _writer.Write(ele.taxRate);
                            _writer.RenderEndTag();

                            _writer.RenderBeginTag(HtmlTextWriterTag.Td);                               // Price netto
                            _writer.Write(ele.price.ToString("0.##"));
                            _writer.RenderEndTag();

                            decimal brutto = Math.Round(ele.price * (ele.taxRateValue + 1), 2);
                            sum += (brutto * ele.amount);
                            _writer.RenderBeginTag(HtmlTextWriterTag.Td);                               // Price brutto
                            _writer.Write(brutto);
                            _writer.RenderEndTag();
                        }
                        _writer.RenderEndTag();                         // close tr
                    }
                }
                _writer.RenderEndTag();         //close tbody
            }
            _writer.RenderEndTag();             //close table

            _writer.AddAttribute(HtmlTextWriterAttribute.Class, "text-right w-100 font-weight-bold bg-light");
            _writer.RenderBeginTag(HtmlTextWriterTag.H3); //open h3
            _writer.Write("Razem do zapłaty (brutto): " + sum + " zł");
            _writer.RenderEndTag();                       //close h3
        }
Ejemplo n.º 14
0
        public void persons()
        {
            if (!BaseConnection.openConnection())
            {
                return;
            }

            string query = "select * from User_Detail where Id_user ="******"", postTown = "", postCode = "", city = "", street = "", nip = "", regon = "", bank = "", bankAccount = "";
            SqlDataReader reader = BaseConnection.execReader(query);

            while (reader.Read())
            {
                id       = reader.GetInt32(0);
                name     = reader.GetString(1);
                postTown = reader.GetString(2);
                postCode = reader.GetString(3);
                city     = reader.GetString(4);
                street   = reader.GetString(5);
                if (!reader.IsDBNull(6))
                {
                    nip = reader.GetString(6);
                }
                if (!reader.IsDBNull(7))
                {
                    regon = reader.GetString(7);
                }
                if (!reader.IsDBNull(8))
                {
                    bank = reader.GetString(8);
                }
                if (!reader.IsDBNull(9))
                {
                    bankAccount = reader.GetString(9);
                }
            }
            reader.Close();
            BaseConnection.closeConnection();



            _writer.AddAttribute(HtmlTextWriterAttribute.Class, "row h-auto align-items-center");
            _writer.RenderBeginTag(HtmlTextWriterTag.Div);             // open div row h-auto align-items-center
            {
                _writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-6");
                _writer.RenderBeginTag(HtmlTextWriterTag.Div);                 // open div col-6 seller
                {
                    _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                    _writer.RenderBeginTag(HtmlTextWriterTag.Div);                     // title
                    _writer.Write("Sprzedawca:");
                    _writer.RenderEndTag();

                    _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                    _writer.RenderBeginTag(HtmlTextWriterTag.Div);                     // name
                    _writer.Write(name);
                    _writer.RenderEndTag();

                    _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                    _writer.RenderBeginTag(HtmlTextWriterTag.Div);                     // address
                    _writer.Write(city + " " + street);
                    _writer.RenderEndTag();

                    _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                    _writer.RenderBeginTag(HtmlTextWriterTag.Div);                     // post
                    _writer.Write(postCode + " " + postTown);
                    _writer.RenderEndTag();

                    if (nip != "")
                    {
                        _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                        _writer.RenderBeginTag(HtmlTextWriterTag.Div);                         // nip
                        _writer.Write("NIP: " + nip);
                        _writer.RenderEndTag();
                    }

                    if ((_payment == "Przelew") && (bank != "") && (bankAccount != ""))
                    {
                        _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                        _writer.RenderBeginTag(HtmlTextWriterTag.Div);                         // bank
                        _writer.Write(bank + " " + bankAccount);
                        _writer.RenderEndTag();
                    }
                }
                _writer.RenderEndTag();                 // close div col-6 seller

                if (!BaseConnection.openConnection())
                {
                    return;
                }

                query = "select Contractors.* from Contractors inner join Invoices on Contractors.Id=Invoices.Id_contractor where Invoices.Id =" + _idInvoice;
                string pesel = "";
                reader = BaseConnection.execReader(query);
                while (reader.Read())
                {
                    id       = reader.GetInt32(0);
                    id       = reader.GetInt32(1);
                    name     = reader.GetString(2);
                    postTown = reader.GetString(3);
                    postCode = reader.GetString(4);
                    city     = reader.GetString(5);
                    street   = reader.GetString(6);
                    if (!reader.IsDBNull(7))
                    {
                        nip = reader.GetString(7);
                    }
                    if (!reader.IsDBNull(8))
                    {
                        regon = reader.GetString(8);
                    }
                    if (!reader.IsDBNull(9))
                    {
                        pesel = reader.GetString(9);
                    }
                }

                BaseConnection.closeConnection();


                _writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-6");
                _writer.RenderBeginTag(HtmlTextWriterTag.Div);                 // open div col-6 buyer
                {
                    _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                    _writer.RenderBeginTag(HtmlTextWriterTag.Div);                     // title
                    _writer.Write("Kupujący:");
                    _writer.RenderEndTag();

                    _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                    _writer.RenderBeginTag(HtmlTextWriterTag.Div);                     // name
                    _writer.Write(name);
                    _writer.RenderEndTag();

                    _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                    _writer.RenderBeginTag(HtmlTextWriterTag.Div);                     // address
                    _writer.Write(city + " " + street);
                    _writer.RenderEndTag();

                    _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                    _writer.RenderBeginTag(HtmlTextWriterTag.Div);                     // post
                    _writer.Write(postCode + " " + postTown);
                    _writer.RenderEndTag();

                    if (nip != "")
                    {
                        _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                        _writer.RenderBeginTag(HtmlTextWriterTag.Div);                         // nip
                        _writer.Write("NIP: " + nip);
                        _writer.RenderEndTag();
                    }

                    if (pesel != "")
                    {
                        _writer.AddAttribute(HtmlTextWriterAttribute.Class, "mt-2");
                        _writer.RenderBeginTag(HtmlTextWriterTag.Div);                         // pesel
                        _writer.Write("PESEL: " + pesel);
                        _writer.RenderEndTag();
                    }
                }
                _writer.RenderEndTag();                                                                                // close div col-6 buyer
            }
            _writer.RenderEndTag();                                                                                    // close div row h-auto align-items-center

            _writer.AddAttribute(HtmlTextWriterAttribute.Style, "color: black; height: 2px; background-color:black;"); //hr
            _writer.RenderBeginTag(HtmlTextWriterTag.Hr);
            _writer.RenderEndTag();
            _writer.RenderBeginTag(HtmlTextWriterTag.Br);             //br
            _writer.RenderEndTag();
        }