Ejemplo n.º 1
0
        public ActionResult Settings(string par)
        {
            string _userName = ExtractUserName();
            Stream req       = Request.InputStream;

            req.Seek(0, SeekOrigin.Begin);
            string json      = new StreamReader(req).ReadToEnd();
            var    _userInfo = JsonConvert.DeserializeObject <ExternalSendInfo>(json);

            if (_userName != null)
            {
                SendInfo _info = mssqlDao.GetSendInfoDao().Find(_userName);
                _info.SendEmail      = _userInfo.SendEmail;
                _info.SendSms        = _userInfo.SendSms;
                _info.UserEmail      = _userInfo.UserEmail;
                _info.UserPhone      = _userInfo.UserPhone;
                _info.City           = _userInfo.City;
                _info.DataFileName   = _userInfo.DataFileName;
                _info.DataFileId     = _userInfo.DataFileId;
                _info.TimeWeekDay    = _userInfo.TimeWeekDay;
                _info.TimeWeekEnd    = _userInfo.TimeWeekEnd;
                _info.TimeZoneOffset = _userInfo.TimeZoneOffset;
                _info.WeekendMode    = _userInfo.WeekendMode;
                _info.Temperature    = _userInfo.Temperature;

                mssqlDao.GetSendInfoDao().Update(_info);

                return(Json(ExternalSendInfo.Create(_info), JsonRequestBehavior.AllowGet));
            }
            return(Json(new ExternalSendInfo(), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult Settings()
        {
            string _userName = ExtractUserName();

            if (_userName != null)
            {
                SendInfo _info = mssqlDao.GetSendInfoDao().Find(_userName);

                return(Json(ExternalSendInfo.Create(_info), JsonRequestBehavior.AllowGet));
            }
            return(Json(new ExternalSendInfo(), JsonRequestBehavior.AllowGet));
        }