Exemplo n.º 1
0
        public ActionResult BoiPhongThuy(PhongThuyModel phongThuyModel)
        {
            var isdataTime = false;

            try
            {
                var vnCal = new VietnameseCalendar();
                var date  = new DateTime(phongThuyModel.Nam, phongThuyModel.Thang, phongThuyModel.Ngay);
                isdataTime = true;
                phongThuyModel.SoDienThoai = phongThuyModel.SoDienThoai.Trim();
                int yyyy, mm, dd;
                vnCal.FromDateTime(date, out yyyy, out mm, out dd);
                var result   = SimSoDepRepository.BoiPhongThuy(phongThuyModel.SoDienThoai, yyyy);
                var tenNam   = vnCal.GetYearName(yyyy);
                var tenThang = vnCal.GetMonthName(yyyy, mm);
                var tenNgay  = vnCal.GetDayName(date);
                return(PartialView("BoiPhongThuy"));
            }
            catch (Exception)
            {
                if (!isdataTime)
                {
                    return(PartialView("NgayThangKhongDung"));
                }
                return(PartialView("ExceptionBreak"));
            }
        }
Exemplo n.º 2
0
        public VacaInfo(DateTime date)
        {
            Date            = date;
            backGroundColor = "Transparent";
            textColor       = "Black";
            VietnameseCalendar vCal = new VietnameseCalendar();

            lunarDay        = vCal.GetDayOfMonth(date);
            lunarMonth      = vCal.GetMonth(date);
            lunarYear       = vCal.GetYear(date);
            lunarDayStr     = VietnameseCalendar.GetDayName(date);
            lunarMonthStr   = VietnameseCalendar.GetMonthName(lunarYear, lunarMonth);
            lunarYearStr    = VietnameseCalendar.GetYearName(lunarYear);
            lunarDayBinding = lunarDay.ToString();
            if (lunarDay == 1)
            {
                lunarDayBinding += "/" + lunarMonth.ToString();
            }
        }