Exemple #1
0
 public ChangeBase(string pattern, string replace, ChangeFormat format, ChangeOptions options)
 {
     Pattern = pattern;
     Replace = replace;
     Format  = format;
     Options = options;
 }
Exemple #2
0
        public void NoEsFecha()
        {
            string testDate  = "12/04/199a";
            string testDate2 = "12hfht1997";

            Assert.AreEqual(ChangeFormat.ToDDMMYYYY(testDate), "Fecha inválida.");
            Assert.AreEqual(ChangeFormat.ToDDMMYYYY(testDate2), "Fecha inválida.");
        }
Exemple #3
0
        public void IsNull()
        {
            // el método devuelve la excepción que no existe instancia
            // debería de contenerse la excepción
            string testDate = null;

            Assert.AreEqual(ChangeFormat.ToDDMMYYYY(testDate), "Fecha inválida.");
        }
Exemple #4
0
        public void CantidadCaracteresIncorrecta()
        {
            string testDate = "1611561616161160";

            string testDate2 = "1566";

            Assert.AreEqual(ChangeFormat.ToDDMMYYYY(testDate), "Fecha inválida.");
            Assert.AreEqual(ChangeFormat.ToDDMMYYYY(testDate2), "Fecha inválida.");
        }
Exemple #5
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;
        }
Exemple #6
0
        public void CantidadCaracteresCorrecta()
        {
            // en este ejemplo, el resultado es correcto pero no el ingreso
            string testDate = "1270491997";

            // en este ejemplo, el resultado es correcto y también lo es el ingreso
            string testDate2 = "12/04/1997";

            Assert.AreEqual(ChangeFormat.ToDDMMYYYY(testDate), "12-04-1997");
            Assert.AreEqual(ChangeFormat.ToDDMMYYYY(testDate2), "12-04-1997");
        }
        static void Main(string[] args)

        {
            CheckDateExist toDate1 = new CheckDateExist("10/11/1977"); // Se instancia una posible fecha.

            if (toDate1.CheckExist() == true)                          // Si la fecha existe se hace instancia de una clase que cambia el fortamo de una fecha.
            {
                ChangeFormat date = new ChangeFormat(toDate1);
                DateToPrint.ConsolePrintFSlashToBash(date);
                DateToPrint.ConsolePrintChangeOrder(date);
            }
            else
            {
                Console.WriteLine("Fecha incorrecta.");
            }
        }
        /// <summary>
        /// When this form loading
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainDiscount_Load(object sender, EventArgs e)
        {
            home.Hide();

            listBox1.Items.Clear();
            listBox1.Hide();

            Cursor.Current = Cursors.Default;

            toolStripStatusLabel1.Text            = filename;
            this.dataGridView1.AllowUserToAddRows = false;
            btnOK.Enabled = true;

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

            if (FLAG_NEW == true && FLAG_EXISTING == false)
            {
                labelPg.Text = "Page1/1";
                ViewNewDC();
            }
            else if (FLAG_NEW == false && FLAG_EXISTING == true)
            {
                labelPg.Text = "Page1/1";
                ViewExistingDC();
            }
            else
            {
                labelPg.Text = "Page1/2";
                btnOK.Text   = "Next";
                ViewNewDC();
            }

            Cursor.Current = Cursors.Default;
        }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public ChangeException(string pattern, ChangeFormat format)
 {
     Pattern = pattern;
     Format  = format;
 }
        public void NoEsMes()
        {
            string testDate = "12/98/1997";

            Assert.AreEqual(ChangeFormat.ToYYYYMMDD(testDate), "Fecha inválida.");
        }
Exemple #11
0
        public void Empty()
        {
            string testDate = string.Empty;

            Assert.AreEqual(ChangeFormat.ToDDMMYYYY(testDate), "Fecha inválida.");
        }
Exemple #12
0
        public void NoEsDia()
        {
            string testDate = "54/04/1997";

            Assert.AreEqual(ChangeFormat.ToDDMMYYYY(testDate), "Fecha inválida.");
        }
Exemple #13
0
 public Change(string pattern, string replace, ChangeFormat format) : base(pattern, replace, format)
 {
 }
Exemple #14
0
 public Change(string pattern, string replace, ChangeFormat format, ChangeOptions options) : base(pattern, replace, format, options)
 {
 }
Exemple #15
0
 public Change(int order, string pattern, string replace, ChangeFormat format, ChangeOptions options) : base(pattern, replace, format, options)
 {
     Order = order;
 }
Exemple #16
0
 public ChangeBase(string pattern, string replace, ChangeFormat format)
     : this(pattern, replace, format, new ChangeOptions())
 {
 }
Exemple #17
0
 public Change(int order, string pattern, string replace, ChangeFormat format) : base(pattern, replace, format)
 {
     Order = order;
 }
Exemple #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public Expression(string pattern, ChangeFormat format)
 {
     Pattern = pattern;
     Format  = format;
 }