Exemple #1
0
        public Object Save()
        {
            String status = null;
            var    rqp    = RequestPackage.ParseRequest(Request.InputStream, Request.ContentEncoding);

            if (rqp != null)
            {
                switch (rqp.Command)
                {
                case "save":
                    status = F1Model.Upsert(rqp);
                    break;

                case "delete":
                    status = F1Model.Delete(rqp);
                    break;

                default:
                    break;
                }
            }
            else
            {
                status = "Ошибка в формате команды.";
            }
            return(status);
        }
Exemple #2
0
        public String Save()
        {
            String status = null;
            Dictionary <String, String> pars = new Dictionary <String, String>(Request.Form.Count);

            for (int i = 0; i < Request.Form.Count; i++)
            {
                pars.Add(Request.Form.Keys[i], Request.Form.GetValues(i)[0]);
            }
            if ((pars != null) && pars.ContainsKey("cmd"))
            {
                switch (pars["cmd"])
                {
                case "save":
                    status = F1Model.Upsert(pars);
                    break;

                case "delete":
                    status = F1Model.Delete(pars);
                    break;

                default:
                    break;
                }
            }
            else
            {
                status = "Ошибка в формате команды.";
            }
            return(status);
        }