Example #1
0
 private void HideServicePayTB()
 {
     //Hide Service payment textboxes
     Payment_Service_textBox.Hide();
     Date_Service_Payment_textBox.Hide();
     Date_input_Service_Payment_textBox.Hide();
     Desc_Service_Payment_textBox.Hide();
     Desc_input_Service_Payment_textBox.Hide();
 }
Example #2
0
        private void ShowServiceInvoice()
        {
            if (currentServiceInvoice != -1)
            {
                foreach (Service_Invoice sp in spList)
                {
                    if (sp.Index == currentServiceInvoice)
                    {
                        id_f_sp = sp.ID;
                        //Show Service invoice textboxes
                        ShowServiceInvTB();
                        //Show Service Buttons
                        Delete_Service_button.Show();

                        VerifySGBDConnection();

                        cmd = new SqlCommand("condomanager.ispaidservicos", cn)
                        {
                            CommandType = CommandType.StoredProcedure
                        };

                        cmd.Parameters.AddWithValue("id_fatura", sp.ID);
                        cmd.ExecuteNonQuery();
                        DataTable      dt = new DataTable();
                        SqlDataAdapter da = new SqlDataAdapter(cmd);
                        da.Fill(dt);

                        Date_input_Service_Invoice_textBox.Text      = sp.Date;
                        TaxNumber_input_Service_Invoice_textBox.Text = sp.Tax_Number;
                        Amount_input_Service_Invoice_textBox.Text    = sp.Amount;
                        Desc_input_Service_Invoice_textBox.Text      = sp.Description;

                        ShowServiceInvTB();
                        if (dt.Rows.Count != 0)
                        {
                            //payment
                            Payment_Service_textBox.Show();
                            Date_Service_Payment_textBox.Show();
                            Date_input_Service_Payment_textBox.Show();
                            Desc_Service_Payment_textBox.Show();
                            Desc_input_Service_Payment_textBox.Show();
                            //add payment values
                            Date_input_Service_Payment_textBox.Text = dt.Rows[0]["data"].ToString();
                            Desc_input_Service_Payment_textBox.Text = dt.Rows[0]["descricao"].ToString();
                            Mark_Paid_Quota_button.Show();
                            Add_Quota_button.Hide();
                        }
                        else
                        {
                            //payment
                            Payment_Service_textBox.Hide();
                            Date_Service_Payment_textBox.Hide();
                            Date_input_Service_Payment_textBox.Hide();
                            Desc_Service_Payment_textBox.Hide();
                            Desc_input_Service_Payment_textBox.Hide();
                            Mark_Paid_Service_button.Show();
                        }
                    }
                }
            }
        }