Exemple #1
0
 protected void PopulateControls()
 {
     using (MyService.Lab04SoapClient sv = new MyService.Lab04SoapClient())
     {
         txtIp.Text = sv.GetClientIP();
     }
 }
Exemple #2
0
        protected void btnConvert_Click(object sender, EventArgs e)
        {
            using (MyService.Lab04SoapClient sv = new MyService.Lab04SoapClient())
            {
                switch ((MyService.MoneyConvertEnum)Enum.Parse(typeof(MyService.MoneyConvertEnum), ddlTypeConvert.SelectedValue))
                {
                case WebUsingService.MyService.MoneyConvertEnum.USD2VND:
                    txtConvertValue.Text = sv.MoneyConvert(Convert.ToDecimal(txtValue.Text), MyService.MoneyConvertEnum.USD2VND).ToString();
                    break;

                case WebUsingService.MyService.MoneyConvertEnum.VND2USD:
                    txtConvertValue.Text = sv.MoneyConvert(Convert.ToDecimal(txtValue.Text), MyService.MoneyConvertEnum.VND2USD).ToString();
                    break;

                case WebUsingService.MyService.MoneyConvertEnum.EUR2VND:
                    txtConvertValue.Text = sv.MoneyConvert(Convert.ToDecimal(txtValue.Text), MyService.MoneyConvertEnum.EUR2VND).ToString();
                    break;

                case WebUsingService.MyService.MoneyConvertEnum.VND2EUR:
                    txtConvertValue.Text = sv.MoneyConvert(Convert.ToDecimal(txtValue.Text), MyService.MoneyConvertEnum.VND2EUR).ToString();
                    break;

                case WebUsingService.MyService.MoneyConvertEnum.YP2VND:
                    txtConvertValue.Text = sv.MoneyConvert(Convert.ToDecimal(txtValue.Text), MyService.MoneyConvertEnum.YP2VND).ToString();
                    break;

                case WebUsingService.MyService.MoneyConvertEnum.VND2YP:
                    txtConvertValue.Text = sv.MoneyConvert(Convert.ToDecimal(txtValue.Text), MyService.MoneyConvertEnum.VND2YP).ToString();
                    break;
                }
            }
        }
Exemple #3
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            Fraction a = new Fraction()
            {
                Numerator = Convert.ToInt32(txtAx.Text), Denominator = Convert.ToInt32(txtAy.Text)
            };
            Fraction b = new Fraction()
            {
                Numerator = Convert.ToInt32(txtBx.Text), Denominator = Convert.ToInt32(txtBy.Text)
            };

            using (MyService.Lab04SoapClient sv = new MyService.Lab04SoapClient())
            {
                switch (ddlOperator.SelectedValue)
                {
                case "0":
                    a = sv.Add(a, b);
                    break;

                case "1":
                    a = sv.Subtraction(a, b);
                    break;

                case "2":
                    a = sv.Multiplication(a, b);
                    break;

                case "3":
                    a = sv.Division(a, b);
                    break;
                }
                txtAddResult.Text = String.Format("{0}/{1}", a.Numerator, a.Denominator);
            }
        }
 protected void PopulateControls()
 {
     using (MyService.Lab04SoapClient sv = new MyService.Lab04SoapClient())
     {
         repStudents.DataSource = sv.GetStudents("http://localhost:25056/SinhVien.htm");
     }
     repStudents.DataBind();
 }
Exemple #5
0
 protected void PopulateControls()
 {
     using (MyService.Lab04SoapClient sv = new MyService.Lab04SoapClient())
     {
         repData.DataSource = sv.GetWeatherInfo();
     }
     repData.DataBind();
 }
Exemple #6
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     using (MyService.Lab04SoapClient sv = new MyService.Lab04SoapClient())
     {
         MyService.ChungThuc ct = new MyService.ChungThuc();
         ct.UserName        = txtUserName.Text;
         ct.Password        = txtPass.Text;
         lblStatusInfo.Text = sv.ChungThucSoapHeader(ct);
     }
 }
 protected void btnEncrypt_Click(object sender, EventArgs e)
 {
     using (MyService.Lab04SoapClient sv = new MyService.Lab04SoapClient())
     {
         if (ddlAlgorythm.SelectedValue == "MD5")
         {
             txtEncrypt.Text = sv.MD5Encrypt(txtEncrypt.Text);
         }
         else
         {
             txtEncrypt.Text = sv.SHA1Encrypt(txtEncrypt.Text);
         }
     }
 }
 protected void btnEncrypt_Click(object sender, EventArgs e)
 {
     using (MyService.Lab04SoapClient sv = new MyService.Lab04SoapClient())
     {
         string path = Server.MapPath(String.Format("Uploads/{0}", txtImagePath.Text));// "D:/KimNguyen's Data/Advance Web Programming/dlu/Lab/NTierSolution/WebUsingService/Uploads/4.jpg";// ToUploadImage(txtImagePath.Text);
         path = path.Replace('\\', '/');
         if (rdMD5.Checked)
         {
             txtEncryptText.Text = sv.MD5FileEncrypt(path);
         }
         else
         {
             txtEncryptText.Text = sv.SHA1FileEncrypt(path);
         }
     }
 }