Exemplo n.º 1
0
        private void ViewVasData_Load(object sender, EventArgs e)
        {
            homeVas.Hide();
            listBox1.Items.Clear();
            listBox1.Hide();

            Cursor.Current = Cursors.WaitCursor;

            settingView  = new dgvSettings();
            changeFormat = new ChangeFormat();
            reserv       = new ReserveID();

            this.dataGridView1.AllowUserToAddRows = false;

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

            lstHeader.Add("VasCode");
            lstHeader.Add("Channel");
            lstHeader.Add("MktCode");
            lstHeader.Add("OrderType");
            lstHeader.Add("Product");
            lstHeader.Add("Speed");
            lstHeader.Add("Province");
            lstHeader.Add("Effective");
            lstHeader.Add("Expire");

            ToVasProduct();

            settingView.setDgv(dataGridView1, filename, "VAS New Sale(SMART UI)$B3:J", lstHeader);

            validate = new Validation(dataGridView1, ConnectionProd, ConnectionTemp, outputPath);

            listBox1.Items.Clear();
            ListBox ls = validate.verify("VAS");

            foreach (string v in ls.Items)
            {
                listBox1.Items.Add(v);
            }

            if (listBox1.Items.Count > 0)
            {
                indexListbox = validate.indexDgv;
                listBox1.Show();
            }
            else
            {
                listBox1.Hide();
            }

            toolStripStatusLabel1.Text = "Rows : " + dataGridView1.RowCount.ToString();

            Cursor.Current = Cursors.Default;
        }
        /// <summary>
        /// Set datagridview for new DC criteria
        /// </summary>
        private void ViewNewDC()
        {
            labelTitle.Text = "New Criteria Discount";

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

            lstHeader.Add("Vcare Discount Code");
            lstHeader.Add("Criteria (Mth)");
            lstHeader.Add("Channel");
            lstHeader.Add("MKT Code");
            lstHeader.Add("Order type");
            lstHeader.Add("Product");
            lstHeader.Add("Speed");
            lstHeader.Add("Province");
            lstHeader.Add("Effective Start Date");
            lstHeader.Add("End Date");

            settingView.setDgv(dataGridView1, filename, "Discount New Sale(SMART UI)$B3:K", lstHeader);

            validate = new Validation(dataGridView1, ConnectionProd, ConnectionTemp, outputPath);
            listBox1.Items.Clear();
            ListBox ls = validate.verify("Disc");

            foreach (string v in ls.Items)
            {
                listBox1.Items.Add(v);
            }

            if (listBox1.Items.Count > 0)
            {
                indexListbox = validate.indexDgv;
                listBox1.Show();
            }
            else
            {
                listBox1.Hide();
            }

            toolStripStatusLabel1.Text = "Rows : " + dataGridView1.RowCount.ToString();
        }