Exemple #1
0
        protected override void DefWndProc(ref System.Windows.Forms.Message m)
        {
            switch (m.Msg)
            {//save data response
            case 601:
                this.Activate();
                string.Format("class:{0}, Msg:{1},m.LParam:{2},HWnd:{3},WParam:{4}", typeof(FormTaskAddGameNotice2).Name, m.Msg, m.LParam.ToString(), m.HWnd.ToString(), m.WParam.ToString()).Logger();
                string index = m.LParam.ToString();
                if (Convert.ToInt32(index) == 0)
                {
                    index = m.WParam.ToString();
                }
                int    ind = int.Parse(index) - 1;
                object obj = ShareData.Msg[ind];
                ShareData.Msg.RemoveAt(ind);
                GSSModel.Request.ClientData data = obj as GSSModel.Request.ClientData;
                if (data.Success)
                {
                    MsgBox.Show(string.Format(LanguageResource.Language.Tip_WorkOrderCreateSucc), LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
                else
                {
                    MsgBox.Show(data.Message, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                break;

            default:
                base.DefWndProc(ref m);
                break;
            }
        }
        private void TaskDetailCall(object data)
        {
            "Call back is into the parent form".Logger();
            CallBackEventParam p = data as CallBackEventParam;

            p.NowForm.Close();
            GSSModel.Request.Unlock ul = p.CallData as GSSModel.Request.Unlock;
            if (string.IsNullOrEmpty(ul.Remark))
            {
                "no input remark,refuse unlock".Logger();
                MsgBox.Show(LanguageItems.BaseLanguageItem.Tip_RemarkNoEmpty, LanguageItems.BaseLanguageItem.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            ul.UserId = UserID.Value;
            if (RoleID.HasValue)
            {
                ul.RoleId = RoleID.Value;
            }
            Tasks task = getTaskModel();

            GSSModel.Request.ClientData client = new GSSModel.Request.ClientData();
            client.FormID = this.Handle.ToInt32();
            TaskContainerLogicData tl = new TaskContainerLogicData()
            {
                WorkOrder = task,
                LogicData = ul
            };

            client.Data = tl;
            "do submit to service".Logger();
            _clienthandle.SendTaskContainerLogicData(client);
        }
        public void SendEmail(int formId, GSSModel.Request.ClientData clientparam)
        {
            MsgStruts msg = new MsgStruts()
            {
                msgtype = msgType.SendText, command = msgCommand.SendEmailToRoles, msgsendstate = msgSendState.single
            };

            msg.Data = _coder.GetEncodBytes(clientparam);
            _tcpcli.Send(msg);
        }
Exemple #4
0
        private void BtnSendEmail(GSSModel.SendEmailToRole roles)
        {
            roles.Head = rtbEmailHead.Text;
            roles.Body = rtbEmailBody.Text;
            if (cbHavaEquip.Checked)
            {
                int temp;
                temp           = int.Parse(txtEquipID.Text);
                roles.EquipId  = temp;
                temp           = int.Parse(txtEquipSizeOf.Text);
                roles.EquipNum = temp;
            }
            string        id       = cmbBigZone.GetComboBoxSelectValue();//必须选择大区和战区
            bool          lackItem = true;
            StringBuilder sb       = new StringBuilder();

            if (!string.IsNullOrEmpty(id))
            {
                roles.BigZoneId = int.Parse(id);
                id = cmbZone.GetComboBoxSelectValue();
                if (!string.IsNullOrEmpty(id))
                {
                    lackItem     = false;
                    roles.ZoneId = int.Parse(id);
                }
            }
            if (lackItem)
            {
                sb.AppendLine(LanguageResource.Language.Tip_PleaseSelectBigZoneAndZone);
            }
            if (string.IsNullOrEmpty(roles.Head) || string.IsNullOrEmpty(roles.Body))
            {
                sb.AppendLine(LanguageResource.Language.Tip_EmailInfoIsRequired);
            }
            if (!string.IsNullOrEmpty(sb.ToString()))
            {
                MsgBox.Show(sb.ToString(), LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            roles.StartTime = dtpStartTime.Value;
            roles.EndTime   = dtpEndTime.Value;
            if (roles.StartTime > roles.EndTime)
            {
                MsgBox.Show(LanguageResource.Language.Tip_StartTimeShouldLessEndTime, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            //由于导入的角色数据不可控,此处不进行工单建立
            int formId = this.Handle.ToInt32();

            GSSModel.Request.ClientData data = new GSSModel.Request.ClientData()
            {
                FormID = formId, Data = roles
            };
            Client.SendEmail(formId, data);
        }
        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);
        }
        public void SendTaskContainerLogicData(GSSModel.Request.ClientData data)
        {
            MsgStruts str = new MsgStruts()
            {
                msgsendstate = msgSendState.single,
                msgtype      = msgType.SendText,
                command      = msgCommand.CreateTaskContainerLogic
            };

            str.Data = DataSerialize.GetByteFromObject(data);
            string.Format("command:[{0}] Client send service bytes:[{1}]", str.command, str.Data.Length);
            _tcpcli.Send(str);
        }
        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);
        }
        public void AddFullServiceEmail(int formId, GSSModel.Request.LoginAwardTask awardTask)
        {
            MsgStruts msg = new MsgStruts();

            msg.command      = msgCommand.AddFullServiceEmail;
            msg.msgtype      = msgType.SendText;
            msg.msgsendstate = msgSendState.single;
            GSSModel.Request.ClientData data = new GSSModel.Request.ClientData()
            {
                FormID = formId, Data = awardTask
            };
            msg.Data = DataSerialize.GetByteFromObject(data);
            _tcpcli.Send(msg);
        }
Exemple #9
0
        //private void treeView1_AfterCheck(object sender, TreeViewEventArgs e)
        //{
        //    if (e.Action == TreeViewAction.ByMouse)
        //    {

        //        //取消节点选中状态之后,取消所有父节点的选中状态
        //        setChildNodeCheckedState(e.Node, e.Node.Checked);
        //        //如果节点存在父节点,取消父节点的选中状态
        //        if (e.Node.Parent != null)
        //        {
        //            setParentNodeCheckedState(e.Node, e.Node.Checked);
        //        }

        //        //if (e.Node.Checked)
        //        //{
        //        //    //取消节点选中状态之后,取消所有父节点的选中状态
        //        //    setChildNodeCheckedState(e.Node, true);
        //        //}
        //        //else
        //        //{
        //        //    //取消节点选中状态之后,取消所有父节点的选中状态
        //        //    setChildNodeCheckedState(e.Node, false);
        //        //    //如果节点存在父节点,取消父节点的选中状态
        //        //    if (e.Node.Parent != null)
        //        //    {
        //        //        setParentNodeCheckedState(e.Node, false);
        //        //    }
        //        //}
        //    }
        //}
        ////取消节点选中状态之后,取消所有父节点的选中状态
        //void setParentNodeCheckedState(TreeNode currNode, bool state)
        //{
        //    TreeNode parentNode = currNode.Parent;
        //    parentNode.Checked = state;

        //    int num=0;
        //    for (int i=0;i<parentNode.Nodes.Count;i++)
        //    {
        //        if (parentNode.Nodes[i].Checked)
        //        {
        //            num++;
        //        }
        //    }

        //    if (num>0&&!state)
        //    {
        //        parentNode.StateImageIndex = 2;
        //    }

        //    if (currNode.Parent.Parent != null)
        //    {
        //        setParentNodeCheckedState(currNode.Parent, state);
        //    }
        //}
        ////选中节点之后,选中节点的所有子节点
        //void setChildNodeCheckedState(TreeNode currNode, bool state)
        //{
        //    TreeNodeCollection nodes = currNode.Nodes;
        //    if (nodes.Count > 0)
        //        foreach (TreeNode tn in nodes)
        //        {
        //            tn.Checked = state;
        //            setChildNodeCheckedState(tn, state);
        //        }
        //}

        //        // 调用 BuildTree 方法来创建 TreeView
        //CreateTreeViewFromDataTable.BuildTree(
        //    this._dtEmployees, this.treeView1,
        //    true, "名字", "员工标识", "上级");

        private void Button_Click(object sender, EventArgs e)
        {//创建并立即执行
            GSSModel.Tasks task = GetTaskData();
            GSSModel.TaskContainerLogicData wl = new GSSModel.TaskContainerLogicData()
            {
                WorkOrder = task,
                LogicData = new GSSModel.Request.RunTask()
                {
                    Command = GSSCSFrameWork.msgCommand.GameNoticeStart.ToString()
                }
            };
            GSSModel.Request.ClientData cd = new GSSModel.Request.ClientData()
            {
                Data   = wl,
                FormID = this.Handle.ToInt32()
            };
            _clienthandle.SendTaskContainerLogicData(cd);
        }
Exemple #10
0
 protected override void DefWndProc(ref System.Windows.Forms.Message m)
 {
     if (m.Msg == SystemConfig.BetweenFormChatMsgId)
     {//这是自定义的窗体键信息通讯
         int msgid = m.WParam.ToInt32() - 1;
         GSSModel.Request.ClientData arr = ShareData.Msg[msgid] as GSSModel.Request.ClientData;
         if (arr.Success)
         {
             MsgBox.Show(LanguageResource.Language.BtnWorkorderDealwithOK, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
             this.Close();
             return;
         }
         string error = arr.Message as string;
         MsgBox.Show(error, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     base.DefWndProc(ref m);
 }
        /// <summary>
        /// 窗口之间消息
        /// </summary>
        /// <param name="m"></param>
        protected override void DefWndProc(ref System.Windows.Forms.Message m)
        {
            switch (m.Msg)
            {
            case 601:
                string.Format("class:{0}, Msg:{1},m.LParam:{2},HWnd:{3},WParam:{4}", typeof(FormTaskAdd).Name, m.Msg, m.LParam.ToString(), m.HWnd.ToString(), m.WParam.ToString()).Logger();
                this.Activate();
                string shareMsgPosition = m.LParam.ToString();
                int    index            = Convert.ToInt32(shareMsgPosition) - 1;
                if (index >= 0)
                {    //存在异常信息
                    //逻辑优化前
                    object obj = ShareData.Msg[index];
                    GSSModel.Request.ClientData data = obj as GSSModel.Request.ClientData;
                    string.Format("class:[{0}] new flow call return result= [{1}],message=[{2}]", typeof(FormTaskAdd).Name, data.Success, data.Message).Logger();
                    //目前这里只有解封账号和角色
                    if (data.Success)
                    {
                        MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateSucc + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                        return;
                    }
                    else
                    {
                        string msg = data.Message;
                        msg.Logger();
                        if (msg == "2016:")
                        {    //调用gamecoredb或者usercoredb只有这一项返回数据时的状态码
                            msg = LanguageItems.BaseLanguageItem.Tip_OnlyStaueIsLockCanDo;
                        }
                        MsgBox.Show(msg, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
                else if (m.WParam.ToString() == "0")
                {
                    _taskid = "0";
                    if (!ckboxDonow.Checked)
                    {
                        MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateFailure, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateFailureWithTool, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    ComitDoControl(true);
                }
                else
                {
                    _taskid = m.WParam.ToString();
                    if (!ckboxDonow.Checked)
                    {
                        MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateSucc + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);

                        this.Close();
                    }
                    else
                    {
                        string Uname = TrimNull(_drguser.Cells[1].Value);
                        string Rname = _drrole == null ? "" : TrimNull(_drrole.Cells[1].Value);
                        if (Uname.Trim().Length == 0)
                        {
                            MsgBox.Show(LanguageResource.Language.Tip_WorkOrderLoseAccountWithInvalid + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        FormToolGuserLock form = new FormToolGuserLock(_clienthandle, 1, _taskid, Uname, Rname);
                        DialogResult      dr   = form.ShowDialog();
                        Application.DoEvents();
                        if (dr == DialogResult.OK)
                        {
                            MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateSuccWithExecute + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            this.Close();
                        }
                        else
                        {
                            ComitDoControl(true);
                        }
                    }
                }
                break;

            default:
                base.DefWndProc(ref m);
                break;
            }
        }