Exemplo n.º 1
0
		private void Initialize ()
		{
			_serviceAgent = new ServiceAgent ();
			_serviceAgent.ServiceClient.ActivateVoucherCompleted += HandleActivateVoucher;
			
			_scrollView = new UIScrollView (new RectangleF (0, 0, this.Bounds.Width, this.Bounds.Height));
			
			_scrollView.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions | UIViewAutoresizing.FlexibleMargins;
			
			
			_lblTitle = new UILabel (){
				AutoresizingMask = UIViewAutoresizing.FlexibleDimensions | UIViewAutoresizing.FlexibleMargins,
				TextColor = UIColor.White,
				BackgroundColor = UIColor.Clear,
				Font = fontTitle,
				Lines = 0,
				TextAlignment = UITextAlignment.Center 
			};
			
			_lblPoints = new UILabel (){
				AutoresizingMask = UIViewAutoresizing.FlexibleDimensions | UIViewAutoresizing.FlexibleMargins,
				TextColor = UIColor.White,
				BackgroundColor = UIColor.Clear,
				Font = fontMessage,
				Lines = 0,
			};
				
			_lblMessage = new UILabel (){
				AutoresizingMask = UIViewAutoresizing.FlexibleDimensions | UIViewAutoresizing.FlexibleMargins,
				TextColor = UIColor.White,
				BackgroundColor = UIColor.Clear,
				Font = fontMessage,
				Lines = 0,
			};
			
			_lblVoucher = new UILabel (){
				AutoresizingMask = UIViewAutoresizing.FlexibleDimensions | UIViewAutoresizing.FlexibleMargins,
				BackgroundColor = UIColor.Clear,
				TextColor = UIColor.White,
				TextAlignment = UITextAlignment.Center,
				Font = fontVoucher,
			};
			
			_btnActivate = new LBKButton (){
					Font = UIFont.BoldSystemFontOfSize (15),
			 };
			_btnActivate.SetTitle (Locale.GetText ("Aktivieren"), UIControlState.Normal);
			_btnActivate.TouchUpInside += delegate(object sender, System.EventArgs e){
				VoucherActivate (Voucher);
			};
			
		}
Exemplo n.º 2
0
 public TransparentStreamServer(ServiceAgent agent, System.IO.Stream baseStream, ObjectBusSession objectBusSession)
 {
     if (agent == null)
         throw new ArgumentNullException ("agent");
     if (baseStream == null)
         throw new ArgumentNullException ("baseStream");
     if (objectBusSession == null)
         throw new ArgumentNullException ("objectBusSession");
     this.streamID = Guid.NewGuid ();
     this.agent = agent;
     this.baseStream = baseStream;
     this.objectBusSession = objectBusSession;
 }
        /// <summary>
        /// Helper method to initiate the service call that retrieves all grammars available on the server.
        /// </summary>
        /// <param name="hawaiiAppId">Specifies the Hawaii Application Id.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate handler.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        public static void GetGrammarsAsync(
            string hawaiiAppId,
            ServiceAgent<SpeechServiceResult>.OnCompleteDelegate onComplete, 
            object stateObject = null)
        {
            if (string.IsNullOrEmpty(hawaiiAppId))
            {
                throw new ArgumentNullException("hawaiiAppId");
            }

            GetGrammarsAsync(
                new GuidAuthClientIdentity(hawaiiAppId), 
                onComplete,
                stateObject);
        }
Exemplo n.º 4
0
        private void Open3()
        {
            try
            {
                //base.Search();
                DataSet ds = ServiceAgent.ExecuteDataSet(true, "CONIS_IBS", "USP_MA_MA02_SELECT_03"
                                                         , txtCOMPANYCD.EditValue
                                                         );

                efwGridControl2.DataBind(ds);
                this.efwGridControl2.MyGridView.BestFitColumns();
            }
            catch (Exception ex)
            {
                MessageAgent.MessageShow(MessageType.Error, ex.ToString());
            }
        }
        /// <summary>
        /// Helper method to find a registration id for a name.
        /// </summary>
        /// <param name="hawaiiAppId">Specifies the Hawaii Application Id.</param>
        /// <param name="name">Specifies a group name.</param>
        /// <param name="onComplete">Specifiesa an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user defined object which will be provided in the call to the "on complete" calback.</param>
        public static void LookupNameAsync(
            string hawaiiAppId, 
            string name,
            ServiceAgent<NameRegistrationResult>.OnCompleteDelegate onComplete, 
            object stateObject = null)
        {
            if (string.IsNullOrEmpty(hawaiiAppId))
            {
                throw new ArgumentNullException("hawaiiAppId");
            }

            LookupNameAsync(
                new GuidAuthClientIdentity(hawaiiAppId), 
                name, 
                onComplete,
                stateObject);
        }
        /// <summary>
        /// Calls the PredictLocation service method
        /// </summary>
        /// <param name="hawaiiAppId">login to use</param>
        /// <param name="request">request parameter to the method</param>
        /// <param name="onComplete">on complete callback</param>
        /// <param name="stateObject">Optional correlation user state object</param>
        public static void PredictLocationAsync(
            string hawaiiAppId,
            PredictLocationRequest request,
            ServiceAgent<PredictLocationResult>.OnCompleteDelegate onComplete,
            object stateObject)
        {
            if (string.IsNullOrEmpty(hawaiiAppId))
            {
                throw new ArgumentNullException("hawaiiAppId");
            }

            PredictLocationAsync(
                new GuidAuthClientIdentity(hawaiiAppId),
                request,
                onComplete,
                stateObject);
        }
Exemplo n.º 7
0
		void Initialize ()
		{
			Title = Locale.GetText ("Gutscheine");
			
			_serviceAgent = new ServiceAgent ();
			_serviceAgent.ServiceClient.ActivateVoucherCompleted += HandleActivateVoucherCompleted;
			/*
			RefreshRequested += delegate {
				Load ();
			};
			*/
			
			Style = UITableViewStyle.Plain;
			TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
			Autorotate = true;
			Load ();
		}
Exemplo n.º 8
0
        public async Task DoSave()
        {
            var employee = SelectedEmployee as Member;

            if (SelectedIndex == -1)
            {
                RaisePropertyChanged("Employee"); // Update the list from the data source
            }
            else
            {
                serviceAgent = new ServiceAgent();
            }

            Members = await serviceAgent.GetAll();

            SelectedEmployee = null;
        }
Exemplo n.º 9
0
        public override void Delete()
        {
            base.Delete();

            //부서정보 삭제
            if (txtCOMPANYCD.EditValue == null)
            {
                MessageAgent.MessageShow(MessageType.Warning, "회사코드가 없습니다!");
                return;
            }

            if (cmbBIZCD.EditValue == null)
            {
                MessageAgent.MessageShow(MessageType.Warning, "사업장코드가 없습니다!");
                return;
            }

            DialogResult drt = MessageAgent.MessageShow(MessageType.Confirm, "삭제 하시겠습니까?");

            if (drt == DialogResult.OK)
            {
                try
                {
                    int retVal = ServiceAgent.ExecuteNoneQuery(UserInfo.instance().UserId, "CONIS_IBS", "USP_MM_MM02_DELETE_01"
                                                               , UserInfo.instance().UserId
                                                               , this.txtCOMPANYCD.EditValue
                                                               , this.cmbBIZCD.EditValue
                                                               , this.txtDEPTCODE.EditValue
                                                               );

                    if (retVal > 0)
                    {
                        MessageAgent.MessageShow(MessageType.Informational, "삭제되었습니다.");
                        Open1();
                        this.treeView1.Nodes.Clear();
                        CreTree();
                        NewMode();
                    }
                }
                catch (Exception ex)
                {
                    MessageAgent.MessageShow(MessageType.Error, ex.ToString());
                }
            }
        }
Exemplo n.º 10
0
        private void Open1()
        {
            //회사정보조회
            picImg.Image = null;

            try
            {
                DataSet ds = ServiceAgent.ExecuteDataSet(true, "CONIS_IBS", "USP_MM_MM01_SELECT_01", txtCOMPANYCD.EditValue);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    txtCOMPANYCD.EditValue   = ds.Tables[0].Rows[0]["COMPANYCD"].ToString();
                    txtCOMPANYNAME.EditValue = ds.Tables[0].Rows[0]["COMPANYNAME"].ToString();
                    txtCOMPANYENG.EditValue  = ds.Tables[0].Rows[0]["COMPANYENG"].ToString();
                    txtZIPNO.EditValue       = ds.Tables[0].Rows[0]["ZIPNO"].ToString();
                    txtADDR.EditValue        = ds.Tables[0].Rows[0]["ADDR"].ToString();
                    txtTEL.EditValue         = ds.Tables[0].Rows[0]["TEL"].ToString();
                    txtFAX.EditValue         = ds.Tables[0].Rows[0]["FAX"].ToString();
                    txtURL.EditValue         = ds.Tables[0].Rows[0]["URL"].ToString();
                    txtMEMO.EditValue        = ds.Tables[0].Rows[0]["MEMO"].ToString();
                    txtREGISTERNO.EditValue  = ds.Tables[0].Rows[0]["REGISTERNO"].ToString();
                    txtPREGIDENT.EditValue   = ds.Tables[0].Rows[0]["PREGIDENT"].ToString();
                    txtWORKTYPE.EditValue    = ds.Tables[0].Rows[0]["WORKTYPE"].ToString();
                    txtWORKJONG.EditValue    = ds.Tables[0].Rows[0]["WORKJONG"].ToString();
                    lblFILE_GRP_ID.Text      = ds.Tables[0].Rows[0]["LOGO_FILE_NM"].ToString();
                    lblFILE_GRP_ID2.Text     = ds.Tables[0].Rows[0]["SAVE_LOGO_FILE_NM"].ToString();

                    picImg.DBKey = "YLEFW.TBL_COMPANY.SAVE_LOGO_FILE_NM";
                    //파일서버에서 이미지 가져오기
                    if (ds.Tables[0].Rows[0]["SAVE_LOGO_FILE_NM"].ToString() != null)
                    {
                        WebFileAgent.GetImageFile(picImg, ds.Tables[0].Rows[0]["SAVE_LOGO_FILE_NM"].ToString());
                    }
                }
                else
                {
                    MessageAgent.MessageShow(MessageType.Error, "회사정보가 없습니다!");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageAgent.MessageShow(MessageType.Error, ex.ToString());
            }
        }
Exemplo n.º 11
0
        private void MoneySet()
        {
            string strQuery = string.Format(@" SELECT isnull(SUM(DM_MONTY),0) AS DM_MONTY, isnull(SUM(GD_MONTY),0) AS GD_MONTY, isnull(SUM(TD_MONTY),0) AS TD_MONTY FROM
                                                 (SELECT isnull(CASE WHEN MONEY_TYPE = 'DM'  THEN AMOUNT END,0) AS DM_MONTY,
                                                         isnull(CASE WHEN MONEY_TYPE = 'GD'  THEN AMOUNT END,0) AS GD_MONTY,
                                                         isnull(CASE WHEN MONEY_TYPE = 'TD'  THEN AMOUNT END,0) AS TD_MONTY
                                                    FROM YEOYOU_MONEY.dbo.TB_MILEAGE_NOW 
                                                   WHERE USER_ID =  '" + txtLogin_Id.EditValue.ToString() + "' AND AMOUNT > 0) T1 ");

            DataSet ds = ServiceAgent.ExecuteDataSetStr("CONIS_IBS", strQuery);

            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0][0] != DBNull.Value)
            {
                lblTD_MONEY.Text = string.Format("{0:#,##0}", ds.Tables[0].Rows[0]["TD_MONTY"]);
                lblGD_MONEY.Text = string.Format("{0:#,##0}", ds.Tables[0].Rows[0]["GD_MONTY"]);
                lblDM_MONEY.Text = string.Format("{0:#,##0}", ds.Tables[0].Rows[0]["DM_MONTY"]);
            }
        }
Exemplo n.º 12
0
        private bool BuildDeviceReport(ServiceAgent serviceAgent, out DeviceReport deviceReport, out DescriptorMessage requestDescriptor)
        {
            requestDescriptor = _udpManager.RequestDescriptor(serviceAgent);

            if (requestDescriptor == null || !MessageBase.MessageType.Descriptor.Equals(requestDescriptor.Type))
            {
                deviceReport = null;
                return(false);
            }

            var deviceReportNodes = new List <DeviceReportNode>();

            if (requestDescriptor.Buttons.Count > 0)
            {
                deviceReportNodes.Add(BuildOutputNodes("Buttons", BindingCategory.Momentary, requestDescriptor.Buttons));
            }
            if (requestDescriptor.Axes.Count > 0)
            {
                deviceReportNodes.Add(BuildOutputNodes("Axes", BindingCategory.Signed, requestDescriptor.Axes));
            }
            if (requestDescriptor.Deltas.Count > 0)
            {
                deviceReportNodes.Add(BuildOutputNodes("Deltas", BindingCategory.Delta, requestDescriptor.Deltas));
            }
            if (requestDescriptor.Events.Count > 0)
            {
                deviceReportNodes.Add(BuildOutputNodes("Events", BindingCategory.Event, requestDescriptor.Events));
            }

            var descriptor = new DeviceDescriptor()
            {
                DeviceHandle   = serviceAgent.Hostname,
                DeviceInstance = 0 // Unused
            };

            deviceReport = new DeviceReport()
            {
                DeviceName       = serviceAgent.Hostname,
                DeviceDescriptor = descriptor,
                Nodes            = deviceReportNodes
            };

            return(true);
        }
Exemplo n.º 13
0
        private void btnSave2_Click(object sender, EventArgs e)
        {
            //사업장정보저장
            if (txtCOMPANYCD.EditValue == null)
            {
                MessageAgent.MessageShow(MessageType.Warning, "회사코드가 없습니다!");
                return;
            }

            if (MessageAgent.MessageShow(MessageType.Confirm, "저장 하시겠습니까?") == DialogResult.OK)
            {
                if (ValidationAgentEx.IsRequireCheck(this.layoutControl1.Controls, "R2"))
                {
                    try
                    {
                        int retVal = ServiceAgent.ExecuteNoneQuery(UserInfo.instance().UserId, "CONIS_IBS", "USP_MM_MM01_SAVE_02"
                                                                   , UserInfo.instance().UserId
                                                                   , this.txtCOMPANYCD.EditValue
                                                                   , this.txtBIZCD.EditValue
                                                                   , this.txtBIZCD_NM.EditValue
                                                                   , this.txtREGISTERNO2.EditValue
                                                                   , this.txtPREGIDENT2.EditValue
                                                                   , this.txtWORKTYPE2.EditValue
                                                                   , this.txtWORKJONG2.EditValue
                                                                   , this.txtADDR2.EditValue
                                                                   , this.txtZIPNO2.EditValue
                                                                   , this.txtTEL2.EditValue
                                                                   , this.txtFAX2.EditValue
                                                                   , this.txtMEMO2.EditValue
                                                                   );

                        if (retVal > 0)
                        {
                            Open2();
                            MessageAgent.MessageShow(MessageType.Informational, "저장 되었습니다.");
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageAgent.MessageShow(MessageType.Error, ex.ToString());
                    }
                }
            }
        }
Exemplo n.º 14
0
        private void OnServiceAdded(object sender, ServiceAnnouncementEventArgs e)
        {
            var serviceAgent = new ServiceAgent()
            {
                Hostname = e.Announcement.Hostname,
                Ip       = e.Announcement.Addresses[0],
                Port     = e.Announcement.Port
            };

            if (BuildDeviceReport(serviceAgent, out var report, out var descriptorMessage))
            {
                DeviceInfos.Add(e.Announcement.Hostname, new DeviceInfo()
                {
                    ServiceAgent      = serviceAgent,
                    DeviceReport      = report,
                    DescriptorMessage = descriptorMessage
                });
            }
        }
Exemplo n.º 15
0
        private void AddClient()
        {
            string s = "Ajout de";
            string z = NomClient;

            if (NomClient != null && Adresse != null)
            {
                if (CP.HasValue && Telephone.HasValue)
                {
                    this.Clients.Insert(0, new Client {
                        NomClient = NomClient, Adresse = Adresse, CP = CP.Value, Telephone = Telephone.Value, Mode = emMode.add
                    });
                    ServiceAgent.Flush(this.Clients, (error) => ClientsFlushed(error));
                    ServiceAgent.GetClients((clients, error) => ClientLoaded(clients, error));
                    ReinitField();
                    NotifyError(s + " " + z, null);
                }
            }
        }
Exemplo n.º 16
0
        private string GetMachineNameFromIPAddress(string ipAdress)
        {
            string machineName = string.Empty;

            try
            {
                ServiceAgent service = new ServiceAgent(ipAdress);
                machineName = service.GetMachineName();
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(machineName);
                machineName = xmlDoc.InnerText;
            }
            catch (Exception ex)
            {
                KryptonException.Writeexception(ex);
                Console.WriteLine("Unable to find the machine....");
            }
            return(machineName);
        }
Exemplo n.º 17
0
        public async Task <bool> DlFileStatusUpdate(DlFileStatusUpdate dlFileStatusUpdate, CancellationToken token = default(CancellationToken))
        {
            bool updateResult = false;

            try
            {
                var requestResult = await ServiceAgent.RestFullServiceJsonRequest(base.GetTargetUri(), ServiceConfig.DL_FILE_STATUS_UPDATE, dlFileStatusUpdate, token);

                if (requestResult.IsSuccess)
                {
                    var item = JsonConvert.DeserializeObject <DlUpdateStatus>(requestResult.Content);
                    updateResult = item.Status;
                }
            }
            catch (Exception)
            {
            }
            return(updateResult);
        }
Exemplo n.º 18
0
 public TransparentStreamServer(ServiceAgent agent, System.IO.Stream baseStream, ObjectBusSession objectBusSession)
 {
     if (agent == null)
     {
         throw new ArgumentNullException("agent");
     }
     if (baseStream == null)
     {
         throw new ArgumentNullException("baseStream");
     }
     if (objectBusSession == null)
     {
         throw new ArgumentNullException("objectBusSession");
     }
     this.streamID         = Guid.NewGuid();
     this.agent            = agent;
     this.baseStream       = baseStream;
     this.objectBusSession = objectBusSession;
 }
Exemplo n.º 19
0
        private void Search(object SearchCustNo)
        {
            if (!string.IsNullOrEmpty(CustomerSearchCriteria.ClientName) ||
                !string.IsNullOrEmpty(CustomerSearchCriteria.Contact) ||
                !string.IsNullOrEmpty(CustomerSearchCriteria.CustomerNo) ||
                !string.IsNullOrEmpty(CustomerSearchCriteria.Phone) ||
                !string.IsNullOrEmpty(CustomerSearchCriteria.PropertyName) ||
                !string.IsNullOrEmpty(CustomerSearchCriteria.SalesCode) ||
                !string.IsNullOrEmpty(CustomerSearchCriteria.StreetName) ||
                !string.IsNullOrEmpty(CustomerSearchCriteria.StreetNo) ||
                !string.IsNullOrEmpty(CustomerSearchCriteria.MeterNo) ||
                !string.IsNullOrEmpty(CustomerSearchCriteria.Premise))
            {
                IsBusy = true;
                ServiceAgent.SearchCustomer(CustomerSearchCriteria, (s, e) =>
                {
                    if (e.Error == null)
                    {
                        Customers = e.Result;
                        FillSortDropdown();
                        if (Customers.Count > 0)
                        {
                            SelectedCustomer = Customers[0];
                        }
                        else
                        {
                            Dialogs.Alert(ApplicationResources.GetString(ConstantResources.LTSEARCH), ApplicationResources.GetString(ConstantResources.LTNOCLIENTS), null);
                        }
                    }
                    else
                    {
                        HandleError(e.Error);
                    }

                    IsBusy = false;
                });
            }
            else
            {
                Dialogs.Alert(ApplicationResources.GetString(ConstantResources.LTSEARCHCRITERIA), ApplicationResources.GetString(ConstantResources.LTFILLSEARCHCRITERIA), null);
            }
        }
Exemplo n.º 20
0
        private void Open1()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                base.Search();

                DataSet ds = ServiceAgent.ExecuteDataSet(false, "CONIS_IBS", "USP_MA03_SELECT_01"
                                                         , dtDATE.EditValue3.Replace("-", "")
                                                         );

                DataRow[] dr = ds.Tables[0].Select();

                efwArea0.Text = String.Format("{0:#,##0}", dr[0]["AMT"]);
                efwArea1.Text = String.Format("{0:#,##0}", dr[1]["AMT"]);
                //efwArea2.Text = String.Format("{0:#,##0}", dr[2]["AMT"]);
                efwArea3.Text = String.Format("{0:#,##0}", dr[2]["AMT"]);
            }
            catch (Exception ex)
            {
                MessageAgent.MessageShow(MessageType.Error, ex.ToString());
                Cursor.Current = Cursors.Default;
            }

            try
            {
                using (MySQLConn sql = new MySQLConn(ConstantLib.BasicConn_Real))
                {
                    sql.Query = "select sum(a.o_donut_d_cost + a. o_donut_s_cost) from domamall.tb_am_product_orders a  " +
                                " where date_format(a.o_deposit_confirm_date, '%Y%m') =  substr('" + dtDATE.EditValue3.Replace(" - ", "") + "',1,6) and a.o_type IN ('E','P')   ";
                    DataSet ds = sql.selectQueryDataSet();

                    efwArea2.Text = String.Format("{0:#,##0}", Convert.ToInt32(sql.selectQueryForSingleValue()));
                }
            }
            catch (Exception ex)
            {
                MessageAgent.MessageShow(MessageType.Error, ex.ToString());
                Cursor.Current = Cursors.Default;
            }
            Open1_1();
        }
Exemplo n.º 21
0
        public override void Search()
        {
            //base.Search();

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                string s1 = string.Empty;

                if (this.cmbQ3.EditValue == null)
                {
                    s1 = "";
                }
                else
                {
                    s1 = this.cmbQ3.EditValue.ToString().Replace("%", "");
                }
                //base.Search();
                DataSet ds = ServiceAgent.ExecuteDataSet(true, "CONIS_IBS", "USP_MM_MM05_SELECT_01"
                                                         , this.txtCOMPANYCD.Text
                                                         , this.cmbQ1.EditValue
                                                         , this.txtSearch.Text
                                                         , this.cmbQ2.EditValue
                                                         , s1
                                                         , this.dt1.EditValue3
                                                         , this.dt2.EditValue3
                                                         , this.chkQ1.EditValue
                                                         );

                efwGridControl1.DataBind(ds);
                this.efwGridControl1.MyGridView.BestFitColumns();
            }
            catch (Exception ex)
            {
                MessageAgent.MessageShow(MessageType.Error, ex.ToString());
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemplo n.º 22
0
        private void fValueSet()
        {
            string syymm = DateTime.Now.ToString("yyyyMM");



            // 거래처코드 자동 생성
            //string strQuery = string.Format(@"SELECT COUNT(*) AS ID_CNT FROM TBL_BASIC WHERE COMPANYCD='{0}' AND BIZCD='{1}' AND LOGINID='{2}'"
            string strQuery = string.Format(@"SELECT ISNULL(dbo.LPAD(MAX(PURCHASECODE) + 1, 6, '0'), '000001') AS SEQ  FROM dbo.TBL_PURCHASEMASTER ");

            DataSet ds = ServiceAgent.ExecuteDataSetStr("CONIS_IBS", strQuery);

            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0][0] != DBNull.Value)
            {
                txtPURCHASECODE.EditValue = ds.Tables[0].Rows[0]["SEQ"];
            }
            cmbBIZCDQ.EditValue = "";
            txtPURCHASENAME.Focus();
            _isNewMode = true;
        }
Exemplo n.º 23
0
        private void Open()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                DataSet ds = ServiceAgent.ExecuteDataSet(true, "CONIS_IBS", "USP_DN03_SELECT_04"
                                                         , pDATE
                                                         , pMONEY_TYPE);

                efwGridControl1.DataBind(ds);
                this.efwGridControl1.MyGridView.BestFitColumns();
            }
            catch (Exception ex)
            {
                MessageAgent.MessageShow(MessageType.Error, ex.ToString());
            }

            Cursor.Current = Cursors.Default;
        }
Exemplo n.º 24
0
        private void DeleteCustomer(object ignored)
        {
            if (SelectedCustomer != null && !string.IsNullOrEmpty(SelectedCustomer.CustomerNo))
            {
                IsBusy = true;
                ServiceAgent.DeleteCustomer(SelectedCustomer.CustomerNo, (s, e) =>
                {
                    if (e.Error != null)
                    {
                        HandleError(e.Error);
                    }
                    else
                    {
                        _regionManager.RequestNavigate("ModuleRegion", new Uri("SearchView", UriKind.Relative));
                    }

                    IsBusy = false;
                });
            }
        }
Exemplo n.º 25
0
        public override void Search()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                DataSet ds = ServiceAgent.ExecuteDataSet(true, "CONIS_IBS", "USP_DN04_SELECT_01"
                                                         , this.dt1F.EditValue3
                                                         , this.dt1T.EditValue3);

                efwGridControl1.DataBind(ds);
                this.efwGridControl1.MyGridView.BestFitColumns();

                Cursor.Current = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageAgent.MessageShow(MessageType.Error, ex.ToString());
            }
        }
Exemplo n.º 26
0
        private void Open1()
        {
            try
            {
                base.Search();

                DataSet ds = ServiceAgent.ExecuteDataSet(false, "CONIS_IBS", "USP_PM_PM01_SELECT_01"
                                                         , txtCOMPANYCD.EditValue
                                                         , cmbBIZCDQ.EditValue
                                                         , txtNAMEQ.EditValue
                                                         );

                efwGridControl1.DataBind(ds);
                //   this.efwGridControl1.MyGridView.BestFitColumns();
            }
            catch (Exception ex)
            {
                MessageAgent.MessageShow(MessageType.Error, ex.ToString());
            }
        }
Exemplo n.º 27
0
        private void message()
        {
            if (txtLogin_id.Text.Length > 4)
            {
                int nCount;
                using (MySQLConn sql = new MySQLConn(ConstantLib.BasicConn_Real))
                {
                    sql.Query = "select count(*) as nCount FROM  domalife.member_master where login_id  = '" + txtLogin_id.EditValue + "' ";
                    DataSet ds = sql.selectQueryDataSet();

                    nCount = Convert.ToInt32(sql.selectQueryForSingleValue());
                }
                if (nCount == 1)
                {
                    txtId_yn.EditValue = "N";
                    lbMessage.Text     = "사용중인 아이디 입니다";
                    return;
                }
                else
                {
                    txtId_yn.EditValue = "Y";
                    lbMessage.Text     = "사용가능한 아이디 입니다";
                }

                string strQuery = string.Format(@"SELECT idx AS SEQ FROM y2k2.dbo.Y2K2_member where id  = '" + txtLogin_id.EditValue + "' ");

                DataSet ds1 = ServiceAgent.ExecuteDataSetStr("CONIS_IBS", strQuery);

                if (ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0 && ds1.Tables[0].Rows[0][0] != DBNull.Value)
                {
                    // txtCnt.EditValue = ds.Tables[0].Rows[0]["SEQ"];
                    txtId_yn.EditValue = "N";
                    lbMessage.Text     = "사용중인 아이디 입니다";
                }
                else
                {
                    txtId_yn.EditValue = "Y";
                    lbMessage.Text     = "사용가능한 아이디 입니다";
                }
            }
        }
Exemplo n.º 28
0
        private void btnLink_Click(object sender, EventArgs e)
        {
            if (this.tbIp.Text.Trim().Length == 0 ||
                this.tbIp.Text.Trim().Length == 0)
            {
                MessageBox.Show("IP and Port is required!");
                return;
            }
            int port = 0;

            if (!int.TryParse(this.tbPort.Text.Trim(), out port))
            {
                MessageBox.Show("Port must be number!");
                return;
            }

            ServiceAgent.SetParas(this.tbIp.Text.Trim(), port);

            if (int.TryParse(this.tbFilePort.Text.Trim(), out port))
            {
                FileAgent.SetParas(this.tbIp.Text.Trim(), port);
            }

            GlobalStaticObj_Server.Instance.StationID = this.tbSendMsg.Text.Split('$')[0];
            if (ServiceAgent.ServiceTest() || FileAgent.ServiceTest())
            {
                if (this.startFlag)
                {
                    this.startFlag = false;
                    AutoTask.StartTest(this.dateTimePicker1.Value.Ticks);
                }
                else
                {
                    AutoTask.Continue();
                }

                this.btnLink.Text     = "已连接";
                this.btnLink.Enabled  = false;
                this.btnClose.Enabled = true;
            }
        }
Exemplo n.º 29
0
        public override void Delete()
        {
            base.Delete();

            if (string.IsNullOrEmpty(this.txtCOMPANYCD.Text))
            {
                MessageAgent.MessageShow(MessageType.Warning, "회사코드가 없습니다!");
                return;
            }

            if (string.IsNullOrEmpty(this.txtPURCHASENAME.Text))
            {
                MessageAgent.MessageShow(MessageType.Warning, "삭제할 거래처명이 없습니다!");
                return;
            }

            DialogResult drt = MessageAgent.MessageShow(MessageType.Confirm, "삭제 하시겠습니까?");

            if (drt == DialogResult.OK)
            {
                try
                {
                    int retVal = ServiceAgent.ExecuteNoneQuery(UserInfo.instance().UserId, "CONIS_IBS", "USP_PM_PM01_DELETE_01"
                                                               , UserInfo.instance().UserId
                                                               , this.txtCOMPANYCD.EditValue
                                                               , this.txtPURCHASECODE.EditValue
                                                               );
                    if (retVal > 0)
                    //    if (ds.Tables.Count > 0)
                    {
                        MessageAgent.MessageShow(MessageType.Informational, "삭제되었습니다.");
                        Open1();
                        NewMode();
                    }
                }
                catch (Exception ex)
                {
                    MessageAgent.MessageShow(MessageType.Error, ex.ToString());
                }
            }
        }
Exemplo n.º 30
0
        /// <summary> 上传数据
        /// </summary>
        /// <param name="dbName">帐套信息</param>
        public static void UpLoadData(string dbName)
        {
            DataTable      dt;
            ClientProtocol protocol;

            foreach (DictionaryEntry de in htTable)
            {
                dt = GetData(de.Key.ToString(), dbName);
                if (dt != null)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        protocol = GetProtocol(dr, dbName);
                        if (protocol != null)
                        {
                            ServiceAgent.AddSendQueue(protocol);
                        }
                    }
                }
            }
        }
Exemplo n.º 31
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (txtCOMPANYCD.EditValue == null)
            {
                MessageAgent.MessageShow(MessageType.Warning, "회사코드가 없습니다!");
                return;
            }

            if (cmbBIZCD.EditValue == null)
            {
                MessageAgent.MessageShow(MessageType.Warning, "사업장코드가 없습니다!");
                return;
            }

            DialogResult drt = MessageAgent.MessageShow(MessageType.Confirm, "삭제 하시겠습니까?");

            if (drt == DialogResult.OK)
            {
                try
                {
                    int retVal = ServiceAgent.ExecuteNoneQuery(UserInfo.instance().UserId, "CONIS_IBS", "USP_MA_MA01_DELETE_01"
                                                               , UserInfo.instance().UserId
                                                               , this.txtCOMPANYCD.EditValue
                                                               , this.cmbBIZCD.EditValue
                                                               , this.txtDUTYCODE.EditValue
                                                               );

                    if (retVal > 0)
                    {
                        MessageAgent.MessageShow(MessageType.Informational, "삭제되었습니다.");
                        Open1();
                        btnNew_Click(null, null);
                    }
                }
                catch (Exception ex)
                {
                    MessageAgent.MessageShow(MessageType.Error, ex.ToString());
                }
            }
        }
Exemplo n.º 32
0
        //public override void Search()
        //{
        //    try
        //    {

        //        int retVal = ServiceAgent.ExecuteNoneQuery(UserInfo.instance().UserId, "CONIS_IBS", "USP_MM_MM27_SAVE_01"
        //                                                   , this.dt1F.EditValue3
        //                                                   , this.dt1T.EditValue3
        //                                                  );

        //        if (retVal > 0)
        //        {
        //            using (MySqlConnection con = new MySqlConnection(ConstantLib.BasicConn_Real))

        //            {
        //                using (MySqlCommand cmd = new MySqlCommand("domabiz.USP_DN_DN27_SELECT_01", con))
        //                {
        //                    cmd.CommandType = CommandType.StoredProcedure;

        //                    cmd.Parameters.Add("i_search", MySqlDbType.VarChar, 50);
        //                    cmd.Parameters[0].Value = txtQ.EditValue;

        //                    using (MySqlDataAdapter sda = new MySqlDataAdapter(cmd))
        //                    {
        //                        DataTable ds = new DataTable();
        //                        sda.Fill(ds);
        //                        efwGridControl1.DataBind(ds);
        //                        this.efwGridControl1.MyGridView.BestFitColumns();
        //                    }
        //                }
        //            }
        //        }
        //    }

        //    catch (Exception ex)
        //    {
        //        MessageAgent.MessageShow(MessageType.Error, ex.ToString());
        //    }
        //}


        public override void Search()
        {
            try
            {
                base.Search();

                DataSet ds1 = ServiceAgent.ExecuteDataSet(false, "CONIS_IBS", "USP_MM_MM27_SELECT_01"
                                                          , dt1F.EditValue3
                                                          , dt1T.EditValue3
                                                          );

                //efwGridControl1.DataBind(ds);
                //   this.efwGridControl1.MyGridView.BestFitColumns();

                using (MySqlConnection con = new MySqlConnection(ConstantLib.BasicConn_Real))

                {
                    using (MySqlCommand cmd = new MySqlCommand("domabiz.USP_MM_MM27_SELECT_02", con))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;

                        cmd.Parameters.Add("i_search", MySqlDbType.VarChar, 50);
                        cmd.Parameters[0].Value = txtQ.EditValue;

                        using (MySqlDataAdapter sda = new MySqlDataAdapter(cmd))
                        {
                            DataTable ds = new DataTable();
                            sda.Fill(ds);
                            efwGridControl1.DataBind(ds);
                            this.efwGridControl1.MyGridView.BestFitColumns();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageAgent.MessageShow(MessageType.Error, ex.ToString());
            }
        }
Exemplo n.º 33
0
        private void SendMessage(object state)
        {
            string[] arrays = state.ToString().Split('$');
            if (arrays.Length != 8)
            {
                return;
            }
            LoginProtocol lp = new LoginProtocol();

            lp.StationId    = arrays[0];
            lp.SerialNumber = arrays[1];
            lp.MessageId    = arrays[2];
            lp.SubMessageId = arrays[3];
            lp.TimeSpan     = arrays[4];

            lp.UserId         = arrays[5];
            lp.Password       = arrays[6];
            lp.PermissionCode = arrays[7];

            ServiceAgent.AddSendQueue(lp);
            FileAgent.AddSendQueue(lp);
        }
Exemplo n.º 34
0
        private void CreTree()
        {
            //string sIBS_CD = UserInfo.instance().IBS_CD;
            //string sORG_CD = string.Empty;

            //if (sIBS_CD == "IBS01")
            //    sORG_CD = null;
            //else
            //    sORG_CD = UserInfo.instance().IBS_CD;

            //부서정보
            _dsDeptInfo = ServiceAgent.ExecuteDataSet(false, "CONIS_IBS", "USP_MM_MM02_SELECT_02", txtCOMPANYCD.EditValue, "1");

            TreeNode rootNode = new TreeNode("사업장별 부서정보");

            this.treeView1.Nodes.Add(rootNode);
            this.treeView1.ImageList = this.imgOrganList;

            //DataRow[] drs = _dsDeptInfo.Tables[0].Select("LEVEL=0", " RNKORDER ASC");
            //DataRow[] drs = _dsDeptInfo.Tables[0].Select("GROUP BY '{0}','{1}', BIZCD, BIZCD_NM ");
            DataRow[] drs1 = _dsDeptInfo.Tables[0].Select();
            //노드 생성하기
            for (int i = 0; i < drs1.Length; i++)
            {
                BizNode Onode = new BizNode(drs1[i]);
                CreateNode2(Onode);

                rootNode.Nodes.Add(Onode);

                if (treeView1.Nodes.Count > 0)
                {
                    treeView1.Nodes[0].Expand();
                }
            }

            this.treeView1.EndUpdate();
            //this.treeView1.ExpandAll();
        }
Exemplo n.º 35
0
        private void brnSave_Click(object sender, EventArgs e)
        {
            if (txtCOMPANYCD.EditValue == null)
            {
                MessageAgent.MessageShow(MessageType.Warning, "회사코드가 없습니다!");
                return;
            }

            if (MessageAgent.MessageShow(MessageType.Confirm, "저장 하시겠습니까?") == DialogResult.OK)
            {
                if (ValidationAgentEx.IsRequireCheck(this.layoutControl1.Controls, "R1"))
                {
                    try
                    {
                        int retVal = ServiceAgent.ExecuteNoneQuery(UserInfo.instance().UserId, "CONIS_IBS", "USP_MA_MA01_SAVE_01"
                                                                   , UserInfo.instance().UserId
                                                                   , this.txtCOMPANYCD.EditValue
                                                                   , this.cmbBIZCD.EditValue
                                                                   , this.txtDUTYCODE.EditValue
                                                                   , this.txtDUTYNAME.EditValue
                                                                   , Convert.ToInt16(this.txtRANKORDER.EditValue)
                                                                   , this.txtMEMO.EditValue
                                                                   );

                        if (retVal > 0)
                        {
                            MessageAgent.MessageShow(MessageType.Informational, "저장 되었습니다.");
                            Open1();
                            btnNew_Click(null, null);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageAgent.MessageShow(MessageType.Error, ex.ToString());
                    }
                }
            }
        }
Exemplo n.º 36
0
        private void Open1()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                DataSet ds = ServiceAgent.ExecuteDataSet(true, "CONIS_IBS", "USP_MM_MM05_SELECT_02"
                                                         , this.cmbQ1.EditValue
                                                         , this.txtSearch.Text
                                                         );

                efwGridControl1.DataBind(ds);
                this.efwGridControl1.MyGridView.BestFitColumns();
            }
            catch (Exception ex)
            {
                MessageAgent.MessageShow(MessageType.Error, ex.ToString());
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemplo n.º 37
0
 /// <summary>
 /// Helper method to initiate the call that creates a new group.
 /// </summary>
 /// <param name="clientIdentity">The hawaii client identity.</param>
 /// <param name="ttl">Specifies the time to live in the service</param>
 /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
 /// <param name="stateObject">Specifies a user-defined object.</param>
 private static void CreateGroupAsync(
     ClientIdentity clientIdentity,
     TimeSpan ttl,
     ServiceAgent<GroupResult>.OnCompleteDelegate onComplete,
     object stateObject = null)
 {
     CreateGroupAgent agent = new CreateGroupAgent(
         RelayService.HostName,
         clientIdentity,
         ttl,
         stateObject);
     agent.ProcessRequest(onComplete);
 }
        /// <summary>
        /// Calls the PredictLocation service method
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="request">request parameter to the method</param>
        /// <param name="onComplete">on complete callback</param>
        /// <param name="stateObject">Optional correlation user state object</param>
        private static void PredictLocationAsync(
            ClientIdentity clientIdentity,
            PredictLocationRequest request,
            ServiceAgent<PredictLocationResult>.OnCompleteDelegate onComplete,
            object stateObject)
        {
            PredictLocationAgent agent = new PredictLocationAgent(
                PathPredictionService.ServicePath,
                clientIdentity,
                request,
                stateObject);

            agent.ProcessRequest(onComplete);
        }
Exemplo n.º 39
0
        /// <summary>
        /// Helper method to initiate the call that will receive a message.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="endpoint">Specifies an endpoint to leave a group.</param>
        /// <param name="filter">
        /// Specifies a list of registration ids for Endpoints and/or Groups that
        /// identify senders and/or group recipients of desired messages.
        /// </param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        private static void ReceiveMessagesAsync(
            ClientIdentity clientIdentity,
            Endpoint endpoint,
            string filter,
            ServiceAgent<MessagingResult>.OnCompleteDelegate onComplete,
            object stateObject = null)
        {
            ReceiveMessagesAgent agent = new ReceiveMessagesAgent(
                RelayService.HostName,
                clientIdentity,
                endpoint,
                filter,
                TimeSpan.Zero, // Default to return immediately
                stateObject);

            agent.ProcessRequest(onComplete);
        }
Exemplo n.º 40
0
        /// <summary>
        /// Helper method to initiate the call that creates an endpoint.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="name">Specifies a name of the client.</param>
        /// <param name="ttl">Specifies the time to live on the server</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        private static void CreateEndPointAsync(
            ClientIdentity clientIdentity,
            string name,
            TimeSpan ttl,
            ServiceAgent<EndpointResult>.OnCompleteDelegate onComplete,
            object stateObject = null)
        {
            CreateEndPointAgent agent = new CreateEndPointAgent(
                RelayService.HostName,
                clientIdentity,
                name,
                ttl,
                stateObject);

            agent.ProcessRequest(onComplete);
        }
        /// <summary>
        /// Calls the PredictLocation service method
        /// </summary>
        /// <param name="clientId">The adm client Id.</param>
        /// <param name="clientSecret">The adm client secret.</param>
        /// <param name="request">request parameter to the method</param>
        /// <param name="onComplete">on complete callback</param>
        /// <param name="stateObject">Optional correlation user state object</param>
        public static void PredictLocationAsync(
            string clientId,
            string clientSecret,
            PredictLocationRequest request,
            ServiceAgent<PredictLocationResult>.OnCompleteDelegate onComplete,
            object stateObject)
        {
            if (string.IsNullOrEmpty(clientId))
            {
                throw new ArgumentNullException("clientId");
            }

            if (string.IsNullOrEmpty(clientSecret))
            {
                throw new ArgumentNullException("clientSecret");
            }

            PredictLocationAsync(
                new AdmAuthClientIdentity(clientId, clientSecret, PathPredictionService.ServiceScope),
                request,
                onComplete,
                stateObject);
        }
Exemplo n.º 42
0
        /// <summary>
        /// Helper method to recognize an image.
        /// </summary>
        /// <param name="hawaiiAppId">Specifies the Hawaii Application Id.</param>
        /// <param name="imageBuffer">
        /// Specifies a buffer containing an image that has to be processed.
        /// The image must be in JPEG format.
        /// </param>
        /// <param name="onComplete">Specifies an on complete callback method.</param>
        /// <param name="stateObject">Specifies a user defined object which will be provided in the call of the callback method.</param>
        public static void RecognizeImageAsync(
            string hawaiiAppId, 
            byte[] imageBuffer,
            ServiceAgent<OcrServiceResult>.OnCompleteDelegate onComplete, 
            object stateObject = null)
        {
            if (string.IsNullOrEmpty(hawaiiAppId))
            {
                throw new ArgumentNullException("hawaiiAppId");
            }

            RecognizeImageAsync(
                new GuidAuthClientIdentity(hawaiiAppId),
                imageBuffer,
                onComplete,
                stateObject);
        }
        /// <summary>
        /// Helper method to initiate the call that gets the supported languages for speak method.
        /// </summary>
        /// <param name="hawaiiAppId">Specifies the Hawaii Application Id.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        /// <param name="locale">The system locale</param>
        public static void GetLanguagesForSpeakAsync(
            string hawaiiAppId,
            ServiceAgent<GetLanguagesForSpeakResult>.OnCompleteDelegate onComplete,
            object stateObject,
            string locale = "en")
        {
            if (string.IsNullOrEmpty(hawaiiAppId))
            {
                throw new ArgumentNullException("hawaiiAppId");
            }

            GetLanguagesForSpeakAsync(
                new GuidAuthClientIdentity(hawaiiAppId),
                onComplete,
                stateObject,
                locale);
        }
Exemplo n.º 44
0
        /// <summary>
        /// Helper method to initiate the call that deletes a group.
        /// </summary>
        /// <param name="clientId">The adm client Id.</param>
        /// <param name="clientSecret">The adm client secret.</param>
        /// <param name="group">Specifies a group to be deleted.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        public static void DeleteGroupAsync(
            string clientId,
            string clientSecret,
            Group group,
            ServiceAgent<GroupResult>.OnCompleteDelegate onComplete,
            object stateObject = null)
        {
            if (string.IsNullOrEmpty(clientId))
            {
                throw new ArgumentNullException("clientId");
            }

            if (string.IsNullOrEmpty(clientSecret))
            {
                throw new ArgumentNullException("clientSecret");
            }

            DeleteGroupAsync(
                new AdmAuthClientIdentity(clientId, clientSecret, RelayService.ServiceScope),
                group,
                onComplete,
                stateObject);
        }
Exemplo n.º 45
0
        /// <summary>
        /// Helper method to initiate the call that will receive a message.
        /// </summary>
        /// <param name="clientId">The adm client Id.</param>
        /// <param name="clientSecret">The adm client secret.
        /// Specifies the Hawaii Application Id.
        /// </param>
        /// <param name="endpoint">
        /// Specifies an endpoint to leave a group.
        /// </param>
        /// <param name="filter">
        /// Specifies a list of registration ids for Endpoints and/or Groups that
        /// identify senders and/or group recipients of desired messages.
        /// </param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        public static void ReceiveMessagesAsync(
            string clientId,
            string clientSecret,
            Endpoint endpoint,
            string filter,
            ServiceAgent<MessagingResult>.OnCompleteDelegate onComplete,
            object stateObject = null)
        {
            if (string.IsNullOrEmpty(clientId))
            {
                throw new ArgumentNullException("clientId");
            }

            if (string.IsNullOrEmpty(clientSecret))
            {
                throw new ArgumentNullException("clientSecret");
            }

            ReceiveMessagesAsync(
                new AdmAuthClientIdentity(clientId, clientSecret, RelayService.ServiceScope),
                endpoint,
                filter,
                onComplete,
                stateObject);
        }
Exemplo n.º 46
0
 /// <summary>
 /// Helper method to initiate the call that will send a message.
 /// </summary>
 /// <param name="clientIdentity">The hawaii client identity.</param>
 /// <param name="fromEndPoint">Specifies an from end point.</param>
 /// <param name="recipientIds">Specifies the recipients (either endpoint or group) ids.</param>
 /// <param name="message">Specifies an message data to be sent.</param>
 /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
 /// <param name="stateObject">Specifies a user-defined object.</param>
 private static void SendMessageAsync(
     ClientIdentity clientIdentity,
     Endpoint fromEndPoint,
     string recipientIds,
     byte[] message,
     ServiceAgent<MessagingResult>.OnCompleteDelegate onComplete,
     object stateObject = null)
 {
     SendMessageAgent agent = new SendMessageAgent(
         RelayService.HostName,
         clientIdentity,
         fromEndPoint,
         recipientIds,
         message,
         TimeSpan.MaxValue,
         stateObject);
     agent.ProcessRequest(onComplete);
 }
Exemplo n.º 47
0
        /// <summary>
        /// Helper method to initiate the call that deletes an endpoint.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="endpoint">Specifies an endpoint.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        private static void DeleteEndPointAsync(
            ClientIdentity clientIdentity,
            Endpoint endpoint,
            ServiceAgent<EndpointResult>.OnCompleteDelegate onComplete,
            object stateObject = null)
        {
            DeleteEndPointAgent agent = new DeleteEndPointAgent(
                RelayService.HostName,
                clientIdentity,
                endpoint,
                stateObject);

            agent.ProcessRequest(onComplete);
        }
        /// <summary>
        /// Helper method to initiate the call that speak method.
        /// </summary>
        /// <param name="hawaiiAppId">Specifies the Hawaii Application Id.</param>
        /// <param name="text">The text to be converted to speech.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        /// <param name="language">The language of the speech.</param>        
        /// <param name="format">The stream format of the content type. Currently "audio/wav" and "audio/mp3" are available. The default value is "audio/wav".</param>
        /// <param name="options">Specifies the quality of the audio signals. Currently "MaxQuality" and "MinSize" are available. The default value is "MinSize".</param>
        public static void SpeakAsync(
            string hawaiiAppId,
            string text,
            ServiceAgent<SpeakResult>.OnCompleteDelegate onComplete,
            object stateObject,
            string language = "",
            string format = "audio/wav", 
            string options = "MinSize")
        {
            if (string.IsNullOrEmpty(hawaiiAppId))
            {
                throw new ArgumentNullException("hawaiiAppId");
            }

            SpeakAsync(
                new GuidAuthClientIdentity(hawaiiAppId),
                text,
                onComplete,
                stateObject,              
                language,
                format,
                options);
        }
        /// <summary>
        /// Helper method to initiate the call that translate method.
        /// </summary>
        /// <param name="clientId">The adm client Id.</param>
        /// <param name="clientSecret">The adm client secret.</param>
        /// <param name="text">The text to be translated.</param>
        /// <param name="to">The language translate to.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        /// <param name="from">The language translate from.</param>        
        public static void TranslateAsync(
            string clientId,
            string clientSecret,
            string text,
            string to,
            ServiceAgent<TranslateResult>.OnCompleteDelegate onComplete,
            object stateObject,
            string from = "")
        {
            if (string.IsNullOrEmpty(clientId))
            {
                throw new ArgumentNullException("clientId");
            }

            if (string.IsNullOrEmpty(clientSecret))
            {
                throw new ArgumentNullException("clientSecret");
            }

            TranslateAsync(
                new AdmAuthClientIdentity(clientId, clientSecret, TranslatorService.ServiceScope),
                text,
                to,
                onComplete,
                stateObject,
                from);
        }
        /// <summary>
        /// Helper method to initiate the call that translate method.
        /// </summary>
        /// <param name="hawaiiAppId">Specifies the Hawaii Application Id.</param>
        /// <param name="text">The text to be translated.</param>
        /// <param name="to">The language translate to.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        /// <param name="from">The language translate from.</param>        
        public static void TranslateAsync(
            string hawaiiAppId,
            string text,
            string to,
            ServiceAgent<TranslateResult>.OnCompleteDelegate onComplete,
            object stateObject,            
            string from = "")
        {
            if (string.IsNullOrEmpty(hawaiiAppId))
            {
                throw new ArgumentNullException("hawaiiAppId");
            }

            TranslateAsync(
                new GuidAuthClientIdentity(hawaiiAppId),
                text,
                to,
                onComplete,
                stateObject,
                from);
        }
Exemplo n.º 51
0
        /// <summary>
        /// Helper method to initiate the call that deletes a group.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="group">Specifies a group to be deleted.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        private static void DeleteGroupAsync(
            ClientIdentity clientIdentity,
            Group group,
            ServiceAgent<GroupResult>.OnCompleteDelegate onComplete,
            object stateObject = null)
        {
            DeleteGroupAgent agent = new DeleteGroupAgent(
                RelayService.HostName,
                clientIdentity,
                group,
                stateObject);

            agent.ProcessRequest(onComplete);
        }
        /// <summary>
        /// Helper method to initiate the call that speak method.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="text">The text to be converted to speech.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        /// <param name="language">The language of the speech.</param>        
        /// <param name="format">The stream format of the content type. Currently "audio/wav" and "audio/mp3" are available. The default value is "audio/wav".</param>
        /// <param name="options">Specifies the quality of the audio signals. Currently "MaxQuality" and "MinSize" are available. The default value is "MinSize".</param>
        private static void SpeakAsync(
            ClientIdentity clientIdentity,
            string text,
            ServiceAgent<SpeakResult>.OnCompleteDelegate onComplete,
            object stateObject,
            string language = "",
            string format = "audio/wav",
            string options = "MinSize")
        {
            SpeakAgent agent = new SpeakAgent(
                TranslatorService.HostName,
                clientIdentity,
                text,
                stateObject,
                language,
                format,
                options);

            agent.ProcessRequest(onComplete);
        }
Exemplo n.º 53
0
        /// <summary>
        /// Helper method to recognize an image.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="imageBuffer">
        /// Specifies a buffer containing an image that has to be processed.
        /// The image must be in JPEG format.
        /// </param>
        /// <param name="onComplete">Specifies an on complete callback method.</param>
        /// <param name="stateObject">Specifies a user defined object which will be provided in the call of the callback method.</param>
        private static void RecognizeImageAsync(
            ClientIdentity clientIdentity,
            byte[] imageBuffer,
            ServiceAgent<OcrServiceResult>.OnCompleteDelegate onComplete,
            object stateObject = null)
        {
            OcrAgent agent = new OcrAgent(
                OcrService.HostName,
                clientIdentity,
                imageBuffer,
                stateObject);

            agent.ProcessRequest(onComplete);
        }
        /// <summary>
        /// Helper method to initiate the service call that retrieves all grammars available on the server.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate handler.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        private static void GetGrammarsAsync(
            ClientIdentity clientIdentity,
            ServiceAgent<SpeechServiceResult>.OnCompleteDelegate onComplete,
            object stateObject = null)
        {
            SpeechGrammarsAgent client = new SpeechGrammarsAgent(
                SpeechService.HostName,
                clientIdentity,
                stateObject);

            client.ProcessRequest(onComplete);
        }
        /// <summary>
        /// Helper method to initiate the call that speak method.
        /// </summary>
        /// <param name="clientId">The adm client Id.</param>
        /// <param name="clientSecret">The adm client secret.</param>
        /// <param name="text">The text to be converted to speech.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        /// <param name="language">The language of the speech.</param>        
        /// <param name="format">The stream format of the content type. Currently "audio/wav" and "audio/mp3" are available. The default value is "audio/wav".</param>
        /// <param name="options">Specifies the quality of the audio signals. Currently "MaxQuality" and "MinSize" are available. The default value is "MinSize".</param>
        public static void SpeakAsync(
            string clientId,
            string clientSecret,
            string text,
            ServiceAgent<SpeakResult>.OnCompleteDelegate onComplete,
            object stateObject,
            string language = "",
            string format = "audio/wav",
            string options = "MinSize")
        {
            if (string.IsNullOrEmpty(clientId))
            {
                throw new ArgumentNullException("clientId");
            }

            if (string.IsNullOrEmpty(clientSecret))
            {
                throw new ArgumentNullException("clientSecret");
            }

            SpeakAsync(
                new AdmAuthClientIdentity(clientId, clientSecret, TranslatorService.ServiceScope),
                text,
                onComplete,
                stateObject,
                language,
                format,
                options);
        }
        /// <summary>
        /// Helper method to initiate the service call that executes the speech-to-text translation.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="grammar">Specifies a grammar name.</param>
        /// <param name="speechBuffer">
        /// Specifies a buffer containing the audio data to be translated to text.
        /// The audio buffer should have the following characteristics:
        /// 'SamplesPerSecond=16000', 'AudioBitsPerSample=16' and 'AudioChannel=Mono'.
        /// </param>
        /// <param name="onComplete">Specifies an "on complete" delegate handler.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        private static void RecognizeSpeechAsync(
            ClientIdentity clientIdentity,
            string grammar,
            byte[] speechBuffer,
            ServiceAgent<SpeechServiceResult>.OnCompleteDelegate onComplete,
            object stateObject = null)
        {
            SpeechRecognitionAgent client = new SpeechRecognitionAgent(
                SpeechService.HostName,
                clientIdentity,
                grammar,
                speechBuffer,
                stateObject);

            client.ProcessRequest(onComplete);
        }
        /// <summary>
        /// Helper method to initiate the call that gets the supported languages for speak method.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        /// <param name="locale">The system locale</param>       
        private static void GetLanguagesForSpeakAsync(
            ClientIdentity clientIdentity,
            ServiceAgent<GetLanguagesForSpeakResult>.OnCompleteDelegate onComplete,
            object stateObject,
            string locale = "en")
        {
            GetLanguagesForSpeakAgent agent = new GetLanguagesForSpeakAgent(
                TranslatorService.HostName,
                clientIdentity,
                stateObject,
                locale);

            agent.ProcessRequest(onComplete);
        }
        /// <summary>
        /// Helper method to initiate the call that translate method.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="text">The text to be translated.</param>
        /// <param name="to">The language translate to.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        /// <param name="from">The language translate from.</param>        
        private static void TranslateAsync(
           ClientIdentity clientIdentity,
           string text,
           string to,
           ServiceAgent<TranslateResult>.OnCompleteDelegate onComplete,
           object stateObject,
           string from = "")
        {
            TranslateAgent agent = new TranslateAgent(
                TranslatorService.HostName,
                clientIdentity,
                text,
                to,
                stateObject,
                from);

            agent.ProcessRequest(onComplete);
        }
        /// <summary>
        /// Helper method to initiate the call that gets the supported languages for speak method.
        /// </summary>
        /// <param name="clientId">The adm client Id.</param>
        /// <param name="clientSecret">The adm client secret.</param>
        /// <param name="onComplete">Specifies an "on complete" delegate callback.</param>
        /// <param name="stateObject">Specifies a user-defined object.</param>
        /// <param name="locale">The system locale</param>
        public static void GetLanguagesForSpeakAsync(
            string clientId,
            string clientSecret,
            ServiceAgent<GetLanguagesForSpeakResult>.OnCompleteDelegate onComplete,
            object stateObject,
            string locale = "en")
        {
            if (string.IsNullOrEmpty(clientId))
            {
                throw new ArgumentNullException("clientId");
            }

            if (string.IsNullOrEmpty(clientSecret))
            {
                throw new ArgumentNullException("clientSecret");
            }

            GetLanguagesForSpeakAsync(
                new AdmAuthClientIdentity(clientId, clientSecret, TranslatorService.ServiceScope),
                onComplete,
                stateObject,
                locale);
        }
Exemplo n.º 60
0
		internal TransparentStream (ServiceAgent agent, Guid streamID, ObjectBusSession objectBusSession)
		{
			if (agent == null)
				throw new ArgumentNullException ("agent");
			if (objectBusSession == null)
				throw new ArgumentNullException ("objectBusSession");
			this.agent = agent;
			this.streamID = streamID;
			this.objectBusSession = objectBusSession;
		}