Ejemplo n.º 1
0
        public void Age_Gender(HttpRequest req, HttpResponse resp)
        {
            string content = req.GetBodyContentAsString();
            //Console.WriteLine(req.HttpMethod);
            Kidshistory evArgs = new Kidshistory();

            if (req.HttpMethod.ToString() == "Post") //check
            {
                evArgs.health = content;             //health query

                Load_age_gender(this, evArgs);
                if (evArgs.health == null)
                {
                    resp.End("Error");
                    return;
                }
                resp.Write((string)evArgs.health);
                resp.End();       //return data
                return;
            }
            else if (req.HttpMethod.ToString() == "Get")
            {
                resp.End("Post only");
                return;
            }
            resp.End("?");
        }
Ejemplo n.º 2
0
        public void Get_Appoinement_Data(HttpRequest req, HttpResponse resp)
        {
            string content = req.GetBodyContentAsString();
            //Console.WriteLine(req.HttpMethod);
            Kidshistory evArgs = new Kidshistory();

            if (Load_Appointment != null && req.HttpMethod.ToString() == "Post")
            {
                evArgs.notification = content; //comment
                Load_Appointment(this, evArgs);
                if (evArgs.notification == null)
                {
                    resp.End("Error");
                    return;
                }
                resp.Write((string)evArgs.notification);
                resp.End();
                return;
            }
            else if (req.HttpMethod.ToString() == "Get")
            {
                resp.End("Post only");
                return;
            }
            resp.End("?");
        }
Ejemplo n.º 3
0
        public void Load_list_vaccine(HttpRequest req, HttpResponse resp)
        {
            string content = req.GetBodyContentAsString();
            //Console.WriteLine(req.HttpMethod);
            Kidshistory evArgs = new Kidshistory();

            if (req.HttpMethod.ToString() == "Post")
            {
                evArgs.vaccine = content; //comment
                Load_vaccine(this, evArgs);
                if ((string)evArgs.vaccine == "Fail")
                {
                    resp.Write("No data");
                }
                else
                {
                    resp.Write((string)evArgs.vaccine);
                }

                resp.End();
                return;
            }
            else if (req.HttpMethod.ToString() == "Get")
            {
                resp.End("Post only");
                return;
            }
            resp.End("?");
        }
Ejemplo n.º 4
0
        public void Comment(HttpRequest req, HttpResponse resp)
        {
            string content = req.GetBodyContentAsString();
            //Console.WriteLine(req.HttpMethod);
            Kidshistory evArgs = new Kidshistory();

            //Comment_Arrived.DynamicInvoke(evArgs);
            if (Comment_Arrived != null && req.HttpMethod.ToString() == "Post")
            {
                evArgs.about = content; //comment
                Comment_Arrived(this, evArgs);
                resp.End("Success");

                return;
            }
            else if (req.HttpMethod.ToString() == "Get")
            {
                evArgs.about = null;
                Load_comment(this, evArgs);
                if (evArgs.about == null)
                {
                    resp.End("No Data");
                    return;
                }
                resp.Write((string)evArgs.about);
                resp.End();

                return;
            }
            resp.End("?");
        }
Ejemplo n.º 5
0
        public void Check(HttpRequest req, HttpResponse resp)
        {
            string content = req.GetBodyContentAsString();
            //Console.WriteLine(req.HttpMethod);
            Kidshistory evArgs = new Kidshistory();

            if (req.HttpMethod.ToString() == "Post") //check
            {
                evArgs.users = content;              //comment

                Login(this, evArgs);
                if (evArgs.users == null)
                {
                    resp.End("No Data");
                    return;
                }
                string contain = (string)evArgs.users; //success or fail

                if (contain.Contains("Success"))
                {
                    resp.Write((string)evArgs.users);

                    resp.End();
                    //req.Dispose();

                    return;
                }
                resp.Write((string)evArgs.users);
                resp.End();
                return;
            }
            else if (req.HttpMethod.ToString() == "Get")
            {
                resp.End("?");
            }
            resp.End("?");
        }