Пример #1
0
        /// <summary>
        /// 行数据更改
        /// </summary>
        private void RowUpdate()
        {
            int id = GetModelID();

            if (id >= 0)
            {
                FrmCustomerCard frmCustomerCard = new FrmCustomerCard();
                frmCustomerCard.Model  = bll.GetModel(id);
                frmCustomerCard.Status = CardEnum.UPDATE;
                frmCustomerCard.ShowDialog();
                if (frmCustomerCard.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    if (bll.Update(frmCustomerCard.Model))
                    {
                        BindData();
                    }
                    else
                    {
                        QQMessageBox.Show(
                            this,
                            string.Format(MessageText.SQL_ERROR_CUSTOMER_UPDATE, frmCustomerCard.Model.CustomerName),
                            MessageText.MESSAGEBOX_CAPTION_WARN,
                            QQMessageBoxIcon.Warning,
                            QQMessageBoxButtons.OK);
                    }
                }
            }
        }
Пример #2
0
 /// <summary>
 /// 行数据查看
 /// </summary>
 private void RowLook()
 {
     if (dataGridView1.SelectedCells.Count == 1 || dataGridView1.SelectedRows.Count == 1)
     {
         int rowIndex = dataGridView1.SelectedCells[0].RowIndex;
         int id       = PhysicalConstants.ERROR_ID;
         try
         {
             id = Convert.ToInt32(dataGridView1.Rows[rowIndex].Cells[ColID.Name].Value);
         }
         catch (Exception ex)
         {
             QQMessageBox.Show(
                 this,
                 string.Format(MessageText.TIP_ERROR_ID, ex.Message),
                 MessageText.MESSAGEBOX_CAPTION_ERROR,
                 QQMessageBoxIcon.Error,
                 QQMessageBoxButtons.OK);
             return;
         }
         FrmCustomerCard frmCustomerCard = new FrmCustomerCard();
         frmCustomerCard.Model  = bll.GetModel(id);
         frmCustomerCard.Status = CardEnum.LOOK;
         frmCustomerCard.ShowDialog();
     }
     else
     {
         QQMessageBox.Show(
             this,
             MessageText.TIP_ERROR_SELECTCOUNT_ONE,
             MessageText.MESSAGEBOX_CAPTION_TIP,
             QQMessageBoxIcon.Information,
             QQMessageBoxButtons.OK);
     }
 }
Пример #3
0
 /// <summary>
 /// 获取ID
 /// </summary>
 /// <returns></returns>
 private int GetModelID()
 {
     if (CheckSelectedCount(1))
     {
         int rowIndex = dataGridView1.SelectedCells[0].RowIndex;
         int id       = PhysicalConstants.ERROR_ID;
         try
         {
             id = Convert.ToInt32(dataGridView1.Rows[rowIndex].Cells[ColID.Name].Value);
         }
         catch (Exception ex)
         {
             QQMessageBox.Show(
                 this,
                 string.Format(MessageText.TIP_ERROR_ID, ex.Message),
                 MessageText.MESSAGEBOX_CAPTION_ERROR,
                 QQMessageBoxIcon.Error,
                 QQMessageBoxButtons.OK);
             return(PhysicalConstants.ERROR_ID);
         }
         return(id);
     }
     else
     {
         return(PhysicalConstants.ERROR_SELECT_COUNT);
     }
 }
Пример #4
0
        private void Update_Room(object sender, RoutedEventArgs e)
        {
            // IniFileEdit iniFileEdit = new IniFileEdit(Login._UserPath);
            // string strPrice = System.Text.RegularExpressions.Regex.Replace(roomPrice.Text, @"[0-9]", "");
            // string strMaxUser = System.Text.RegularExpressions.Regex.Replace(maxUser.Text, @"[0-9]", "");
            //if (strPrice.Length > 0 && strMaxUser.Length > 0)
            //    MessageBoxCommon.Show(iniFileEdit.GetIniValue("StringMessageBox", "Invalid_Number"), MessageBoxType.Ok);
            //else
            //{
            if (roomPass.Password == veriPass.Password)
            {
                Login._RoomInfo.Name = roomBox.Text; //방이름
                Login._RoomInfo.Id   = selectRoomId;
                Login._RoomInfo.Kind = 0;
                //if (roomPrice.Text == "")
                Login._RoomInfo.Cash = 0;
                //else
                //    Login._RoomInfo.Cash = Convert.ToInt32(roomPrice.Text);

                //if (maxUser.Text == "")
                Login._RoomInfo.MaxUsers = 0;
                //else
                //    Login._RoomInfo.MaxUsers = Convert.ToInt32(maxUser.Text);
                Login._RoomInfo.Owner    = roomUpowner;
                Login._RoomInfo.RoomPass = roomPass.Password;
                Login._ClientEngine.Send(NotifyType.Request_UpdateRoom, Login._RoomInfo);
                this.Close();
                //}
            }
            else
            {
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "암호가 일치하지 않습니다.", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
            }
        }
Пример #5
0
 private void buttonSave_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (this.rePass.Password != Login._UserInfo.Password)
         {
             TempWindowForm tempWindowForm = new TempWindowForm();
             QQMessageBox.Show(tempWindowForm, "原始密码输入有误.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
             return;
         }
         else
         {
             if (newPass.Password != newRePass.Password)
             {
                 TempWindowForm tempWindowForm = new TempWindowForm();
                 QQMessageBox.Show(tempWindowForm, "2次输入密码有误请重新输入.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
                 return;
             }
             else
             {
                 Login._UserInfo.Password = newPass.Password;
                 Login._ClientEngine.Send(NotifyType.Request_UpdateUser, Login._UserInfo);
             }
         }
     }
     catch (Exception)
     { }
 }
Пример #6
0
        private void delBt_Click(object sender, RoutedEventArgs e)
        {
            //if (letterDataGrid.SelectedIndex < 0)
            //    return;

            SendData sendData = (SendData)letterDataGrid.SelectedItem;

            TempWindowForm tempWindowForm = new TempWindowForm();

            if (sendData == null)
            {
                QQMessageBox.Show(tempWindowForm, "请选择需要删除的题目", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
                return;
            }

            if (QQMessageBox.Show(tempWindowForm, "您确定要删除吗?", "提示", QQMessageBoxIcon.Question, QQMessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }

            Login._BoardInfo.Id = sendData.id;
            if (Main.notice_board == true)
            {
                Login._ClientEngine.Send(NotifyType.Request_DelNotice, Login._BoardInfo);
            }
            else
            {
                Login._ClientEngine.Send(NotifyType.Request_DelLetter, Login._BoardInfo);
            }
        }
Пример #7
0
 private void SaveData()
 {
     if (dataGridView1.SelectedRows.Count == 1)
     {
         DateTime dt;
         this.studentid   = zDataConverter.ToInt(dataGridView1.SelectedRows[0].Cells[ColStudentID.Name].Value);
         this.studentcode = zDataConverter.ToString(dataGridView1.SelectedRows[0].Cells[ColStudentCode.Name].Value);
         this.studentname = zDataConverter.ToString(dataGridView1.SelectedRows[0].Cells[ColStudentName.Name].Value);
         this.phone       = zDataConverter.ToString(dataGridView1.SelectedRows[0].Cells[ColPhone.Name].Value);
         if (DateTime.TryParse(zDataConverter.ToString(dataGridView1.SelectedRows[0].Cells[ColBirthDay.Name].Value), out dt))
         {
             this.birthday = dt;
         }
         this.age          = zDataConverter.ToInt(dataGridView1.SelectedRows[0].Cells[ColAge.Name].Value);
         this.description  = zDataConverter.ToString(dataGridView1.SelectedRows[0].Cells[ColDescription.Name].Value);
         this.DialogResult = System.Windows.Forms.DialogResult.OK;
         this.Close();
     }
     else
     {
         QQMessageBox.Show(
             this,
             MessageText.TIP_ERROR_SELECTCOUNT_ONE,
             MessageText.MESSAGEBOX_CAPTION_TIP,
             QQMessageBoxIcon.Information,
             QQMessageBoxButtons.OK);
     }
 }
Пример #8
0
 private void btnPreview_Click(object sender, EventArgs e)
 {
     if (File.Exists(tbFilePath.Text))
     {
         try
         {
             dataGridView1.DataSource = ExcelOptioner.Import(tbFilePath.Text);
         }
         catch
         {
             QQMessageBox.Show(
                 this,
                 MessageText.TIP_FILE_INVALID,
                 MessageText.MESSAGEBOX_CAPTION_TIP,
                 QQMessageBoxIcon.Information,
                 QQMessageBoxButtons.OK);
         }
     }
     else
     {
         QQMessageBox.Show(
             this,
             MessageText.TIP_FILE_NON_EXIST,
             MessageText.MESSAGEBOX_CAPTION_TIP,
             QQMessageBoxIcon.Information,
             QQMessageBoxButtons.OK);
     }
 }
Пример #9
0
        public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo)
        {
            switch (notifyType)
            {
            case NotifyType.Reply_UpdateUser:
            {
                UserInfo userName = (UserInfo)baseInfo;
                Login._UserInfo.Point = userName.Point;

                gridRight.Visibility = Visibility.Hidden;
                backGrid.Visibility  = Visibility.Visible;
                ChatClient.Home_MyInfo.ConvPointToCash convPointToCash = new Home_MyInfo.ConvPointToCash();

                backGrid.Children.Clear();
                backGrid.Children.Add(convPointToCash);

                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "更新成功", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
            }
            break;

            case NotifyType.Reply_UserInfo:
            {
                Login._UserInfo               = (UserInfo)baseInfo;
                this.txtCashAmount.Content    = Login._UserInfo.Cash.ToString();
                this.txtChangingMoney.Content = (Login._UserInfo.Cash / 100 * 90).ToString();
            }
            break;
            }
        }
Пример #10
0
        void item2_Click(object sender, RoutedEventArgs e)
        {
            //if (MessageBoxCommon.Show("您确定要删除吗?", MessageBoxType.YesNo) == MessageBoxReply.No)
            //    return;
            TempWindowForm tempWindowForm = new TempWindowForm();

            if (QQMessageBox.Show(tempWindowForm, "您确定要删除吗?", "提示", QQMessageBoxIcon.Question, QQMessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }

            var    selectMenu = sender as MenuItem;
            string imgIcon    = selectMenu.DataContext.ToString();

            if (imgIcon == Login._UserInfo.Icon)
            {
                QQMessageBox.Show(tempWindowForm, "已设定在头像的图片不能删除.", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
                //MessageBoxCommon.Show("已设定在头像的图片不能删除.", MessageBoxType.Ok);
            }
            else
            {
                for (int i = 0; i < Login.myhome.iconInfoList.Count; i++)
                {
                    if (imgIcon == System.Windows.Forms.Application.StartupPath + "\\" + Login.myhome.iconInfoList[i].Icon.Replace("/", "\\"))
                    {
                        Login._ClientEngine.Send(NotifyType.Request_IconRemove, Login.myhome.iconInfoList[i]);

                        break;
                    }
                }
            }
        }
Пример #11
0
        public void InitAllControlValues(bool bUpdate)
        {
            nFlag = 0;

            if (bUpdate)
            {
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "资料注册成功", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
                //MessageBoxCommon.Show("조작이 성공하였습니다.", MessageBoxType.Ok);
            }

            if (!string.IsNullOrEmpty(Login._UserInfo.strAccountID))
            {
                this.txtBankAccountID.Text = Login._UserInfo.strAccountID;
            }

            if (!string.IsNullOrEmpty(Login._UserInfo.strAccountNumber))
            {
                this.txtBankAccountNumber.Text = Login._UserInfo.strAccountNumber;
            }

            if (!string.IsNullOrEmpty(Login._UserInfo.strAccountID) && !string.IsNullOrEmpty(Login._UserInfo.strAccountNumber))
            {
                nFlag = 1;

                this.txtBankAccountID.IsEnabled     = false;
                this.txtBankAccountNumber.IsEnabled = false;

                this.lblPassword1.Content = "原始密码";
                this.lblPassword2.Content = "新密码";

                this.btnSaveOrChange.Content = "变更";
            }
        }
Пример #12
0
        private void open_MouseDown(object sender, MouseButtonEventArgs e)
        {
            _LoadWorker                     = new BackgroundWorker();
            _LoadWorker.DoWork             += new System.ComponentModel.DoWorkEventHandler(this.LoadWorker_DoWork);
            _LoadWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_LoadWorker_RunWorkerCompleted);

            Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
            ofd.Filter = "mp3 (*.mp3)|*.mp3|wma (*.wma)|*.wma";

            Nullable <bool> result = ofd.ShowDialog();

            if (result == true)
            {
                System.IO.FileInfo fileSize = new System.IO.FileInfo(ofd.FileName);
                if (fileSize.Length > 5000000)
                {
                    //MessageBoxCommon.Show("Overflow mp3 Size.", MessageBoxType.Ok);
                    //return;

                    TempWindowForm tempWindowForm = new TempWindowForm();
                    QQMessageBox.Show(tempWindowForm, "Overflow mp3 Size.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
                }

                char[]   delimiterChars = { ':', '\\' };
                string[] words          = ofd.FileName.Split(delimiterChars);
                int      count          = words.Length;
                musicname = words[count - 1].ToString();
                string filename = ofd.FileName;
                lstMediaItems.Items.Add(musicname);
                musicList.Add(filename);


                _LoadWorker.RunWorkerAsync();
            }
        }
Пример #13
0
        public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo)
        {
            switch (notifyType)
            {
            case NotifyType.Notify_Socket:
            {
                QQMessageBox.Show(_ProgressForm, "服务器连接失败", "消息", QQMessageBoxIcon.Warning, QQMessageBoxButtons.OK);
                Environment.Exit(0);
            }
            break;

            case NotifyType.Reply_Server:
            {
                _ServerInfo   = (ServerInfo)baseInfo;
                _DownloadPath = _UpdateIni.GetIniValue("DownloadServer", "URL") + "/" + _ServerInfo.DownloadAddress;

                if (_DownloadPath[_DownloadPath.Length - 1] != '/')
                {
                    _DownloadPath += '/';
                }

                string localRoot = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory + "\\..\\");
                WebDownloader.localRoot = localRoot;

                WebDownloader.progressForm = _ProgressForm;
                WebDownloader.GetInstance().DownloadFile("server.version", DownloadVersionCompleted, _DownloadPath);
            }
            break;
            }
        }
Пример #14
0
        private void btnPayment_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            int nChangeMoney = Login._UserInfo.Cash / 100 * 90;

            nInputChangeMoney = 0;

            if (!this.txtBankAccountNumber.Text.Equals(Login._UserInfo.strAccountNumber))
            {
                //MessageBoxCommon.Show("계좌번호가 일치하지 않습니다.", MessageBoxType.Ok);
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "계좌번호가 일치하지 않습니다.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
                this.txtBankAccountNumber.Text = string.Empty;
                this.txtBankAccountNumber.Focus();
                return;
            }

            if (!this.txtBankAccountID.Text.Equals(Login._UserInfo.strAccountID))
            {
                //MessageBoxCommon.Show("계좌아이디가 일치하지 않습니다.", MessageBoxType.Ok);
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "계좌아이디가 일치하지 않습니다.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
                this.txtBankAccountID.Text = string.Empty;
                this.txtBankAccountID.Focus();
                return;
            }

            try
            {
                nInputChangeMoney = Convert.ToInt32(this.txtChangeMoney.Text);
                if (nInputChangeMoney > nChangeMoney)
                {
                    //MessageBoxCommon.Show("변한금액량이 너무 많습니다.", MessageBoxType.Ok);
                    TempWindowForm tempWindowForm = new TempWindowForm();
                    QQMessageBox.Show(tempWindowForm, "结算金额有误请重新输入", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
                    this.txtChangeMoney.Text = string.Empty;
                    this.txtChangeMoney.Focus();
                    return;
                }

                if (!this.txtPassword.Password.Equals(Login._UserInfo.strAccountPass))
                {
                    //MessageBoxCommon.Show("비밀번호가 일치하지 않습니다.", MessageBoxType.Ok);
                    TempWindowForm tempWindowForm = new TempWindowForm();
                    QQMessageBox.Show(tempWindowForm, "次输入密码有误请重新输入", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
                    this.txtPassword.Password = string.Empty;
                    this.txtPassword.Focus();
                    return;
                }
            }
            catch (System.Exception)
            {
                //MessageBoxCommon.Show("변환금액을 정확히 입력해주세요.", MessageBoxType.Ok);
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "结算金额有误请重新输入", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
                return;
            }

            RequestPaymentToServer();
        }
Пример #15
0
 private void tsBtnCloseCourse_Click(object sender, EventArgs e)
 {
     if (QQMessageBox.Show(this, "确定关闭课程吗?", MessageText.MESSAGEBOX_CAPTION_WARN, QQMessageBoxIcon.Warning, QQMessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
     {
         this.DialogResult = System.Windows.Forms.DialogResult.No;
         this.Close();
     }
 }
Пример #16
0
 private void qqButton3_Click(object sender, EventArgs e)
 {
     QQMessageBox.Show(
         this,
         "更改用户信息成功!",
         "提示",
         QQMessageBoxIcon.OK,
         QQMessageBoxButtons.OK);
 }
Пример #17
0
 private void qqButton2_Click(object sender, EventArgs e)
 {
     QQMessageBox.Show(
         this,
         "删除成功",
         "提示",
         QQMessageBoxIcon.Error,
         QQMessageBoxButtons.OKCancel);
 }
Пример #18
0
        private void EnterGame(int nGameType)
        {
            if (Main.activeGame != null)
            {
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "你必须选择一个游戏", "提示", QQMessageBoxIcon.Warning, QQMessageBoxButtons.OK);

                return;
            }

            // modified by usc at 2014/02/09
            if (Main.m_bGameRunning)
            {
                return;
            }

            //if (_gameInfo.Source != "Dice" && nGameType == 0)
            //{
            //    TempWindowForm tempWindowForm = new TempWindowForm();
            //    QQMessageBox.Show(tempWindowForm, "游戏测试中...", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
            //    return;
            //}

            GameInfo enterGameinfo = new GameInfo();

            enterGameinfo._NotifyHandler   = _gameInfo._NotifyHandler;
            enterGameinfo.Bank             = _gameInfo.Bank;
            enterGameinfo.Commission       = _gameInfo.Commission;
            enterGameinfo.GameId           = (Convert.ToInt32(_gameInfo.GameId) + nGameType).ToString();
            enterGameinfo.GameName         = _gameInfo.GameName;
            enterGameinfo.Height           = _gameInfo.Height;
            enterGameinfo.Icon             = _gameInfo.Icon;
            enterGameinfo.nCashOrPointGame = nGameType;
            enterGameinfo.Source           = _gameInfo.Source;
            enterGameinfo.UserCount        = _gameInfo.UserCount;
            enterGameinfo.Width            = _gameInfo.Width;

            Login._UserInfo.GameId           = enterGameinfo.GameId;
            Login._UserInfo.nCashOrPointGame = enterGameinfo.nCashOrPointGame;

            Main.m_bGameRunning = true;

            Dispatcher.BeginInvoke(new System.Threading.ThreadStart(delegate
            {
                if (Main.loadWnd == null)
                {
                    Main.loadWnd       = new LoadingWnd();
                    Main.loadWnd.Owner = Main.GetParentWindow(this);
                    Main.loadWnd.ShowDialog();
                }
            }));


            Login._ClientEngine.Send(NotifyType.Request_EnterGame, enterGameinfo);
        }
Пример #19
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            _bChanged = true;
            if (userNicname.Text == "")
            {
                //MessageBoxCommon.Show("请输入您的称号.", MessageBoxType.Ok);
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "请输入您的称号.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
            }
            else
            {
                Login._UserInfo.Id       = userId.Content.ToString();
                Login._UserInfo.Nickname = userNicname.Text;
                Login._UserInfo.Address  = userEmailAddress.Text;
                Login._UserInfo.Sign     = signBox.Text;

                if (Login._UserInfo.Kind == (int)UserKind.ServiceWoman)
                {
                    if (this.chkAllGuest.IsChecked == true)
                    {
                        Login._UserInfo.nVIP = 1;
                    }
                    else
                    {
                        Login._UserInfo.nVIP = 0;
                    }
                }

                try
                {
                    Login._UserInfo.Year  = Convert.ToInt32(userYear.SelectedItem.ToString());
                    Login._UserInfo.Month = Convert.ToInt32(userMonth.SelectedItem.ToString());
                    Login._UserInfo.Day   = Convert.ToInt32(userDay.SelectedItem.ToString());
                }
                catch (Exception)
                {
                }

                //if(!rePass.Password.Equals(Login._UserInfo.Password))
                //{
                //    TempWindowForm tempWindowForm = new TempWindowForm();
                //    QQMessageBox.Show(tempWindowForm, "原始密码输入有误.", "提示", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
                //    return;
                //}

                //if (!CheckPassword(newPass.Password, userId.Content.ToString()))
                //{
                //    return;
                //}

                //Login._UserInfo.Password = newPass.Password;
                Login._ClientEngine.Send(NotifyType.Request_UpdateUser, Login._UserInfo);
            }
        }
Пример #20
0
        /// <summary>
        /// 多行记录删除
        /// </summary>
        private void RowsDelete()
        {
            List <int> indexs = GetSelectedRowsIndex();

            if (indexs.Count > 0)
            {
                string sIDs = string.Empty;
                string sID;
                //构建删除ID
                foreach (int i in indexs)
                {
                    sID = zDataConverter.ToString(dataGridView1.Rows[i].Cells[ColID.Name].Value);
                    if (sID.Length > 0)
                    {
                        sIDs += MessageText.KEY_COMMA + sID;
                    }
                }
                if (sIDs.Length > 0)
                {
                    //执行数据库删除
                    if (!bll.DeleteMultiple(sIDs.Substring(1)))
                    {
                        QQMessageBox.Show(
                            this,
                            MessageText.SQL_ERROR_CUSTOMER_DELETE,
                            MessageText.MESSAGEBOX_CAPTION_ERROR,
                            QQMessageBoxIcon.Error,
                            QQMessageBoxButtons.OK);
                        return;
                    }
                }
                //由下向上移除行
                indexs.Sort();
                for (int i = indexs.Count - 1; i >= 0; i--)
                {
                    dataGridView1.Rows.RemoveAt(indexs[i]);
                }
                QQMessageBox.Show(
                    this,
                    MessageText.TIP_SUCCESS_DELETE,
                    MessageText.MESSAGEBOX_CAPTION_TIP,
                    QQMessageBoxIcon.OK,
                    QQMessageBoxButtons.OK);
            }
            else
            {
                QQMessageBox.Show(
                    this,
                    MessageText.TIP_ERROR_SELECTCOUNT_NULL,
                    MessageText.MESSAGEBOX_CAPTION_TIP,
                    QQMessageBoxIcon.Information,
                    QQMessageBoxButtons.OK);
            }
        }
Пример #21
0
        private void btnSet_Click(object sender, EventArgs e)
        {
            try
            {
                //启动项
                if (this.AutorunCheck.Checked)
                {
                    RegistryManager.CheckAutoRun(true);
                }
                else
                {
                    RegistryManager.DeleteKey();
                }

                if (MemCleanCheck.Checked)
                {
                    MemCleanCheck.Checked = true;
                    Thread newThread = new Thread(new ThreadStart(myTimer));
                    newThread.Start();
                }

                if (AutorunCheck.Checked == true && MemCleanCheck.Checked == true)
                {
                    ShowTipBallon();
                    QQMessageBox.Show(this, "已设置开机启动,已开启内存整理", "提示", QQMessageBoxIcon.Information, QQMessageBoxButtons.OK);
                }
                else
                if (AutorunCheck.Checked == false && MemCleanCheck.Checked == true)
                {
                    ShowTipBallon();
                    QQMessageBox.Show(this, "已取消开机启动,已开启内存整理", "提示", QQMessageBoxIcon.Information, QQMessageBoxButtons.OK);
                }
                else
                if (AutorunCheck.Checked == true && MemCleanCheck.Checked == false)
                {
                    QQMessageBox.Show(this, "已设置开机启动,已取消内存整理", "提示", QQMessageBoxIcon.Information, QQMessageBoxButtons.OK);
                }
                else
                {
                    QQMessageBox.Show(this, "已取消开机启动,已取消内存整理", "提示", QQMessageBoxIcon.Information, QQMessageBoxButtons.OK);
                }
                ////信息
                //string info = (this.AutorunCheck.Checked ? "添加启动项成功!" : "删除启动项成功!");
                ////提示
                //MessageBox.Show(info, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            catch (Exception ex)
            {
                QQMessageBox.Show(this, "应用设置时出现错误!\n\n" + ex.Message, "错误", QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
            }
        }
Пример #22
0
        private void BindData()
        {
            List <XF.Model.Course_SelectionStudent> models = bll.GetDetailModelListByDateLessonNO(DateTime.Now, zDataConverter.ToInt((cmbLesson.SelectedItem as ListItem).Value));

            xfDataGridView1.Rows.Clear();
            foreach (XF.Model.Course_SelectionStudent model in models)
            {
                int count = xfDataGridView1.RowCount;
                xfDataGridView1.Rows.Add();
                xfDataGridView1.Rows[count].Cells[ColSelectionStudentID.Name].Value = model.SelectionStudentID;
                xfDataGridView1.Rows[count].Cells[ColSignType.Name].Value           = model.SignType;
                xfDataGridView1.Rows[count].Cells[ColStudentID.Name].Value          = model.StudentID;
                xfDataGridView1.Rows[count].Cells[ColStudentName.Name].Value        = model.StudentName;
                xfDataGridView1.Rows[count].Cells[ColNickName.Name].Value           = model.NickName;
                if (model.ClassroomID >= 0)
                {
                    xfDataGridView1.Rows[count].Cells[ColClassRoomID.Name].Value = "教室" + MessageText.LIST_NUMBER_CHINESE[model.ClassroomID];
                }
                else
                {
                    QQMessageBox.Show(this, "教室数据异常,请联系管理员", MessageText.MESSAGEBOX_CAPTION_ERROR, QQMessageBoxIcon.Error, QQMessageBoxButtons.OK);
                    return;
                }
                xfDataGridView1.Rows[count].Cells[ColCourseID.Name].Value  = model.CourseID;
                xfDataGridView1.Rows[count].Cells[ColCourse.Name].Value    = model.CourseName;
                xfDataGridView1.Rows[count].Cells[ColSectionNO.Name].Value = model.SectionNO;
                xfDataGridView1.Rows[count].Cells[ColTeacherID.Name].Value = model.TeacherID;
                xfDataGridView1.Rows[count].Cells[ColTeacher.Name].Value   = string.Format("{0}-{1}", model.TeacherCode, model.TeacherName);
                switch ((SignTypeEnum)model.SignType)
                {
                case SignTypeEnum.NORMAL:
                    xfDataGridView1.Rows[count].Cells[ColNormal.Name].Value = true;
                    break;

                case SignTypeEnum.LATE:
                    xfDataGridView1.Rows[count].Cells[ColLate.Name].Value = true;
                    break;

                case SignTypeEnum.EARLY:
                    xfDataGridView1.Rows[count].Cells[ColEarly.Name].Value = true;
                    break;

                case SignTypeEnum.LEAVE:
                    xfDataGridView1.Rows[count].Cells[ColLeave.Name].Value = true;
                    break;

                default:
                    break;
                }
            }
            lstUpdate.Clear();
        }
Пример #23
0
 private void okBt_Click(object sender, RoutedEventArgs e)
 {
     if (_veriPass == passwordRoom.Password)
     {
         Login._ClientEngine.Send(NotifyType.Request_EnterRoom, verifyRoomInfo);
         this.Close();
     }
     else
     {
         TempWindowForm tempWindowForm = new TempWindowForm();
         QQMessageBox.Show(tempWindowForm, "암호가 틀립니다.", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
     }
 }
Пример #24
0
        private void viewBt_Click(object sender, RoutedEventArgs e)
        {
            if (letterDataGrid.SelectedIndex < 0)
            {
                TempWindowForm tempWindowForm = new TempWindowForm();
                QQMessageBox.Show(tempWindowForm, "请选择需要删除的题目", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
                return;
            }

            SendData selectedFile = (SendData)letterDataGrid.Items[letterDataGrid.SelectedIndex];

            nSelectId = selectedFile.id;


            if (Main.notice_board == true)
            {
                for (int i = 0; i < Login._HomeInfo.Notices.Count; i++)
                {
                    if (Login._HomeInfo.Notices[i].Id == nSelectId)
                    {
                        Main.writeSend                     = new WriteSend();
                        Main.writeSend.title.Text          = Login._HomeInfo.Notices[i].Title;
                        Main.writeSend.contents.Text       = Login._HomeInfo.Notices[i].Content;
                        Main.writeSend.title.IsReadOnly    = true;
                        Main.writeSend.contents.IsReadOnly = true;
                        Main.writeSend.btFlag              = false;
                        Main.writeSend.Show();
                    }
                }

                Login._BoardInfo.Id = nSelectId;
                Login._ClientEngine.Send(NotifyType.Request_ReadNotice, Login._BoardInfo);
            }
            else
            {
                for (int i = 0; i < Login.noticeList.Count; i++)
                {
                    if (Login.noticeList[i].Id == nSelectId)
                    {
                        Main.writeSend                     = new WriteSend();
                        Main.writeSend.title.Text          = Login.noticeList[i].Title;
                        Main.writeSend.contents.Text       = Login.noticeList[i].Content;
                        Main.writeSend.title.IsReadOnly    = true;
                        Main.writeSend.contents.IsReadOnly = true;
                        Main.writeSend.btFlag              = false;
                        Main.writeSend.Show();
                    }
                }
            }
        }
Пример #25
0
 private void cmbLesson_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lstUpdate.Count > 0)
     {
         if (QQMessageBox.Show(this, MessageText.TIP_DONT_SAVE_DATA, MessageText.MESSAGEBOX_CAPTION_TIP, QQMessageBoxIcon.Question, QQMessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
         {
             BindData();
         }
     }
     else
     {
         BindData();
     }
 }
Пример #26
0
        /// <summary>
        /// 学员信息删除
        /// </summary>
        private void StudentRowsDelete()
        {
            List <int> indexs = GetSelectedRowsIndex(xfDataGridView2);

            if (indexs.Count > 0)
            {
                string sIDs = string.Empty;
                string sID;
                //构建删除ID
                foreach (int i in indexs)
                {
                    sID = zDataConverter.ToString(xfDataGridView2.Rows[i].Cells[ColStudentID.Name].Value);
                    if (sID.Length > 0)
                    {
                        sIDs += MessageText.KEY_COMMA + sID;
                    }
                }
                if (sIDs.Length > 0)
                {
                    //执行数据库删除
                    if (!bllStudent.DeleteMultiple(sIDs.Substring(1)))
                    {
                        QQMessageBox.Show(
                            this,
                            MessageText.SQL_ERROR_STUDENT_DELETE,
                            MessageText.MESSAGEBOX_CAPTION_ERROR,
                            QQMessageBoxIcon.Error,
                            QQMessageBoxButtons.OK);
                        return;
                    }
                }
                BindStudentData();
                QQMessageBox.Show(
                    this,
                    MessageText.TIP_SUCCESS_DELETE,
                    MessageText.MESSAGEBOX_CAPTION_TIP,
                    QQMessageBoxIcon.OK,
                    QQMessageBoxButtons.OK);
            }
            else
            {
                QQMessageBox.Show(
                    this,
                    MessageText.TIP_ERROR_SELECTCOUNT_NULL,
                    MessageText.MESSAGEBOX_CAPTION_TIP,
                    QQMessageBoxIcon.Information,
                    QQMessageBoxButtons.OK);
            }
        }
Пример #27
0
 public void NotifyOccured(NotifyType notifyType, Socket socket, BaseInfo baseInfo)
 {
     switch (notifyType)
     {
     case NotifyType.Reply_PaymentInfo:
     {
         //MessageBoxCommon.Show("조작이 성공하였습니다.", MessageBoxType.Ok);
         TempWindowForm tempWindowForm = new TempWindowForm();
         QQMessageBox.Show(tempWindowForm, "结算成功", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
         this.txtChangeMoney.Text  = "";
         this.txtPassword.Password = "";
     }
     break;
     }
 }
Пример #28
0
        /// <summary>
        /// 数据保存
        /// </summary>
        private void SaveStudentData()
        {
            string msg = string.Empty;

            xfDataGridView2.EndEdit();
            if (lstStudentInsert.Count + lstStudentUpdate.Count == 0)
            {
                BindStudentData();
            }
            else
            {
                msg = CheckStudentChangedInput();
                if (msg.Equals(string.Empty))
                {
                    msg += AddStudentData();
                    msg += UpdateStudentData();
                    if (msg.Equals(string.Empty))
                    {
                        QQMessageBox.Show(
                            this,
                            MessageText.TIP_SUCCESS_SAVE,
                            MessageText.MESSAGEBOX_CAPTION_TIP,
                            QQMessageBoxIcon.OK,
                            QQMessageBoxButtons.OK);
                        BindData();
                    }
                    else
                    {
                        QQMessageBox.Show(
                            this,
                            msg,
                            MessageText.MESSAGEBOX_CAPTION_ERROR,
                            QQMessageBoxIcon.Error,
                            QQMessageBoxButtons.OK);
                    }
                }
                else
                {
                    QQMessageBox.Show(
                        this,
                        msg,
                        MessageText.MESSAGEBOX_CAPTION_TIP,
                        QQMessageBoxIcon.Information,
                        QQMessageBoxButtons.OK);
                    return;
                }
            }
        }
Пример #29
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     Login._AskChatInfo.TargetId = reciveId;
     Login._AskChatInfo.Agree    = 1;
     if (Login._UserInfo.Cash > Login._AskChatInfo.Price)
     {
         Login._ClientEngine.Send(ChatEngine.NotifyType.Request_GameList, Login._UserInfo);
         Login._ClientEngine.Send(ChatEngine.NotifyType.Reply_EnterMeeting, Login._AskChatInfo);
     }
     else
     {
         TempWindowForm tempWindowForm = new TempWindowForm();
         QQMessageBox.Show(tempWindowForm, "您的余额不足不能进行聊天.", "提示", QQMessageBoxIcon.OK, QQMessageBoxButtons.OK);
     }
     this.Close();
 }
Пример #30
0
        private void roomDelete_MouseUp(object sender, MouseButtonEventArgs e)
        {
            if (_roomGrid == true)
            {
                _roomGrid = true;

                TempWindowForm tempWindowForm = new TempWindowForm();
                if (QQMessageBox.Show(tempWindowForm, "Are you sure?", "提示", QQMessageBoxIcon.Question, QQMessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
                {
                    return;
                }

                _roomInfo.Id = _roomId;
                Login._ClientEngine.Send(NotifyType.Request_DelRoom, _roomInfo);
            }
        }