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


C# Service1Client.Close方法代码示例

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


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

示例1: Edit

        public ActionResult Edit(UsuariosModel model, string submitButton)
        {
            if (Session["User"] != null)
            {
                Service1Client client = new Service1Client();
                if (submitButton.Equals("Buscar"))
                {
                    var hola = client.getUsuario(model.talento_humano);
                    UsuariosModel usuario = new UsuariosModel();
                    if (hola == null)
                    {
                        client.Close();
                        return View();
                    }
                    ViewBag.email = hola.email;
                    ViewBag.talentoHumano = hola.talento_humano;
                    ViewBag.primerNombre = hola.primer_nombre;
                    ViewBag.segundoNombre = hola.segundo_nombre;
                    ViewBag.primerApellido = hola.primer_apellido;
                    ViewBag.segundoApellido = hola.segundo_apellido;
                    ViewBag.fechaIngreso = hola.fecha_creacion;
                    ViewBag.fecha_ingreso = hola.fecha_ingreso;
                }
                else if (submitButton.Equals("Modificar"))
                {
                    if (ModelState.IsValid)
                    {

                        client.editUsuario(model.talento_humano, model.email, model.primer_nombre, model.segundo_nombre, model.primer_apellido, model.segundo_apellido, model.fecha_ingreso);
                        client.deleteRoles_Usuarios(model.talento_humano);
                        client.deleteDepartamento_Usuarios(model.talento_humano);
                        var seleccionados = client.getIdsRoles_Usuario(model.talento_humano);
                        List<int> idDepartamentos = splitCadenaID(model.departamentosID);
                        foreach (var item in idDepartamentos)
                        {
                            client.addUsuario_Departamento(model.talento_humano, item);
                        }

                        List<int> idRoles = splitCadenaID(model.rolesID);
                        foreach (var item in idRoles)
                        {
                            client.addUsuario_Rol(model.talento_humano, item);
                        }
                    }

                }
                client.Close();
                return View();

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

示例2: button2_Click

 private void button2_Click(object sender, EventArgs e)
 {
     var sc = new Service1Client();
     sc.TestMethod("abc");
     MessageBox.Show("没有返回值!");
     sc.Close();
 }
开发者ID:zhang5171291,项目名称:TestCode,代码行数:7,代码来源:Form1.cs

示例3: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     var sc = new Service1Client();
     var msg = sc.GetData(10);
     MessageBox.Show(msg);
     sc.Close();
 }
开发者ID:zhang5171291,项目名称:TestCode,代码行数:7,代码来源:Form1.cs

示例4: 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

示例5: 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

示例6: Window_Loaded

 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     Service1Client sc = new Service1Client();
     string message = sc.GetData(5000);
     lblMessage.Content = message;
     sc.Close();
 }
开发者ID:vramsngrai1994,项目名称:mkpacific-ltd,代码行数:7,代码来源:MainWindow.xaml.cs

示例7: Window_Loaded

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            int x = 12345;

            //ServiceHost sh = new ServiceHost(typeof(Service1Client));
            Service1Client sc = new Service1Client();
            string message = sc.GetData(x);
            lblMessage.Content = message;
            sc.Close();
        }
开发者ID:vramsngrai1994,项目名称:mkpacific-ltd,代码行数:10,代码来源:MainWindow.xaml.cs

示例8: Summary

 public static DataSet Summary(string k)
 {
     Binding bind;
     EndpointAddress remoteAddress;
     BE(url, out bind, out remoteAddress);
     var r = new R();
     var c = new Service1Client(bind, remoteAddress);
     var r1 = c.Summary(k);
     c.Close();
     return r1;
 }
开发者ID:cvs1989,项目名称:hooyeswidget,代码行数:11,代码来源:I.cs

示例9: Edit

 public ActionResult Edit(PermisosModel model)
 {
     if (Session["User"] != null)
     {
         Service1Client client = new Service1Client();
         client.editPermisos(model.id, model.descripcion, model.activo);
         client.Close();
         return View();
     }
     else
         return RedirectToAction("Login");
 }
开发者ID:josselynmedina,项目名称:ASKI-VACACIONES,代码行数:12,代码来源:PermisosController.cs

示例10: Login

 public RedirectToRouteResult Login(string email, string password)
 {
     Service1Client test = new Service1Client();
     Usuario user = test.LogInUsuario("[email protected]", "password");
     test.Close();
     if (user != null)
     {
         Session["Secion"] = user;
         return RedirectToAction("Index", "LoginTest");
     }
     else
         return RedirectToAction("Index");
 }
开发者ID:sullymancia,项目名称:ProgramacionIV,代码行数:13,代码来源:TestForServiceController.cs

示例11: Main

 static void Main(string[] args)
 {
     Service1Client client = new Service1Client();
     Console.WriteLine(client.GetData(10));
     Console.ReadLine();
     CompositeType ct = new CompositeType();
     ct.BoolValue = true;
     ct.StringValue = "Karen ";
     ct=client.GetDataUsingDataContract(ct);
     Console.WriteLine(ct.StringValue);
     Console.ReadLine();
     client.Close();
 }
开发者ID:Tonoyankar,项目名称:WCFServices,代码行数:13,代码来源:Program.cs

示例12: Main

 static void Main(string[] args)
 {
     try
     {
         Service1Client srv = new Service1Client();
         var contact = srv.GetDataUsingDataContract(new CompositeType() { BoolValue = true, StringValue = "xxx" });
         Console.WriteLine(contact.StringValue);
         srv.Close();
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
 }
开发者ID:AtwooTM,项目名称:opencover,代码行数:14,代码来源:Program.cs

示例13: S

 public static R S(M1 m,string k)
 {
     Binding bind;
     EndpointAddress remoteAddress;
     BE(url, out bind, out remoteAddress);
     var r = new R();
     var c = new Service1Client(bind, remoteAddress);
     var r1 = c.I(m, k);
     r.Code = r1.Code;
     r.Value = r1.Value;
     r.SN = r1.SN;
     r.Message = r1.Message;
     c.Close();
     return r;
 }
开发者ID:cvs1989,项目名称:hooyeswidget,代码行数:15,代码来源:I.cs

示例14: Cargar

 public ActionResult Cargar(PermisosModel model)
 {
     if (Session["User"] != null)
     {
         if (ModelState.IsValid)
         {
             Service1Client client = new Service1Client();
             var dic = client.getPermiso(model.id);
             client.Close();
             return View(dic);
         }
         return View();
     }
     else
         return RedirectToAction("Login", "Home");
 }
开发者ID:DannyelPerez,项目名称:ASKI-SISTEMA_VACACIONES,代码行数:16,代码来源:PermisosController.cs

示例15: Form2_Load

        private void Form2_Load(object sender, EventArgs e)
        {
            try
            {
                Service1Client client = new Service1Client();
                var result = client.GetAllAcounts();

                comboBoxWyborKonta.DataSource = result;

                client.Close();
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
开发者ID:MikE87,项目名称:homebanking,代码行数:16,代码来源:Form2.cs


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