本文整理汇总了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");
}
示例2: button2_Click
private void button2_Click(object sender, EventArgs e)
{
var sc = new Service1Client();
sc.TestMethod("abc");
MessageBox.Show("没有返回值!");
sc.Close();
}
示例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();
}
示例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");
}
}
示例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");
}
示例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();
}
示例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();
}
示例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;
}
示例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");
}
示例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");
}
示例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();
}
示例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);
}
}
示例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;
}
示例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");
}
示例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());
}
}