Exemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            ServiceReference1.WebService1SoapClient ser = new ServiceReference1.WebService1SoapClient();

            emaill = TextBox1.Text;
            if (ser.LoginFunc(TextBox1.Text, TextBox2.Text))
            {
                Server.Transfer("~/Main_Form.aspx");
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sample = add_bloodpressure.pressure;

            string[] temp = sample.Split('/');
            int      high = int.Parse(temp[0]);
            int      low  = int.Parse(temp[1]);

            ServiceReference1.WebService1SoapClient s = new ServiceReference1.WebService1SoapClient();

            ServiceReference1.DietPlanClass plan = new ServiceReference1.DietPlanClass();
            //-------------------------------------------------------------------------------------
            if (add_bloodpressure.agee() >= 6 && add_bloodpressure.agee() <= 29)
            {
                if (high >= 109 && high <= 133 && low >= 76 && low <= 85)
                {
                    plan = s.ViewDietPlan("TypeA");
                }
                else if (high < 109 && low < 76)
                {
                    plan = s.ViewDietPlan("TypeB");
                }
                else if (high > 133 && low > 85)
                {
                    plan = s.ViewDietPlan("TypeC");
                }
            }
            else if (add_bloodpressure.agee() >= 30 && add_bloodpressure.agee() <= 39)
            {
                if (high >= 111 && high <= 135 && low >= 78 && low <= 86)
                {
                    plan = s.ViewDietPlan("TypeD");
                }
                else if (high < 111 && low < 78)
                {
                    plan = s.ViewDietPlan("TypeA");
                }
                else if (high > 135 && low > 86)
                {
                    plan = s.ViewDietPlan("TypeB");
                }
            }
            else if (add_bloodpressure.agee() >= 40)
            {
                if (high >= 121 && high <= 147 && low >= 83 && low <= 91)
                {
                    plan = s.ViewDietPlan("TypeC");
                }
                else if (high < 121 && low < 83)
                {
                    plan = s.ViewDietPlan("TypeD");
                }
                else if (high > 147 && low > 91)
                {
                    plan = s.ViewDietPlan("TypeB");
                }
            }
            //------------------------------------------------------------------------------------


            Label_Veges.Text  = plan.veges;
            Label_Fruit.Text  = plan.fruit;
            Label_Meat.Text   = plan.meat;
            Label_Drinks.Text = plan.drinks;
            Label_Milk.Text   = plan.milk;
        }