当前位置: 首页>>代码示例>>C#>>正文


C# Service1Client类代码示例

本文整理汇总了C#中Service1Client的典型用法代码示例。如果您正苦于以下问题:C# Service1Client类的具体用法?C# Service1Client怎么用?C# Service1Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Service1Client类属于命名空间,在下文中一共展示了Service1Client类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestSync

 public void TestSync()
 {
     using (Service1Client proxy = new Service1Client())
     {
         proxy.GetDataUsingDataContract(new CompositeType());
     }
 }
开发者ID:Code2Read,项目名称:PruebaConcepto,代码行数:7,代码来源:UnitTest1.cs

示例2: CallService1

        private async void CallService1(object sender, EventArgs e)
        {
            BasicHttpBinding binding = DataModel.CreateBasicHttp();

            //Service1Client client = new Service1Client(binding, new EndpointAddress("http://localhost:59074/Service1.svc"));
            Service1Client client = new Service1Client(binding, new EndpointAddress("http://192.168.1.96:59075/Service1.svc"));

            count++;

            CompositeType parm = new CompositeType();
            parm.BoolValue = true;
            parm.StringValue = "Hello " + count.ToString() + " ";

            try
            {
                CompositeType s = await Task<CompositeType>.Factory.FromAsync((asyncCallback, asyncState) => client.BeginGetDataUsingDataContract(parm, asyncCallback, asyncState),
                                                                       (asyncResult) => client.EndGetDataUsingDataContract(asyncResult), null);

                MyText.Text = s.StringValue;
            }
            catch(Exception ex)
            {
                Android.Util.Log.Debug("", ex.ToString());
            }


        }
开发者ID:JimWilcox3,项目名称:XamarinAsyncTest,代码行数:27,代码来源:MainActivity.cs

示例3: inputButton_Click

 private void inputButton_Click(object sender, RoutedEventArgs e)
 {
     string str = inputbox.Text;
     Service1Client client1 = new Service1Client();
     client1.SeePatientDataCompleted += new EventHandler<SeePatientDataCompletedEventArgs>(client1_SeePatientDataCompleted);
     client1.SeePatientDataAsync(str);
 }
开发者ID:cloudscrubs,项目名称:azureprototype,代码行数:7,代码来源:Test1.xaml.cs

示例4: AddJefe

        // GET: Jerarquia
        public ActionResult AddJefe()
        {
            if (Session["User"] != null)
            {
                Service1Client client = new Service1Client();
                var query = client.getTbl_usuarios();
                List<string> emple = new List<string>();
                foreach (var item in query)
                {
                    emple.Add(item.primer_nombre + " " + item.primer_apellido + "|" + item.talento_humano);
                }
                ViewBag.Empleados = emple;

                var quer = client.getTbl_departamentos();
                List<string> depto = new List<string>();
                foreach (var item in quer)
                {
                    depto.Add(item.descripcion+ "|" + item.departamentoid);
                }
                client.Close();
                ViewBag.Empleados = emple;
                ViewBag.Departamentos = depto;

                return View();
            }

            else
                return RedirectToAction("Login", "Home");
        }
开发者ID:DannyelPerez,项目名称:ASKI-SISTEMA_VACACIONES,代码行数:30,代码来源:JerarquiaController.cs

示例5: GridBagla

    /*
    protected void GridBagla(int FirmaId)
    {
        //rdgvFairmadanGelenIstekler.DataSource = spFirmaIDdenIstekleriDon(FirmaId);
        //rdgvFairmadanGelenIstekler.DataBind();
        using (Service1Client client = new Service1Client())
        {
            rdgvFairmadanGelenIstekler.DataSource = client.FirmaIddenFirmayaAitIstekleriDon(FirmaId);
            rdgvFairmadanGelenIstekler.DataBind();
        }
    }
     */
    protected void GridBagla(int FirmaId,int Yil, int IstekNo)
    {
        using (Service1Client client = new Service1Client())
        {
            //if (txtFilterYil.Text.Trim() == string.Empty && txtFilterIstekNo.Text.Trim() == string.Empty)//Tüm istekler
            //    rdgvFairmadanGelenIstekler.DataSource = client.FirmaIddenFirmayaAitIstekleriDon(FirmaId);
            //if (txtFilterYil.Text.Trim() != string.Empty && txtFilterIstekNo.Text.Trim() == string.Empty)//Belli bir yıl
            //    rdgvFairmadanGelenIstekler.DataSource = client.FirmaIDdenFirmadanGelenIstekleriDonGenel(FirmaId,int.Parse(txtFilterYil.Text),0);
            //if (txtFilterYil.Text.Trim() != string.Empty && txtFilterIstekNo.Text.Trim() == string.Empty)//Belli bir yıl ve belli bir istekno
            //    rdgvFairmadanGelenIstekler.DataSource = client.FirmaIDdenFirmadanGelenIstekleriDonGenel(FirmaId, int.Parse(txtFilterYil.Text), int.Parse(txtFilterIstekNo.Text));

            //int Yil = 0;
            //int IstekNo = 0;
            if (txtFilterYil.Text.Trim() != string.Empty)
            {
                Yil = int.Parse(txtFilterYil.Text.Trim());
            }
            else
            {
                Yil = 0;
            }
            if (txtFilterIstekNo.Text.Trim() != string.Empty)
            {
                IstekNo = int.Parse(txtFilterIstekNo.Text.Trim());
            }
            else
            {
                IstekNo = 0;
            }
            int FirmID = int.Parse(Session["IstekleriGosterilecekFirmaId"].ToString());
            rdgvFairmadanGelenIstekler.DataSource = client.FirmaIDdenFirmadanGelenIstekleriDonGenel(FirmID, Yil,IstekNo);

            rdgvFairmadanGelenIstekler.DataBind();
        }
    }
开发者ID:inancakcan,项目名称:kalibrasyon,代码行数:47,代码来源:FirmadanGelenIstekler.ascx.cs

示例6: Login

        public ActionResult Login(Login_Data LD)
        {
            if (ModelState.IsValid)
            {

                Service1Client client = new Service1Client();
                LoginData auth = new LoginData();
                auth.Email = LD.Email;
                auth.Password = LD.Password;
                if (client.AuthenticateUser(auth))
                {
                    Session["Email"] = LD.Email;
                    return index();
                }
                else
                {
                    string error_message = "Wrong Email or Password";
                    ViewBag.LoginError = error_message;
                    return View();
                }

            }
            else
            {
                return View();
            }
        }
开发者ID:NimerA,项目名称:VacationProject,代码行数:27,代码来源:HomeController.cs

示例7: RadComboBoxFirma_ItemsRequested

    protected void RadComboBoxFirma_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        if (e.Text.Length > 3)
        {
            using (Service1Client client = new Service1Client())
            {
                intBolgeKodu = client.BolgeKoduDon(Context.User.Identity.Name);
            }
            string BolgeKodu = intBolgeKodu.ToString();
            string sqlSelectCommand = "";
            sqlSelectCommand = "SELECT [FIRMAID],[MUSTNO], [FIRMAADI], [IL_ILCE] from [firma] WHERE [FIRMAADI] LIKE '%'+ @text + '%' and SILINDI=0 and BOLGEKODU=" + BolgeKodu + " ORDER BY [FIRMAADI]";
            SqlDataAdapter adapter = new SqlDataAdapter(sqlSelectCommand, ConfigurationManager.ConnectionStrings["KalData"].ConnectionString);
            adapter.SelectCommand.Parameters.AddWithValue("@text", e.Text);
            DataTable dataTable = new DataTable();
            adapter.Fill(dataTable);

            RadComboBoxFirma.Items.Clear();
            foreach (DataRow dataRow in dataTable.Rows)
            {
                string IlIlce = "";
                RadComboBoxItem item = new RadComboBoxItem();
                item.Text = (string)dataRow["MUSTNO"].ToString();
                item.Value = dataRow["FIRMAID"].ToString();
                string FirmaAdi = (string)dataRow["FIRMAADI"];
                if (dataRow["IL_ILCE"] != System.DBNull.Value)
                    {
                        IlIlce = (string)dataRow["IL_ILCE"];
                    }
                item.Attributes.Add("FIRMAADI", FirmaAdi);
                item.Attributes.Add("IL_ILCE", IlIlce);
                RadComboBoxFirma.Items.Add(item);
                item.DataBind();
            }
        }
    }
开发者ID:inancakcan,项目名称:kalibrasyon,代码行数:35,代码来源:YapilanProtokollerGetAll.ascx.cs

示例8: SaveButton_Click

 private void SaveButton_Click(object sender, EventArgs e)
 {
     List<Car> a = new List<Car>();
     Car b = new Car();
     Service1Client client = new Service1Client();
     bool success = true;
     for(int i=0; i<Table1.RowCount-1; i++)
     {
         try
         {
             b.manufacturer = (string)Table1.Rows[i].Cells[0].Value;
             b.model = (string)Table1.Rows[i].Cells[1].Value;
             b.dat = DateTime.Parse((string)Table1.Rows[i].Cells[2].Value);
             string str = (string)Table1.Rows[i].Cells[3].Value;
             str = str.Replace('.', ',');
             b.volume = double.Parse(str);
             b.power = Int32.Parse((string)Table1.Rows[i].Cells[4].Value);
             b.trancemission = (string)Table1.Rows[i].Cells[5].Value;
             a.Add(b);
             b = new Car();
         }
         catch (Exception ex) { MessageBox.Show(ex.Message+" в строке "+ (i+1)); success = false; }
     }
     if (success)
         if (client.save(a.ToArray()))
             MessageBox.Show("сохранение успешно");
         else MessageBox.Show("что то пошло не так");
     else MessageBox.Show("сохранение работает только если нет ошибок в таблице");
 }
开发者ID:Mitsuder,项目名称:CarShop,代码行数:29,代码来源:Form1.cs

示例9: CreateTutoringTimeBtn_Click

        protected void CreateTutoringTimeBtn_Click(object sender, EventArgs e)
        {
            DateTime date = Calendar.SelectedDate.Date;
            string time = TimesCB.SelectedValue.ToString();
            int teacherId = securityHelper.Id;

            Service1Client client = new Service1Client();
            TutoringTime existingTt = client.GetExactTutoringTime(date, time, teacherId);
            if (existingTt == null)
            {
                int i = client.CreateTutoringTime(date, time, teacherId);

                if (i == 1)
                {
                    Response.Write("<script>alert('Tutoring time successufully created')</script>");
                }
                else
                {
                    Response.Write("<script>alert('Something went wrong. Please try again.')</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('There is a tutoring time already created with the specified date and time')</script>");
            }
        }
开发者ID:cosmin71,项目名称:Online-Homework-Platform,代码行数:26,代码来源:CreateTutoringTime.aspx.cs

示例10: Main

        static void Main(string[] args)
        {
            //wcf

            IUtilsService iu = new UtilsServiceClient();
            iu.DoWork("a");

            IService1 i1 = new Service1Client();
            i1.DoWork();
            //ITestSrvice

            //CommonHelper.DES des = new CommonHelper.DES();
            //string key = des.GenerateKey();
            //string s0 = "中国软件 - csdn.net";
            //string s1 = des.EncryptString(s0, key);

            //string key1 = des.GenerateKey();

            //string s2 = des.DecryptString(s1, key);

            //var result= System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("12345678", "MD5");

            //var ss = result == "25d55ad283aa400af464c76d713c07ad".ToUpper();

            //ThreadPool.QueueUserWorkItem(new WaitCallback(o => { Write(); }));

            //ThreadPool.QueueUserWorkItem(new WaitCallback(o => { Read(); }));

            //IUtilsService svic = new UtilsServiceClient();
            //svic.DoWork("cipher_by_randy");
            var sss = "qerqwerwqr".GetHashCode();
            var sss1 = "qerqwerwqr".GetHashCode();
            var q1 = "1".GetHashCode();
            Console.ReadLine();
        }
开发者ID:RandyCode,项目名称:MyFramework,代码行数:35,代码来源:Program.cs

示例11: Eventos

        public ActionResult Eventos(EventosModel calendario)
        {
            if (Session["User"] != null)
            {
                if (ModelState.IsValid)
                {
                    Service1Client client = new Service1Client();
                    client.addTipo_dia(calendario.descripcion);
                    List<string> fecha = splitCadenaID(calendario.Fecha);
                    calendario.Tipo_dia_id = client.getultimoid_tipodia();
                    int talento = int.Parse(Session["Talento_Humano"].ToString());

                    foreach (var item in fecha)
                    {
                        string fechas = getFecha(item);
                        client.addCalendario(talento,fechas, calendario.Tipo_dia_id);

                    }
                   client.Close();
                }
                return View();
            }
            else
            {
                return RedirectToAction("Login", "Home");
            }
        }
开发者ID:DannyelPerez,项目名称:ASKI-SISTEMA_VACACIONES,代码行数:27,代码来源:EventosController.cs

示例12: Button1_Click

        protected void Button1_Click(object sender, EventArgs e)
        {
            Service1Client ip = new Service1Client();
            int t1 = 0;
            string name = null;
            string t = TextBox1.Text;         //Stores the input string

            if (t.Trim() == "" || t.Trim() == "." || t.Trim() == "-")
            {

                RegisterStartupScript("startupScript", "<script language=JavaScript>alert('Please enter a valid ZipCode or Address');</script>");

            }
            else
            {
                string d = String.Join("", ip.GetData(name,t,t1));
                if (string.IsNullOrEmpty(d))     //If no store available
                {
                    Label4.Text = "No station available";
                    //ViewState["Acc"] = 1;
                }
                else
                {
                    Label4.Text = d;
                   // ViewState["Acc"] = 1;
                }
            }
        }
开发者ID:agupt103,项目名称:Tour-guide-application,代码行数:28,代码来源:BusForm.aspx.cs

示例13: Button2_Click

        protected void Button2_Click(object sender, EventArgs e)
        {
            int t3 = 1;

            if (Label4.Text==null)
            {
                RegisterStartupScript("startupScript", "<script language=JavaScript>alert('Please find the Bus stations first....');</script>");
            }
            Service1Client ip1 = new Service1Client();
            string t1 = TextBox1.Text;
            string t2 = TextBox2.Text;         //Stores the input string
            string d=null;
            if (t2.Trim() == "" || t2.Trim() == "." || t2.Trim() == "-")
            {
                RegisterStartupScript("startupScript", "<script language=JavaScript>alert('Please enter a valid name from the list');</script>");
            }
            else
            {
                 d = String.Join("", ip1.GetData(t2,t1,t3));
            }
            if (string.IsNullOrEmpty(d))     //If no store available
            {
                Label6.Text = "No station available";

            }
            else
            {
                Label6.Text = d;

            }
        }
开发者ID:agupt103,项目名称:Tour-guide-application,代码行数:31,代码来源:BusForm.aspx.cs

示例14: invoke_Click

 protected void invoke_Click(object sender, EventArgs e)
 {
     Service1Client s = new Service1Client();
     int send = Convert.ToInt32(tb1.Text.ToString());
     double ans = s.taxCalculator(send);
     tb2.Text = ans.ToString();
 }
开发者ID:sreeshprakash,项目名称:Web_Services,代码行数:7,代码来源:Tax.aspx.cs

示例15: JSonEvento

        public ActionResult JSonEvento()
        {
            string json = "";
            Service1Client client = new Service1Client();
            var query = client.get_eventos();

            if (query == null)
            {
                json += "{" + String.Format("\"descripcion\":\"{0}\",\"fecha\":\"{1}\"", "0", "Null") + "}";
                json = "{\"draw\": 1,\"recordsTotal\": 1,\"recordsFiltered\": 1,\"data\": [" + json + "]}";
                return Content(json);
            }
            for (int i = 0; i < query.Count(); i++)
            {
                var f = client.get_fecha_eventos(query.ElementAt(i));
                List<string> fechas = new List<string>();
                foreach (var item in f) {
                    fechas.Add(item);
                }
                string cadenaf = concatenar_fechas(fechas);
                if (!json.Equals("")) { json += ","; }
                json += "{" + String.Format("\"descripcion\":\"{0}\",\"fecha\":\"{1}\"", query.ElementAt(i), cadenaf) + "}";
            }

            json = "{\"draw\": 1,\"recordsTotal\": 1,\"recordsFiltered\": 1,\"data\": [" + json + "]}";
            return Content(json);
        }
开发者ID:DannyelPerez,项目名称:ASKI-SISTEMA_VACACIONES,代码行数:27,代码来源:EventosController.cs


注:本文中的Service1Client类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。