static void Main(string[] args) { CommonServiceClient client = new CommonServiceClient(); // Utilisez la variable « client » pour appeler des opérations sur le service. Console.WriteLine("Calling The Service ..."); client.Login("Admin", "Admin"); // Fermez toujours le client. /*Guid tmp = Guid.NewGuid(); * TransferInfo lInfo = client.GetTransferInformation(tmp, 34); * if (null != lInfo) * { * Console.WriteLine("FTP server IP: " + lInfo.FtpServerIP); * Console.WriteLine("FTP server Port: " + lInfo.FtpPortNumber); * Console.WriteLine("FTP username: "******"FTP password: "******"FTP folder Id: " + lInfo.FolderId); * }*/ client.Close(); while (true) { ; } }
public static IList <Users> GetUsers() { using (CommonServiceClient comServiceClient = new CommonServiceClient()) { return(comServiceClient.GetUsers()); } }
public void SyncServerTime() { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { client.SyncServerTime(); } }
private static readonly CookieManagerBehavior _cookieBehavior = new CookieManagerBehavior(); //All ChemWatch service clients must share this public static CswNbtChemWatchRequest Initialize(ICswResources CswResources, CswNbtChemWatchRequest Request) { CswNbtChemWatchRequest Return = new CswNbtChemWatchRequest(); CswNbtResources NbtResources = (CswNbtResources)CswResources; CswNbtObjClassChemical ChemicalNode = NbtResources.Nodes[Request.NbtMaterialId]; Return.Supplier = ChemicalNode.Supplier.CachedNodeName; Return.PartNo = ChemicalNode.PartNumber.Text; Return.MaterialName = ChemicalNode.TradeName.Text; Return.NbtMaterialId = ChemicalNode.NodeId; string errorMsg; if (_authenticate(NbtResources, out errorMsg)) { CommonServiceClient cwCommonClient = new CommonServiceClient(); cwCommonClient.Endpoint.Behaviors.Add(_cookieBehavior); // Populate Language list List <ChemWatchMultiSlctListItem> Languages = new List <ChemWatchMultiSlctListItem>(); Languages cwLanguages = cwCommonClient.GetLanguages(); foreach (Language cwLanguage in cwLanguages) { if (cwLanguage.UILanguage) { Languages.Add(new ChemWatchMultiSlctListItem() { Name = cwLanguage.Name, Id = CswConvert.ToString(cwLanguage.Id) }); } } IEnumerable <ChemWatchMultiSlctListItem> SortedLanguages = Languages.OrderBy(si => si.Name); Return.Languages.options = SortedLanguages.ToList(); // Populate Country list List <ChemWatchMultiSlctListItem> Countries = new List <ChemWatchMultiSlctListItem>(); Countries cwCountries = cwCommonClient.GetCountries(); foreach (Country cwCountry in cwCountries) { Countries.Add(new ChemWatchMultiSlctListItem() { Name = cwCountry.Name, Id = CswConvert.ToString(cwCountry.Id) }); } IEnumerable <ChemWatchMultiSlctListItem> SortedCountries = Countries.OrderBy(si => si.Name); Return.Countries.options = SortedCountries.ToList(); // Attempt to populate the Suppliers list _getMatchingSuppliers(Return.Supplier, Return); } else { throw new CswDniException(CswEnumErrorType.Error, "There was a problem authenticating with ChemWatch", errorMsg); } return(Return); }
public JsonResult GetAccess(LogInViewModel model) { List <Company> credentials = CommonServiceClient.GetSecurityContract().FindCredentials(model.NickName, model.Password); var credential = new List <dynamic>(); foreach (Company company in credentials) { List <dynamic> branches = new List <dynamic>(); foreach (Branch branch in company.Branches) { List <SaleLocal> points = O7POSServiceClient.PointSaleContract.FindLocals(company.Id, branch.Id); var pointSales = new List <dynamic>(); foreach (SaleLocal locales in points) { pointSales.Add(new { locales.Id, locales.Name, locales.Address }); } dynamic bran = new { branch.Id, branch.Description, PointSales = pointSales.ToArray() }; branches.Add(bran); } dynamic comp = new { company.Id, company.Description, Branches = branches.ToArray() }; credential.Add(comp); } return(Json(credential.ToArray(), JsonRequestBehavior.AllowGet)); }
public static Int32 InserTest(Users user) { using (CommonServiceClient comServiceClient = new CommonServiceClient()) { return(comServiceClient.InserTest(user)); } }
public bool RestoreDatabase(string BKFILE, string DBNAME) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); return(client.RestoreDatabase(BKFILE, DBNAME)); } }
public bool BackupDatabase(string DBNAME, string BKPATH) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); return(client.BackupDatabase(DBNAME, BKPATH)); } }
public string GetDataSN(string dataCode, bool asHeader) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); return(client.GetDataSN(loginTicket, dataCode, asHeader)); } }
public DataTable GetBackupHistory(int topList) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); byte[] bs = client.GetBackupHistory(loginTicket, topList); return(ZipTools.DecompressionDataSet(bs).Tables[0]); } }
public System.Data.DataTable GetData(string docID) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); byte[] receivedData = client.GetAttachedFiles(loginTicket, docID); return(ZipTools.DecompressionDataSet(receivedData).Tables[0]); } }
public DataSet SearchLog(string logUser, string tableName, DateTime dateFrom, DateTime dateTo) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); byte[] receivedData = client.SearchLog(loginTicket, logUser, tableName, dateFrom, dateTo); return(ZipTools.DecompressionDataSet(receivedData)); } }
public string[] GetTracedFields(string tableName) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); string[] arr = client.GetTracedFields(loginTicket, tableName); return(arr); } }
public bool SaveFieldDef(DataTable data) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); byte[] bsData = ZipTools.CompressionDataSet(dalBase.TableToDataSet(data)); return(client.SaveFieldDef(loginTicket, bsData)); } }
public DataTable GetLogFieldDef(string tableName) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); byte[] receivedData = client.GetLogFieldDef(loginTicket, tableName); return(ZipTools.DecompressionDataSet(receivedData).Tables[0]); } }
public System.Data.DataTable GetSystemDataSet() { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] validationTicket = WebServiceSecurity.GetLoginTicket(); byte[] receivedData = client.GetSystemDataSet(validationTicket); return(ZipTools.DecompressionDataSet(receivedData).Tables[0]); } }
public DataTable SearchOutstanding(string invoiceNo, string customer, DateTime dateFrom, DateTime dateTo, DateTime dateEnd, string outstandingType) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); byte[] bs = client.SearchOutstanding(loginTicket, invoiceNo, customer, dateFrom, dateTo, dateEnd, outstandingType); return(ZipTools.DecompressionDataSet(bs).Tables[0]); } }
public VisitRequestWindow(PatientDto patient) { InitializeComponent(); _service = new CommonServiceClient(); _patient = patient; InitializeDoctors(); DoctorsComboBox.ItemsSource = _doctors; }
public DoctorRegisterWindow() { InitializeComponent(); _commonService = new CommonServiceClient(); _registrationService = new RegistrationServiceClient(); InitializeSpecializations(); SpecializationsComboBox.ItemsSource = _specializations; }
public void WriteLog(string logID, DataTable originalData, DataTable changes, string tableName, string keyFieldName, bool isMaster) { using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient()) { byte[] loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser); byte[] bsOriginal = ZipTools.CompressionDataSet(dalBase.TableToDataSet(originalData)); byte[] bsChanges = ZipTools.CompressionDataSet(dalBase.TableToDataSet(changes)); client.WriteLog(loginTicket, logID, bsOriginal, bsChanges, tableName, keyFieldName, isMaster); } }
public static CompanyInfo GetCompanyInfo() { try { CommonServiceClient service = new CommonServiceClient(); return(service.GetCompanyInfo()); } catch (Exception ex) { throw ex; } }
public static List <VendorInfo> GetVendorInfo(string vendorName) { try { CommonServiceClient service = new CommonServiceClient(); return(service.GetVendorInfo(vendorName).ToList()); } catch (Exception ex) { throw ex; } }
public static List <UnitOfMeasureInfo> GetUnitOfMeasure() { try { CommonServiceClient service = new CommonServiceClient(); return(service.GetUnitOfMeasure().ToList()); } catch (Exception ex) { throw ex; } }
/// <summary> /// 测试WebService连接 /// </summary> /// <returns></returns> private static bool TestWebServiceConnection() { try { CommonServiceClient commonService = SoapClientFactory.CreateCommonServiceClient(); byte[] validationTicket = WebServiceSecurity.GetLoginTicket(); return(commonService.TestConnection(validationTicket)); } catch (Exception ex) { Msg.ShowException(ex); return(false); } }
private void SaveTJDefaultSetting() { frmTJSBSettings _fm = new frmTJSBSettings(this.TJSB_Setting); if (_fm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.TJSB_Setting = _fm.CurrentSet(); using (CommonServiceClient _csc = new CommonServiceClient()) { _csc.SaveTJSBSettings(this.TJSB_Setting); } LoadData(); } }
private static void LoadCode(ref RefCodeTable _rtable) { if (_rtable.Properties.LevelDownloadMode == 1) { //一次性下载全部代码 using (CommonServiceClient _csc = new CommonServiceClient()) { _rtable.CodeData = _csc.GetFullRefCodeData(_rtable.Name).ToList <RefCodeData>(); } } else { //分级下载代码 } }
public static List <RefCodeData> GetLevelDownChildRecords(RefCodeTable _rct, string _fatherCode) { if (_rct.LevelCodeData.ContainsKey(_fatherCode)) { return(_rct.LevelCodeData[_fatherCode]); } else { using (CommonServiceClient _csc = new CommonServiceClient()) { List <RefCodeData> _getChildData = _csc.GetChildRefCodeData(_rct.Name, _fatherCode).ToList <RefCodeData>(); _rct.LevelCodeData.Add(_fatherCode, _getChildData); return(_getChildData); } } }
private void LoadData() { int _year = int.Parse(this.TE_YEAR.Text); this.schedulerControl1.LimitInterval.Start = new DateTime(_year, 1, 1); this.schedulerControl1.LimitInterval.End = new DateTime(_year, 12, 31); this.schedulerControl1.Start = new DateTime(_year, 1, 1); this.schedulerControl1.SelectedInterval.Start = new DateTime(_year, 1, 1); using (CommonServiceClient _csc = new CommonServiceClient()) { DateList = _csc.GetDataInfo(_year).ToList <WC_DataInfo>(); TJSB_Setting = _csc.GetTJSBSettings(); } DrawDates(_year); }
public static RefCodeTable GetRefTable(string _tanme) { if (_tanme == "") { return(null); } if (!_refTableCache.RefTables.ContainsKey(_tanme)) { //加载代码表 RefCodeTable _rtable = new RefCodeTable(); using (CommonServiceClient _csc = new CommonServiceClient()) { _rtable.Properties = _csc.GetRefCodePropertie(_tanme); } _refTableCache.RefTables.Add(_tanme, _rtable); } return(_refTableCache.RefTables[_tanme]); }
private void SaveSetting() { if (this.te_RQ.EditValue == null) { return; } string _dt = this.te_RQ.EditValue.ToString(); WC_DataInfo _info = new WC_DataInfo(); _info.GZ_Date = new DateTime(int.Parse(_dt.Substring(0, 4)), int.Parse(_dt.Substring(5, 2)), int.Parse(_dt.Substring(8, 2))); _info.Year = _info.GZ_Date.Year; _info.Month = _info.GZ_Date.Month; _info.Day = _info.GZ_Date.Day; _info.IsWorkDay = this.te_IsWorkDay.Checked; _info.IsTJSBR = this.te_IsTJSBR.Checked; _info.IsFXSBR = this.te_IsFXSBR.Checked; _info.Meta = (this.te_Des.EditValue == null) ? "" : this.te_Des.EditValue.ToString(); using (CommonServiceClient _csc = new CommonServiceClient()) { if (_csc.SaveDataInfo(_info)) { var find = from _c in DateList where _c.GZ_Date == _info.GZ_Date select _c; if (find == null || find.Count() < 1) { this.DateList.Add(_info); } else { WC_DataInfo _wc = find.First(); _wc.IsWorkDay = _info.IsWorkDay; _wc.IsFXSBR = _info.IsFXSBR; _wc.IsTJSBR = _info.IsTJSBR; _wc.Meta = _info.Meta; } int _year = int.Parse(this.TE_YEAR.Text); DrawDates(_year); } } }
public City GetCity(int cityId) { var svc = new CommonServiceClient(); return svc.GetCity(cityId); }
public VendorInfo GetVendorInfo(string vendor) { var svc = new CommonServiceClient(); return svc.GetVendor(vendor); }
public VendorInfo[] GetVendorList(int cityId) { var svc = new CommonServiceClient(); return svc.GetVendorsFromCity(cityId); }