本文整理汇总了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());
}
}
示例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());
}
}
示例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);
}
示例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");
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
}
示例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("сохранение работает только если нет ошибок в таблице");
}
示例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>");
}
}
示例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();
}
示例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");
}
}
示例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;
}
}
}
示例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;
}
}
示例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();
}
示例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);
}