コード例 #1
0
        public ActionResult SuggestionList()
        {
            List <Suggestion> objlist = new SuggestionManager().GetSuggestion();

            //ViewBag.list = objlist;
            return(View("SuggestionList", objlist));
        }
コード例 #2
0
 /// <summary>
 /// 提交投诉建议
 /// </summary>
 /// <param name="suggestion"></param>
 /// <param name="code"></param>
 /// <returns></returns>
 public ActionResult SubmitSuggestion(Suggestion suggestion, string vCode)
 {
     if (ModelState.IsValid)
     {
         string code = Session["ValidateCode"].ToString();
         if (code != vCode.ToLower())
         {
             ModelState.AddModelError("vCode", "验证码不正确,请重新输入!");
             return(View("Suggestions", suggestion));
         }
         else
         {
             suggestion.StatusId = 0;
             int result = new SuggestionManager().SubmitSuggestion(suggestion);
             if (result > 0)
             {
                 return(Content("<script>alert('投诉提交成功!');window.location='" + Url.Content("~/Company/Index") + "'</script>"));
             }
             else
             {
                 return(Content("<script>alert('投诉提交失败!');window.location='" + Url.Content("~/Company/Suggestions") + "'</script>"));
             }
         }
     }
     else
     {
         return(View("Suggestions", suggestion));
     }
 }
コード例 #3
0
        internal static bool BootstrapLibrary()
        {
            if (String.IsNullOrWhiteSpace(SecretKey))
            {
                return(true);
            }

            BroadcastManager.Init();
            ChatManager.Init();
            PlaylistManager.Init();
            QueueManager.Init();
            SettingsManager.Init();
            UserManager.Init();
            SuggestionManager.Init();
            StatisticsManager.Init();

            // ModuleManager should always load last.
            ModuleManager.Init();

            using (var s_Db = Database.GetConnection())
                if (s_Db.SingleById <CoreSetting>("gsun") == null || s_Db.SingleById <CoreSetting>("gspw") == null)
                {
                    return(false);
                }

            UserManager.Authenticate();
            return(true);
        }
コード例 #4
0
        /// <summary>
        /// 投诉建议管理页
        /// </summary>
        /// <returns></returns>
        public ActionResult SuggestionManager()
        {
            //获取所有的未处理投诉
            List <Suggestion> list = new SuggestionManager().GetSuggestion();

            return(View("SuggestionManager", list));//在这里没有用ViewBag传递,就是让大家知道,集合类型同样可以作为强类型实体的数据传递
        }
コード例 #5
0
 /// <summary>
 /// 提交投诉建议
 /// </summary>
 /// <param name="suggestion"></param>
 /// <param name="vCode"></param>
 /// <returns></returns>
 public ActionResult SubmitSuggestion(Suggestion suggestion, string vCode)
 {
     if (ModelState.IsValid)
     {
         string code = Session["ValidateCode"].ToString();
         if (code != vCode.ToLower())
         {
             ModelState.AddModelError("vCode", "验证码不正确,请重新输入!");
             return(View("Suggestions", suggestion));
         }
         else
         {
             suggestion.StatusId = 0;//如果不设置,会产生null
             int result = new SuggestionManager().SubmitSuggestion(suggestion);
             if (result > 0)
             {
                 return(Content("<script>alert('投诉提交成功!');window.location='" + Url.Content("~/") + "'</script>"));
             }
             else
             {
                 //可以根据需要,停留到当前页面,也可以刷新当前页面...
                 return(Content("<script>alert('投诉提交失败!');window.location='" +
                                Url.Content("~/Company/Suggestions") + "'</script>"));
             }
         }
     }
     else
     {
         return(View("Suggestions", suggestion));
     }
 }
コード例 #6
0
        public ActionResult Suggestion(Suggestion suggestion)
        {
            suggestion.SuggestionTime = DateTime.Now;
            suggestion.StatusId       = 0;
            int res = new SuggestionManager().AddSuggestion(suggestion);

            return(Content(res.ToString()));
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["SuggestionID"] != null)
            {
                SuggestionManager.SuggestionCheck(Request.QueryString["SuggestionID"]);
            }

            Response.Redirect("/admin/SuggestionManagement.aspx");
        }
コード例 #8
0
        // Main entry point for our application
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Create the speech object to use for speech recognition
            speech = new Speech(10);

            this.context = this;

            // Initialize the command matcher and application matcher to use to parse the user's input
            commandMatcher = new CommandStringMatcher(this.Assets.Open("dictionary.txt"));

            // Initialize suggestion manager with default commands
            suggestionManager = new SuggestionManager(this, commandMatcher.Dictionary);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // get the resources from the layout
            recordBtn         = FindViewById <Button>(Resource.Id.recordBtn);
            textBox           = FindViewById <EditText>(Resource.Id.outputTxt);
            enterBtn          = FindViewById <Button>(Resource.Id.enterBtn);
            commandHeaderText = FindViewById <TextView>(Resource.Id.cmdPrompt);
            commandList       = FindViewById <ListView>(Resource.Id.cmdList);

            // Create a button click event for the recordBtn : Nathan
            recordBtn.Click += delegate
            {
                // create the intent and start the activity
                var voiceIntent = speech.setUpIntent(new Intent());
                StartActivityForResult(voiceIntent, 10);
            };

            // coded by Julien
            enterBtn.Click += delegate
            {
                textCommand = textBox.Text;
                string arguments = commandMatcher.process(textCommand);

                if (!commandMatcher.KeyWord.Equals(""))
                {
                    IAction action = Implementations.Action.createAction(context, commandMatcher.KeyWord);
                    action.setArguments(arguments);
                    action.run();
                }
                else
                {
                    this.ErrorMessage("No commands recognised.");
                    var commands = suggestionManager.pullSpecificCommands(textCommand);
                    this.CommandList(commands);
                }

                commandMatcher.KeyWord = "";
            };
        }
コード例 #9
0
        public ActionResult DoSugg(string suggId)
        {
            int res = new SuggestionManager().HandlSuggestion(suggId);

            if (res > 0)
            {
                return(Content("<script>alert('suggestion has been taken!');location.href='" + Url.Action("SuggestionList") + "'</script>"));
            }
            else
            {
                return(Content("<script>alert('fail to update suggestion!');location.href='" + Url.Action("SuggestionList") + "'</script>"));
            }
        }
コード例 #10
0
        public ActionResult DoSugg(string suggId)
        {
            //调用模型BLL进行数据处理
            int res = new SuggestionManager().HandlSuggestion(suggId);

            if (res > 0)
            {
                return(Content("<script>alert('投诉受理成功!');location.href='" + Url.Action("SuggestionList") + "'</script>"));
            }
            else
            {
                return(Content("<script>alert('投诉受理失败!');location.href='" + Url.Action("SuggestionList") + "'</script>"));
            }
        }
コード例 #11
0
        public ActionResult HandleSuggestion(int suggestionId)
        {
            //处理投诉就是将投诉的这条数据状态改成1,这部分也可以在业务逻辑里面写,但是本次我们放到的数据访问,请大家知道即可
            int result = new SuggestionManager().HandleSuggestion(suggestionId);

            if (result > 0)
            {
                return(Content("<script>alert('投诉受理成功!');location.href='" + Url.Action("SuggestionManager") + "'</script>"));
            }
            else
            {
                return(Content("<script>alert('投诉受理失败!');location.href='" + Url.Action("SuggestionManager") + "'</script>"));
            }
        }
コード例 #12
0
 public ActionResult DoSugg(Suggestion objSug, string ValidateCode)
 {
     if (String.Compare(Session["ValidateCode"].ToString(), ValidateCode, true) != 0)
     {
         ModelState.AddModelError("yzm", "wrong code");
         return(View("Suggestions"));
     }
     else
     {
         int res = new SuggestionManager().SubmitSuggestion(objSug);
         if (res > 0)
         {
             return(Content("add successfully!"));
         }
         else
         {
             return(Content("fail to add!"));
         }
     }
 }
コード例 #13
0
 public ActionResult DoSugg(Suggestion objSug, string ValidateCode)
 {
     if (string.Compare(Session["ValidateCode"].ToString(), ValidateCode, true) != 0)
     {
         ModelState.AddModelError("yzm", "验证码不正确,请重新输入");
         return(View("Suggestions"));
     }
     else
     {
         //调用BLL数据处理
         int result = new SuggestionManager().SubmitSuggestion(objSug);
         if (result > 0)
         {
             return(Content("添加成功!"));
         }
         else
         {
             return(Content("添加失败!"));
         }
     }
 }
コード例 #14
0
 // Use this for initialization
 void Start()
 {
     suggestionManager = FindObjectOfType <SuggestionManager>();
 }