Пример #1
0
        public void LoadCostomer(long id = 0, string fristName = null)
        {
            var costomer = CostomerController.GetCustomerRequests(id, fristName).Where(w => w.costumerRefusal == null)?.ToList();

            if (costomer != null && costomer.Count() > 0)
            {
                clientDataGridView.AutoGenerateColumns = false;
                clientDataGridView.DataSource          = costomer;
            }
            else
            {
                clientDataGridView.DataSource = null;
            }
        }
Пример #2
0
        private void AnalyzeClientForm_Load(object sender, EventArgs e)
        {
            CostomerController = new CostomerController();

            var costomer = CostomerController.GetCustomerRequests(CostomerViews.Id);

            if (costomer != null)
            {
                fristNameTextBox.Text                 = CostomerViews.FristName;
                lastNameTextBox.Text                  = CostomerViews.LastName;
                cpfMaskedTextBox.Text                 = CostomerViews.CPF;
                birthDateMaskedTextBox.Text           = Convert.ToString(CostomerViews.BirthDate);
                physicalPersonPhoneMaskedTextBox.Text = CostomerViews.Phone;
                emailTextBox.Text      = CostomerViews.Email;
                cnpjMaskedTextBox.Text = CostomerViews.CNPJ;
                nickNameTextBox.Text   = CostomerViews.Nickname;
            }
        }
Пример #3
0
        private void ChartClient(string fristName = null, long id = 0)
        {
            ArrayList customerArray = new ArrayList();

            var customersRequested = CostomerController.GetCustomerRequests(id, fristName);
            var customers          = CostomerController.GetCustomer(id, fristName);

            int quantityRequested = customersRequested.Count(c => c.costumerRefusal == null);
            int quantityConfirmed = customers.Count();
            int quantityRefused   = customersRequested.Count(c => c.costumerRefusal != null);

            if (customersRequested != null)
            {
                customerArray.Add(quantityRequested);
            }

            if (customers != null)
            {
                customerArray.Add(quantityConfirmed);
            }

            chart1.Series[0].Points.DataBindY(customerArray);
            GenerateChart(quantityConfirmed, quantityRequested, quantityRefused);
        }