Пример #1
0
        private void cekTanggal()
        {
            DateTime today = DateTime.Now;

            string dateToday = today.ToString("MM/yyyy", CultureInfo.InvariantCulture);
            string dateX     = CUS_C.lastDate().ToString("MM/yyyy", CultureInfo.InvariantCulture);

            DateTime dateTodayX = DateTime.ParseExact(dateToday, "MM/yyyy", CultureInfo.InvariantCulture);
            DateTime dateLastX  = DateTime.ParseExact(dateX, "MM/yyyy", CultureInfo.InvariantCulture);


            if (dateLastX == dateTodayX)
            {
                string ID_Omega = CUS_C.AmbilLastID();
                string sub      = ID_Omega.Substring(12);

                todayCustomer = int.Parse(sub) + 1;
            }

            else if (dateTodayX > dateLastX)
            {
                todayCustomer = 1;
            }
        }