Пример #1
0
        public JsonResult TimeToChange(int id, string time)
        {
            if (time.Trim() == string.Empty)
            {
                return(Json("empty", JsonRequestBehavior.AllowGet));
            }

            try
            {
                DateTime             toTime  = DateTime.ParseExact(time.Trim(), "HH:mm", CultureInfo.InvariantCulture);
                UserTimeZoneProperty newUtzp = _userTimeZonePropertyRepository.FindById(id);

                _userTimeZoneService.UpdateUserToTime(id, toTime);
                _userPermissionGroupService.UpdateGroupToTime(newUtzp.UserTimeZoneId, toTime, newUtzp.OrderInGroup);
                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
            catch
            {
                return(Json("not", JsonRequestBehavior.AllowGet));
            }
        }