Esempio n. 1
0
        private void btnClose_Click(object sender, EventArgs e)
        {
            var groupID = this.skinTextBox_id.SkinTxt.Text.Trim();

            if (groupID.Length == 0)
            {
                MessageBoxEx.Show("群帐号不能为空!");
                this.DialogResult = System.Windows.Forms.DialogResult.None;
                return;
            }

            try
            {
                var contract = new CreateGroupContract(groupID, this.skinTextBox_name.SkinTxt.Text.Trim(), this.skinTextBox_announce.SkinTxt.Text);
                var bRes     = this.rapidPassiveEngine.CustomizeOutter.Query(InformationTypes.CreateGroup, CompactPropertySerializer.Default.Serialize(contract));
                var res      = (CreateGroupResult)BitConverter.ToInt32(bRes, 0);
                if (res == CreateGroupResult.GroupExisted)
                {
                    MessageBoxEx.Show("同ID的群已经存在!");
                    this.DialogResult = System.Windows.Forms.DialogResult.None;
                    return;
                }

                this.group        = new GGGroup(groupID, contract.Name, this.rapidPassiveEngine.CurrentUserID, "", this.rapidPassiveEngine.CurrentUserID);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            catch (Exception ee)
            {
                MessageBoxEx.Show("创建群失败!" + ee.Message);
                this.DialogResult = System.Windows.Forms.DialogResult.None;
            }
        }
Esempio n. 2
0
        private void btnClose_Click(object sender, EventArgs e)
        {
            string groupID = this.skinTextBox_id.SkinTxt.Text.Trim();
            if (groupID.Length == 0)
            {
                MessageBoxEx.Show("群帐号不能为空!");
                this.DialogResult = System.Windows.Forms.DialogResult.None;
                return;
            }

            try
            {
                CreateGroupContract contract = new CreateGroupContract(groupID, this.skinTextBox_name.SkinTxt.Text.Trim() ,this.skinTextBox_announce.SkinTxt.Text);
                byte[] bRes = this.rapidPassiveEngine.CustomizeOutter.Query(InformationTypes.CreateGroup, CompactPropertySerializer.Default.Serialize(contract));
                CreateGroupResult res = (CreateGroupResult)BitConverter.ToInt32(bRes, 0);
                if (res == CreateGroupResult.GroupExisted)
                {
                    MessageBoxEx.Show("同ID的群已经存在!");
                    this.DialogResult = System.Windows.Forms.DialogResult.None;
                    return;
                }

                this.group = new GGGroup(groupID, contract.Name,this.rapidPassiveEngine.CurrentUserID,"",this.rapidPassiveEngine.CurrentUserID);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            catch (Exception ee)
            {
                MessageBoxEx.Show("创建群失败!" + ee.Message);
                this.DialogResult = System.Windows.Forms.DialogResult.None;
            }
        }