Exemple #1
0
        private void PictureBox2_Click(object sender, EventArgs e)
        {
            Classes.Profile p = new Classes.Profile();

            p.FIRSTNAME = textBox6.Text;
            p.LASTNAME  = textBox2.Text;
            p.ADRESS1   = textBox1.Text;
            p.ADRESS2   = textBox3.Text;
            p.CITY      = comboBox1.Text;
            p.STATE     = textBox4.Text;
            maskedTextBox2.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
            p.FISCAL    = Int32.Parse(maskedTextBox2.Text);
            p.REFERENCE = textBox5.Text;
            p.INFO      = textBox7.Text;
            maskedTextBox1.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
            p.PHONE       = Int32.Parse(maskedTextBox1.Text);
            p.EMAIL       = err.Text;
            p.IDENTIFIER  = Databases.getIdentifier(Classes.Enum.IdentifierType.PROFILE);
            p.DATECREATED = Utils.Time.get();

            ProfileManager.saveProfile(p);
            Data.editdone2 = true;
            this.Close();
        }
Exemple #2
0
        private void updateOrderList()
        {
            orders.Clear();
            levelOrder.Clear();
            orders = OrderManager.loadOrders();

            dataGridView3.Rows.Clear();
            dataGridView3.DataSource = null;

            dataGridView3.ColumnCount      = 11;
            dataGridView3.Columns[0].Name  = "ID";
            dataGridView3.Columns[0].Width = 110;
            dataGridView3.Columns[1].Name  = "Criador";
            dataGridView3.Columns[2].Name  = "Valor";
            dataGridView3.Columns[3].Name  = "Mesa";
            dataGridView3.Columns[4].Name  = "Data Criado";
            dataGridView3.Columns[5].Name  = "Data Fechado";
            dataGridView3.Columns[6].Name  = "Ocorrência";
            dataGridView3.Columns[7].Name  = "Info Ocorrência";
            dataGridView3.Columns[8].Name  = "Detalhes de Pagamento";
            dataGridView3.Columns[9].Name  = "Conta Associada";
            dataGridView3.Columns[10].Name = "Tipo";

            int count = 1;

            foreach (Classes.Order o in orders)
            {
                if (checkBox1.Checked == o.DONE)
                {
                    levelOrder.Add(count, o);
                    count += 1;

                    ArrayList row = new ArrayList();
                    row.Add(o.ID + "");
                    row.Add(UserManager.getUserFirstName(o.CREATORUSERID));
                    row.Add(o.VALUE + "€");
                    String str;
                    int    table = o.TABLE;
                    if (table == -1)
                    {
                        str = "Nenhuma";
                    }
                    else
                    {
                        str = "" + table;
                    }
                    row.Add(str);
                    row.Add(o.DATECREATED);
                    row.Add(o.DATECLOSED);
                    String str2;
                    if (o.OCCURRENCE == true)
                    {
                        str2 = "Sim";
                    }
                    else
                    {
                        str2 = "Não";
                    }
                    row.Add(str2);
                    row.Add(o.OCCURRENCEINFO);
                    row.Add(o.PAYMENTDETAILS);
                    if (o.PEOPLEPROFILEID != null)
                    {
                        if (o.PEOPLEPROFILEID != "Nenhum")
                        {
                            Classes.Profile f = ProfileManager.getProfile(o.PEOPLEPROFILEID);
                            row.Add(f.FIRSTNAME + " " + f.LASTNAME);
                        }
                        else
                        {
                            row.Add("Nenhuma");
                        }
                    }
                    else
                    {
                        row.Add("-");
                    }
                    String str3;
                    if (o.ORDERTYPE == 0)
                    {
                        str3 = "Fatura";
                    }
                    else
                    {
                        str3 = "Mesas";
                    }
                    row.Add(str3);
                    dataGridView3.Rows.Add(row.ToArray());
                }
            }
            dataGridView3.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;

            DataGridViewButtonColumn btn = new DataGridViewButtonColumn();

            btn.HeaderText = "Produtos";
            btn.Name       = "produtos";
            btn.Text       = "Clica para ver";
            btn.UseColumnTextForButtonValue = true;
            dataGridView3.Columns.Add(btn);

            DataGridViewButtonColumn btn2 = new DataGridViewButtonColumn();

            btn2.HeaderText = "Eventos";
            btn2.Name       = "event";
            btn2.Text       = "Clica para ver";
            btn2.UseColumnTextForButtonValue = true;
            dataGridView3.Columns.Add(btn2);

            //checker

            foreach (DataGridViewRow rw in this.dataGridView3.Rows)
            {
                for (int i = 0; i < rw.Cells.Count; i++)
                {
                    if (rw.Cells[i].Value == null || rw.Cells[i].Value == DBNull.Value || String.IsNullOrWhiteSpace(rw.Cells[i].Value.ToString()))
                    {
                        rw.Cells[i].Value = "-";
                    }
                }
            }

            //checker

            foreach (DataGridViewRow rw in this.dataGridView1.Rows)
            {
                for (int i = 0; i < rw.Cells.Count; i++)
                {
                    if (rw.Cells[i].Value == null || rw.Cells[i].Value == DBNull.Value || String.IsNullOrWhiteSpace(rw.Cells[i].Value.ToString()))
                    {
                        rw.Cells[i].Value = "-";
                    }
                }
            }

            //checker

            foreach (DataGridViewRow rw in this.dataGridView2.Rows)
            {
                for (int i = 0; i < rw.Cells.Count; i++)
                {
                    if (rw.Cells[i].Value == null || rw.Cells[i].Value == DBNull.Value || String.IsNullOrWhiteSpace(rw.Cells[i].Value.ToString()))
                    {
                        rw.Cells[i].Value = "-";
                    }
                }
            }

            //checker

            foreach (DataGridViewRow rw in this.dataGridView4.Rows)
            {
                for (int i = 0; i < rw.Cells.Count; i++)
                {
                    if (rw.Cells[i].Value == null || rw.Cells[i].Value == DBNull.Value || String.IsNullOrWhiteSpace(rw.Cells[i].Value.ToString()))
                    {
                        rw.Cells[i].Value = "-";
                    }
                }
            }
        }
Exemple #3
0
 public EditProfile(Classes.Profile pp)
 {
     p = pp;
     InitializeComponent();
 }