Beispiel #1
0
        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();
     }
 }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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]);
     }
 }
Beispiel #12
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));
     }
 }
Beispiel #13
0
 public string[] GetTracedFields(string tableName)
 {
     using (CommonServiceClient client = SoapClientFactory.CreateCommonServiceClient())
     {
         byte[]   loginTicket = WebServiceSecurity.EncryptLoginer(Loginer.CurrentUser);
         string[] arr         = client.GetTracedFields(loginTicket, tableName);
         return(arr);
     }
 }
Beispiel #14
0
 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));
     }
 }
Beispiel #15
0
 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]);
     }
 }
Beispiel #18
0
        public VisitRequestWindow(PatientDto patient)
        {
            InitializeComponent();

            _service = new CommonServiceClient();
            _patient = patient;

            InitializeDoctors();

            DoctorsComboBox.ItemsSource = _doctors;
        }
Beispiel #19
0
        public DoctorRegisterWindow()
        {
            InitializeComponent();

            _commonService       = new CommonServiceClient();
            _registrationService = new RegistrationServiceClient();

            InitializeSpecializations();

            SpecializationsComboBox.ItemsSource = _specializations;
        }
Beispiel #20
0
        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);
            }
        }
Beispiel #21
0
 public static CompanyInfo GetCompanyInfo()
 {
     try
     {
         CommonServiceClient service = new CommonServiceClient();
         return(service.GetCompanyInfo());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #22
0
 public static List <VendorInfo> GetVendorInfo(string vendorName)
 {
     try
     {
         CommonServiceClient service = new CommonServiceClient();
         return(service.GetVendorInfo(vendorName).ToList());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #23
0
 public static List <UnitOfMeasureInfo> GetUnitOfMeasure()
 {
     try
     {
         CommonServiceClient service = new CommonServiceClient();
         return(service.GetUnitOfMeasure().ToList());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #24
0
 /// <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);
     }
 }
Beispiel #25
0
        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();
            }
        }
Beispiel #26
0
 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
     {
         //分级下载代码
     }
 }
Beispiel #27
0
 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);
         }
     }
 }
Beispiel #28
0
        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);
        }
Beispiel #29
0
        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]);
        }
Beispiel #30
0
        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);
                }
            }
        }
Beispiel #31
0
 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);
 }