コード例 #1
0
        public void SendTextToService(GSSModel.Request.ClientData data, msgCommand command)
        {
            MsgStruts str = new MsgStruts()
            {
                msgsendstate = msgSendState.single,
                msgtype      = msgType.SendText,
                command      = command
            };

            str.Data = DataSerialize.GetByteFromObject(data);
            _tcpcli.Send(str);
        }
コード例 #2
0
        public void BindCommandWithSend(msgCommand cmd, int formid, GSSModel.Tasks task, object sendData)
        {
            MsgStruts msg = new MsgStruts();

            msg.command      = cmd;
            msg.msgtype      = msgType.SendText;
            msg.msgsendstate = msgSendState.single;
            GSSModel.Request.ClientData client = new GSSModel.Request.ClientData();
            client.FormID = formid;
            client.Data   = new object[] { task, sendData };
            //json 序列化
            msg.Data = DataSerialize.GetByteFromObject(client);
            _tcpcli.Send(msg);
        }
コード例 #3
0
        /// <summary>
        /// 提交工单
        /// </summary>
        private void CommitTask()
        {
            Tasks  model  = getTaskModel();
            string strErr = "";

            if (ckboxCOther.Checked && model.F_COther.Length == 0)
            {
                strErr += LanguageResource.Language.GbVerifyItems + ">" + LanguageResource.Language.Tip_OtherInfoNoEmpty + "!\n";
            }
            if (model.F_Note.Trim().Length == 0)
            {
                strErr += LanguageResource.Language.Tip_RemarkNoEmpty + "!\n";
            }

            if (model.F_URInfo.Trim().Length == 0)
            {
                strErr += LanguageResource.Language.Tip_CreateWorkNeedUserAndRoleInfo + "!\\n";
            }
            if (strErr != "")
            {
                MsgBox.Show(strErr, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            ComitDoControl(false);
            if (_tasktype.HasValue && SystemConfig.WillCallServicesWorkOrder.ContainsKey(_tasktype.Value))
            { //1 create work order 2 action
                msgCommand cmd = (msgCommand)Enum.Parse(typeof(msgCommand), SystemConfig.WillCallServicesWorkOrder[_tasktype.Value]);
                GSSModel.Request.RoleData role = new GSSModel.Request.RoleData()
                {
                    UserID    = UserID.Value,
                    RoleID    = RoleID.Value,
                    BigZoneId = BigZoneID,
                    ZoneId    = ZoneID
                };
                _clienthandle.BindCommandWithSend(cmd, this.Handle.ToInt32(), model, role);//setup:create task 2:recovery role
            }
            else
            {
                model.F_GameBigZone = BigZoneID.ToString();
                model.F_GameZone    = ZoneID.ToString();
                _clienthandle.AddTask(model);
            }
        }