111,126
社区成员
发帖
与我相关
我的任务
分享
[DataContract(Name = "LinkItem_Contract", Namespace = "http://schemas.thatindigogirl.com/samples/2006/06")]
public class LinkItem
{
private long m_id;
private string m_title;
private string m_description;
private DateTime m_dateStart;
private DateTime m_dateEnd;
private string m_url;
[DataMember(Name = "Id_Contract", IsRequired = false, Order = 0)]
public long Id
{
get { return m_id; }
set { m_id = value; }
}
[DataMember(Name = "Title_Contract", IsRequired = true, Order = 1)]
public string Title
{
get { return m_title; }
set { m_title = value; }
}
}
///调用
LinkItem_Contract item = new LinkItem_Contract();
item.Id_Contract = int.Parse(this.txtId.Text);
item.Title_Contract = this.txtTitle.Text;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GigEntry.localhost;
namespace GigEntry
{
public partial class GigInfoForm : Form
{
public GigInfoForm()
{
InitializeComponent();
}
localhost.GigManagerServiceContractClient m_proxy = new GigEntry.localhost.GigManagerServiceContractClient();
private void cmdSave_Click(object sender, EventArgs e)
{
LinkItem_Contract item = new LinkItem_Contract();
item.Id_Contract = int.Parse(this.txtId.Text);
item.Title_Contract = this.txtTitle.Text;
item.Description_Contract = this.txtDescription.Text;
item.DateStart_Contract = this.dtpStart.Value;
item.DateEnd_Contract = this.dtpEnd.Value;
item.Url_Contract = this.txtUrl.Text;
m_proxy.SaveGig(item);
}
}}
<?xml version="1.0" encoding="utf-8"?>
<ServiceReference>
<ProxyGenerationParameters
ServiceReferenceUri="http://localhost:8000/"
Name="localhost"
NotifyPropertyChange="True"
UseObservableCollection="False">
</ProxyGenerationParameters>
<EndPoints>
<EndPoint
Address="net.tcp://localhost:9000/GigManagerService"
BindingConfiguration="NetTcpBinding_GigManagerServiceContract"
Contract="GigEntry.localhost.GigManagerServiceContract"
>
</EndPoint>
</EndPoints>
</ServiceReference>