Example #1
0
        private void SearchColor(string str)
        {
            bool bSuccess = true;

            try
            {
                int loop = 0;

                Color color = Color.White;
                bool  bFore = true;

                while (true)
                {
                    loop++;
                    if (loop > 100)
                    {
                        bSuccess = false;
                        break;
                    }

                    int indexS = str.IndexOf('{');
                    int indexE = str.IndexOf('}');

                    if (indexS == -1)
                    {
                        bSuccess = false;
                        break;
                    }

                    AddData(str.Substring(0, indexS), color, bFore);

                    string stColor = str.Substring(indexS, indexE - indexS + 1);
                    if (stColor == "{END}")
                    {
                        bSuccess = true;
                        break;
                    }

                    // ForeColor
                    bFore = true;
                    color = GetForeColor(stColor);
                    str   = str.Substring(indexE + 1);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(LangPack.GetMongolian("Format is invalid."), this.Name, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                bSuccess = false;
            }

            if (!bSuccess)
            {
                this.Close();
            }

            brdText = tbText.Text;

            //if(this.bBlink)
            //    timer.Start();
        }
Example #2
0
        private void InitCtrl()
        {
            #region List Header
            ColumnHeader h0 = new ColumnHeader();
            h0.Text  = "";
            h0.Width = 30;
            this.lvMsg.Columns.Add(h0);

            ColumnHeader h1 = new ColumnHeader();
            h1.Text  = LangPack.GetStoNum();
            h1.Width = 75;
            this.lvMsg.Columns.Add(h1);

            ColumnHeader h2 = new ColumnHeader();
            h2.Text  = LangPack.GetName();
            h2.Width = 170;
            this.lvMsg.Columns.Add(h2);

            ColumnHeader h3 = new ColumnHeader();
            h3.Text  = LangPack.GetTime();
            h3.Width = 100;
            this.lvMsg.Columns.Add(h3);

            ColumnHeader h5 = new ColumnHeader();
            h5.Text  = LangPack.GetStoContext();
            h5.Width = 150;
            this.lvMsg.Columns.Add(h5);
            #endregion

            AddListViewItem();
        }
Example #3
0
        private void lvTerm_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (e.Index < 0)
            {
                return;
            }

            ListView.CheckedIndexCollection selDist = lvDist.CheckedIndices;
            ListView.CheckedIndexCollection selTerm = lvTerm.CheckedIndices;

            if (e.NewValue == CheckState.Checked && (selDist.Count + selTerm.Count) >= 17)
            {
                MessageBox.Show(LangPack.GetMongolian("Terminals can not be selected to issue more than sixteen."), LangPack.GetMongolian(this.Name), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                e.NewValue = CheckState.Unchecked;
                return;
            }

            ListViewItem item = lvTerm.Items[e.Index];

            if (e.NewValue == CheckState.Checked)
            {
                item.ForeColor = Color.Blue;
                item.Font      = new Font(lvTerm.Font, FontStyle.Bold);
            }
            else
            {
                item.ForeColor = Color.Black;
                item.Font      = new Font(lvTerm.Font, FontStyle.Regular);
            }
        }
Example #4
0
        private void InitLang()
        {
            btnCancel.Text = LangPack.GetCancel();
            btnClose.Text  = LangPack.GetClose();

            if (LangPack.IsEng)
            {
                label8.Text    = "Auto Alert";
                groupBox1.Text = "Auto Alert Information";
                label2.Text    = "Mode";
                label9.Text    = "Auto Alert";
                label1.Text    = "Intensity";
                label10.Text   = "Send to CBS";
                label3.Text    = "Stored Message";
                btnImd.Text    = "Immediately Alert";
                lbSec.Text     = "(sec)";
            }
            else
            {
                label8.Text    = "Автомат түгшүүр";
                groupBox1.Text = "Автомат түгшүүрийн мэдээлэл";
                label2.Text    = "Горим";
                label9.Text    = "Түгшүүр";
                label1.Text    = "хүчдэл";
                label10.Text   = "Масс мессеж систем";
                label3.Text    = "Хадгалагдсан мэдээлэл";
                btnImd.Text    = "Яаралтай түгшүүр";
                lbSec.Text     = "(Сек)";
            }
        }
Example #5
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            TreeNode node = tvGrp.SelectedNode;

            if (node == null || !(node.Tag is Group))
            {
                MessageBox.Show(LangPack.GetMongolian("Please select the group to modify."), LangPack.GetMongolian(this.Name), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            this.newGrpName = node.Text;
            GroupEditForm form = new GroupEditForm(this);

            if (DialogResult.OK != form.ShowDialog())
            {
                return;
            }

            node.Text = this.newGrpName;

            Group gp = node.Tag as Group;

            gp.Name = this.newGrpName;
            grpMng.UpdateGrp(gp.Key, gp);
        }
Example #6
0
        private void playSiren(byte _num)
        {
            if (!(System.IO.File.Exists(Util.file_Siren + "siren_" + _num.ToString() + ".wav")))
            {
                MessageBox.Show(LangPack.GetMongolian("Sorry! can not play sound because file don't exists."), LangPack.GetMongolian("Siren"), MessageBoxButtons.OK, MessageBoxIcon.Error);

                if (_num == 1)
                {
                    btnMic.BackColor = Color.Black;
                }
                else
                {
                    btnRec.BackColor = Color.Black;
                }

                return;
            }

            if (this.sp == null)
            {
                this.sp = new SoundPlayer(Util.file_Siren + "siren_" + _num.ToString() + ".wav");
            }
            else
            {
                this.sp.SoundLocation = Util.file_Siren + "siren_" + _num.ToString() + ".wav";
            }

            this.sp.Play();
            this.playTD = new Thread(new ParameterizedThreadStart(playMethod));
            this.playTD.Start(this.msgTime[_num - 1]);
        }
Example #7
0
        private void btnKindDel_Click(object sender, EventArgs e)
        {
            TreeNode node = tvKind.SelectedNode;

            if (node == null)
            {
                MessageBox.Show(LangPack.GetMongolian("Please select the items to delete."), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (DialogResult.No == MessageBox.Show(LangPack.GetMongolian("Want to delete?"), this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2))
            {
                return;
            }

            if (brdMng.dicBrd.ContainsKey(node.Name))
            {
                brdMng.dicBrd.Remove(node.Name);
            }

            MessageBox.Show(LangPack.GetMongolian("Deleted."), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

            if (this.OnCGChangedEvt != null)
            {
                this.OnCGChangedEvt(this, new CGChangedEventArgs());
            }

            this.brdMng.SaveBrdData();
            AddTreeData();
            lvText.Items.Clear();
        }
Example #8
0
        private void InitLang()
        {
            btnView.Text     = LangPack.GetPreview();
            btnAdd.Text      = LangPack.GetAdd();
            btnEdit.Text     = LangPack.GetEdit();
            btnDel.Text      = LangPack.GetDelete();
            btnKindAdd.Text  = LangPack.GetAdd();
            btnKindEdit.Text = LangPack.GetEdit();
            btnKindDel.Text  = LangPack.GetDelete();
            btnClose.Text    = LangPack.GetClose();
            btnClear.Text    = LangPack.GetClear();

            if (LangPack.IsEng)
            {
                label1.Text   = "CG Edit";
                tabPage2.Text = "Kind List";
                tabPage1.Text = "Text List";
            }
            else
            {
                label1.Text   = "Текст засварлах";
                tabPage2.Text = "Мэдээллийн төрөл";
                tabPage1.Text = "Текстийн жагсаалт";
            }
        }
Example #9
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            TreeNode selNode = tvKind.SelectedNode;

            ListView.CheckedIndexCollection selText = lvText.CheckedIndices;

            if (selText == null || selText.Count == 0)
            {
                MessageBox.Show(LangPack.GetMongolian("Please choose the CG text to delete."), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (DialogResult.No == MessageBox.Show(LangPack.GetMongolian("Want to delete?"), this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2))
            {
                return;
            }

            for (int i = 0; i < selText.Count; i++)
            {
                BoardInfoDetail info = lvText.Items[selText[i]].Tag as BoardInfoDetail;
                brdMng.dicBrd[info.kind].dicText.Remove(info.name);
                brdMng.SaveBrdData();
            }

            MessageBox.Show(LangPack.GetMongolian("Deleted."), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);

            if (this.OnCGChangedEvt != null)
            {
                this.OnCGChangedEvt(this, new CGChangedEventArgs());
            }

            tvKind.SelectedNode = null;
            tvKind.SelectedNode = selNode;
        }
Example #10
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            TreeNode selNode = tvKind.SelectedNode;

            ListView.CheckedIndexCollection selText = lvText.CheckedIndices;

            if (selText == null || selText.Count == 0)
            {
                MessageBox.Show(LangPack.GetMongolian("Please select the items to modify."), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (selText.Count != 1)
            {
                MessageBox.Show(LangPack.GetMongolian("Please choose one CG text to modify."), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            BoardInfoDetail info = lvText.Items[selText[0]].Tag as BoardInfoDetail;
            BoardEditForm   form = new BoardEditForm(info, isPrimaryCG);

            form.OnCGChangeEvt += new EventHandler <CGChangeEventArgs>(form_OnCGChangeEvt);
            form.ShowDialog();
            form.OnCGChangeEvt -= new EventHandler <CGChangeEventArgs>(form_OnCGChangeEvt);

            tvKind.SelectedNode = null;
            tvKind.SelectedNode = selNode;
        }
Example #11
0
        /// <summary>
        /// 하단의 정보를 선택한 리스트의 정보로 보여준다.
        /// </summary>
        private void SetMsgInfo()
        {
            if (this.lvMsg.SelectedItems.Count == 0)
            {
                tbText.Text = string.Empty;
                lbNum.Text  = "0";
                lbTime.Text = "[0 " + LangPack.GetSec() + "]";
            }
            else
            {
                ListView.SelectedListViewItemCollection selText = lvMsg.SelectedItems;

                if (selText == null || selText.Count <= 0)
                {
                    return;
                }

                if (!(lvMsg.Items[selText[0].Index].Tag is MsgInfo))
                {
                    return;
                }

                MsgInfo msg = lvMsg.Items[selText[0].Index].Tag as MsgInfo;

                tbText.Text = msg.msgText;
                lbNum.Text  = msg.msgNum;
                lbTime.Text = "[" + msg.msgTime.ToString() + " " + LangPack.GetSec() + "]";
            }
        }
Example #12
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            ListView.SelectedIndexCollection selText = lvMsg.SelectedIndices;
            if (selText.Count <= 0)
            {
                MessageBox.Show(LangPack.GetMongolian("Please select message text to delete."), LangPack.GetMongolian(this.Name), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (DialogResult.No == MessageBox.Show(LangPack.GetMongolian("Want to delete?"), LangPack.GetMongolian(this.Name), MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
            {
                return;
            }

            msgMng.dicMsg.Remove((lvMsg.Items[selText[0]].Tag as MsgInfo).msgNum);
            msgMng.SaveMsgNameData();

            AddListViewItem();
            this.SetMsgInfo();

            if (this.OnStoMsgChangedEvt != null)
            {
                this.OnStoMsgChangedEvt(this, new StoMsgChangedEventArgs());
            }
        }
Example #13
0
        public OrderSelLive()
        {
            InitializeComponent();

            label2.Text = LangPack.GetSelLive();
            btnMic.Text = LangPack.GetLiveMic();
            btnRec.Text = LangPack.GetLiveRecord();
        }
Example #14
0
        public void timeTDMethod()
        {
            while (true)
            {
                if (this.tmpTime > 0)
                {
                    MethodInvoker set = delegate()
                    {
                        this.label13.Text = (--this.tmpTime).ToString();
                    };

                    if (this.InvokeRequired)
                    {
                        this.Invoke(set);
                    }
                    else
                    {
                        set();
                    }
                }

                if (this.tmpTime == 0)
                {
                    MethodInvoker btnSet = delegate()
                    {
                        this.btnImd.Enabled = false;
                        this.btnImd.Visible = false;
                        this.btnCancel.Text = LangPack.GetClear();
                    };

                    if (this.InvokeRequired)
                    {
                        this.Invoke(btnSet);
                    }
                    else
                    {
                        btnSet();
                    }

                    if (this.OnCountEndEvt != null)
                    {
                        this.OnCountEndEvt(this, new CountEndEventArgs(this.p24));
                    }

                    try
                    {
                        this.timeTD.Abort();
                    }
                    catch (Exception ex)
                    {
                        this.timeTD = null;
                    }
                    break;
                }

                Thread.Sleep(1000);
            }
        }
Example #15
0
        private void btnKindEdit_Click(object sender, EventArgs e)
        {
            TreeNode node = tvKind.SelectedNode;

            if (node == null)
            {
                MessageBox.Show(LangPack.GetMongolian("Please select the items to modify."), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string tmpName = string.Empty;

            string[] tmp = node.Text.Split('_');
            tmpName = node.Text.Replace(tmp[0] + "_", "");
            tmp[0]  = tmp[0].Trim('(');
            tmp[0]  = tmp[0].Trim(')');

            this.brdNewName = tmpName;
            this.brdKindNum = int.Parse(tmp[0]);

            GroupEditForm form = new GroupEditForm(this);

            form.OnCGChangeBoxEvt += new EventHandler <CGChangeEventArgs>(form_OnCGChangeBoxEvt);

            if (DialogResult.OK != form.ShowDialog())
            {
                form.OnCGChangeBoxEvt -= new EventHandler <CGChangeEventArgs>(form_OnCGChangeBoxEvt);
                return;
            }

            BoardInfo brd = new BoardInfo();

            brd.kind    = string.Format("({0})_{1}", this.brdKindNum, this.brdNewName);
            brd.kindNum = this.brdKindNum;

            Dictionary <string, BoardInfoDetail> dicNewBrd = new Dictionary <string, BoardInfoDetail>();

            foreach (KeyValuePair <string, BoardInfoDetail> pair in brdMng.dicBrd[node.Text].dicText)
            {
                BoardInfoDetail newBrd = new BoardInfoDetail();
                newBrd.kind    = brd.kind;
                newBrd.kindNum = brd.kindNum;
                newBrd.name    = pair.Value.name;
                newBrd.text    = pair.Value.text;
                dicNewBrd.Add(newBrd.name, newBrd);
            }

            brd.dicText = dicNewBrd;
            brdMng.dicBrd.Add(string.Format("({0})_{1}", this.brdKindNum, this.brdNewName), brd);
            brdMng.dicBrd.Remove(node.Text);

            brdMng.SaveBrdData();
            AddTreeData();
            form.OnCGChangeBoxEvt -= new EventHandler <CGChangeEventArgs>(form_OnCGChangeBoxEvt);
        }
Example #16
0
        private void btnSve_Click(object sender, EventArgs e)
        {
            string sirenNum = (cbNumber.SelectedIndex + 1).ToString();

            sirenMng.dicSiren[sirenNum].SirenName    = tbName.Text;
            sirenMng.dicSiren[sirenNum].SirenContext = tbText.Text;
            sirenMng.dicSiren[sirenNum].SirenTime    = Convert.ToInt32(numSec.Value);

            sirenMng.SaveSirenData();
            MessageBox.Show(LangPack.GetMongolian("Modified."), LangPack.GetMongolian(this.Text), MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Example #17
0
        private void Init()
        {
            //DB 탭
            this.DbIPTB.Text       = this.dbIp;
            this.DbSidTB.Text      = this.dbSid;
            this.DbIdTB.Text       = this.dbId;
            this.DbPwTB.Text       = this.dbPw;
            this.Oracle8CB.Checked = this.db8i;

            //TCP 탭
            this.TcpIpTB.Text   = this.tcpIp;
            this.TcpPortTB.Text = this.tcpPort;

            if (this.tcpState)
            {
                this.TcpCloseBtn.Enabled   = true;
                this.TcpConBtn.Enabled     = false;
                this.Tcp1StateLB.ForeColor = Color.Blue;
                this.Tcp1StateLB.Text      = string.Format(LangPack.GetTCPResult() + " : {0}", LangPack.GetTCPConnect());
            }
            else
            {
                this.TcpConBtn.Enabled     = true;
                this.TcpCloseBtn.Enabled   = false;
                this.Tcp1StateLB.ForeColor = Color.Red;
                this.Tcp1StateLB.Text      = string.Format(LangPack.GetTCPResult() + " : {0}", LangPack.GetTCPFail());
            }

            //TCP1 탭
            this.TcpIpTB1.Text   = this.tcpIp1;
            this.TcpPortTB1.Text = this.tcpPort1;

            if (this.tcpState1)
            {
                this.TcpCloseBtn1.Enabled  = true;
                this.TcpConBtn1.Enabled    = false;
                this.Tcp2StateLB.ForeColor = Color.Blue;
                this.Tcp2StateLB.Text      = string.Format(LangPack.GetTCPResult() + " : {0}", LangPack.GetTCPConnect());
            }
            else
            {
                this.TcpConBtn1.Enabled    = true;
                this.TcpCloseBtn1.Enabled  = false;
                this.Tcp2StateLB.ForeColor = Color.Red;
                this.Tcp2StateLB.Text      = string.Format(LangPack.GetTCPResult() + " : {0}", LangPack.GetTCPFail());
            }

            this.SaveBtn.Enabled = false;
            this.dbFLAG          = false;
            this.tcpFLAG         = false;
            this.tcpFLAG1        = false;
            this.logFLAG         = false;
            this.buzzerFlag      = false;
        }
Example #18
0
 private void OnLogin()
 {
     if (tbPw.Text.ToUpper() == stPw)
     {
         bOk = true;
         this.Close();
     }
     else
     {
         MessageBox.Show(LangPack.GetMongolian("Password error."), LangPack.GetMongolian(this.Name), MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Example #19
0
        private void btnSve_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbName.Text))
            {
                MessageBox.Show(LangPack.GetMongolian("Please enter the name."), LangPack.GetMongolian(this.Text), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                tbName.Focus();
                return;
            }

            if (string.IsNullOrEmpty(tbText.Text))
            {
                MessageBox.Show(LangPack.GetMongolian("Please enter message Text."), LangPack.GetMongolian(this.Text), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                tbText.Focus();
                return;
            }

            string stNum = numNo.Value.ToString();

            if (msgMng.dicMsg.ContainsKey(stNum))
            {
                if (bAdd)
                {
                    if (DialogResult.No == MessageBox.Show(LangPack.GetMongolian("Message already exists. Want to overwrite it?"), LangPack.GetMongolian(this.Text), MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                    {
                        return;
                    }
                }

                msgMng.dicMsg[stNum].msgName = tbName.Text;
                msgMng.dicMsg[stNum].msgText = tbText.Text;
                msgMng.dicMsg[stNum].msgTime = Convert.ToInt32(numSec.Value);

                MessageBox.Show(LangPack.GetMongolian("Modified."), LangPack.GetMongolian(this.Text), MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MsgInfo msg = new MsgInfo();
                msg.msgNum  = stNum;
                msg.msgName = tbName.Text;
                msg.msgText = tbText.Text;
                msg.msgTime = Convert.ToInt32(numSec.Value);
                msgMng.dicMsg.Add(msg.msgNum, msg);

                MessageBox.Show(LangPack.GetMongolian("Stored."), LangPack.GetMongolian(this.Text), MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            //저장메시지 추가 및 수정했음..이 밑에서 이벤트로 전송
            if (this.OnStoMsgChangedEvt != null)
            {
                this.OnStoMsgChangedEvt(this, new StoredMsgChangedEventArgs());
            }
        }
Example #20
0
        /// <summary>
        /// TCP1 통신연결 버튼 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TcpConBtn1_Click(object sender, EventArgs e)
        {
            if (this.TcpIpTB1.Text == string.Empty || this.TcpPortTB1.Text == string.Empty)
            {
                MessageBox.Show(LangPack.GetMongolian("Please check TCP2 items."), LangPack.GetMongolian("TCP2 Connect"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (this.OnTcpSocketEvt1 != null)
            {
                this.OnTcpSocketEvt1(this, new TcpSocketEventArgs(true, this.TcpIpTB1.Text, this.TcpPortTB1.Text));
            }
        }
Example #21
0
        private void InitLang()
        {
            btnClose.Text = LangPack.GetClose();

            if (LangPack.IsEng)
            {
                label6.Text = "CG Preview";
            }
            else
            {
                label6.Text = "Текст урьдчилан харах";
            }
        }
Example #22
0
        public void btnEnd_Click(object sender, EventArgs e)
        {
            ListView.CheckedIndexCollection selDist = lvDist.CheckedIndices;
            ListView.CheckedIndexCollection selTerm = lvTerm.CheckedIndices;

            if ((selDist == null && selTerm == null) || ((selDist.Count + selTerm.Count) == 0))
            {
                MessageBox.Show(LangPack.GetMongolian("Please select terminal(s) to issue."), LangPack.GetMongolian(this.Name), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if ((selDist.Count + selTerm.Count) > 16)
            {
                MessageBox.Show(LangPack.GetMongolian("Terminals can not be selected to issue more than sixteen."), LangPack.GetMongolian(this.Name), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            List <string> lstDistIP = new List <string>();
            List <string> lstTermIP = new List <string>();

            for (int i = 0; i < selDist.Count; i++)
            {
                lstDistIP.Add((lvDist.Items[selDist[i]].Tag as DistData).DistIp);
            }

            for (int i = 0; i < selTerm.Count; i++)
            {
                lstTermIP.Add((lvTerm.Items[selTerm[i]].Tag as TermData).TermIp);
            }

            if (evtIndInfo != null)
            {
                evtIndInfo(lstDistIP, lstTermIP);
            }

            this.lvDist.CheckBoxes = false;
            this.lvTerm.CheckBoxes = false;

            if (bSnGrp)
            {
                this.BackgroundImage = Util.GetBackgroundImage((byte)Util.emBackImage.grpNone);
            }
            else
            {
                this.BackgroundImage = Util.GetBackgroundImage((byte)Util.emBackImage.IndNone);
            }

            btnEnd.Enabled = false;
        }
Example #23
0
        private void InitLang()
        {
            btnClear.Text  = LangPack.Getclear();
            btnClose.Text  = LangPack.Getselect();
            checkBox1.Text = LangPack.GetAllSelect();

            if (LangPack.IsEng)
            {
                label6.Text = "CG Edit";
            }
            else
            {
                label6.Text = "Текст засварлах";
            }
        }
Example #24
0
        private void InitLang()
        {
            btnAdd.Text   = LangPack.GetAdd();
            btnEdit.Text  = LangPack.GetEdit();
            btnDel.Text   = LangPack.GetDelete();
            btnClose.Text = LangPack.GetClose();

            if (LangPack.IsEng)
            {
                label1.Text = "Group Edit";
            }
            else
            {
                label1.Text = "Бүлэг засварлах";
            }
        }
Example #25
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbName.Text))
            {
                MessageBox.Show(LangPack.GetMongolian("Please write a name."), LangPack.GetMongolian(this.Name), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                tbName.Focus();
                return;
            }

            GroupMng grpMng = GroupMng.GetGrpMng();

            foreach (KeyValuePair <string, Group> pair in grpMng.dicGrp)
            {
                if (pair.Value.Name.Trim() == tbName.Text.Trim())
                {
                    MessageBox.Show(LangPack.GetMongolian("The same name already exists. Please enter check again after."), LangPack.GetMongolian(this.Name), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    tbName.Focus();
                    return;
                }
            }

            if (this.bGrp)
            {
                this.grpForm.NewGrpName = tbName.Text + "   ";
            }
            else
            {
                if (this.brdForm.IsExistKey(string.Format("({0})_{1}", this.numericUpDown1.Value, this.tbName.Text)))
                {
                    MessageBox.Show(LangPack.GetMongolian("The title already exists. Please enter after checking again."), LangPack.GetMongolian(this.Name), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    tbName.Focus();
                    return;
                }

                this.brdForm.BrdNewName = tbName.Text;
                this.brdForm.BrdKindNum = (int)this.numericUpDown1.Value;

                if (this.OnCGChangeBoxEvt != null)
                {
                    this.OnCGChangeBoxEvt(this, new CGChangeEventArgs());
                }
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Example #26
0
        private void btnEnd_Click(object sender, EventArgs e)
        {
            ListView.CheckedListViewItemCollection selText = lvMsg.CheckedItems;

            if (selText == null || selText.Count <= 0)
            {
                MessageBox.Show(LangPack.GetMongolian("Please select stored message."), LangPack.GetMongolian("Stored Message"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            MsgInfo msg = lvMsg.Items[selText[0].Index].Tag as MsgInfo;

            msg.msgReptCtn = numRptCnt.Value.ToString();

            if (evtMsgInfo != null)
            {
                evtMsgInfo(Convert.ToByte(msg.msgNum), Convert.ToByte(numRptCnt.Value));
            }
        }
Example #27
0
        private void InitLang()
        {
            label2.Text   = LangPack.GetName();
            label1.Text   = LangPack.GetNumber();
            label3.Text   = LangPack.GetText();
            label4.Text   = LangPack.GetTime();
            label6.Text   = LangPack.GetSec();
            btnSve.Text   = LangPack.GetSave();
            btnClose.Text = LangPack.GetClose();

            if (LangPack.IsEng)
            {
                label8.Text = "Stored Message Edit";
            }
            else
            {
                label8.Text = "Хадглагдсан мессеж засварлах";
            }
        }
Example #28
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            ListView.SelectedIndexCollection selText = lvMsg.SelectedIndices;

            if (selText.Count <= 0)
            {
                MessageBox.Show(LangPack.GetMongolian("Please select message text to modify."), LangPack.GetMongolian(this.Name), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            StMsgEditForm form = new StMsgEditForm((lvMsg.Items[selText[0]].Tag as MsgInfo).msgNum, this.storedIsPrimary);

            form.OnStoMsgChangedEvt += new EventHandler <StoredMsgChangedEventArgs>(form_OnStoMsgChangedEvt);
            form.ShowDialog();
            form.OnStoMsgChangedEvt -= new EventHandler <StoredMsgChangedEventArgs>(form_OnStoMsgChangedEvt);

            AddListViewItem();
            this.SetMsgInfo();
        }
Example #29
0
        private void InitLang()
        {
            label1.Text   = LangPack.GetStoredMsg();
            btnAdd.Text   = LangPack.GetAdd();
            btnEdit.Text  = LangPack.GetEdit();
            btnDel.Text   = LangPack.GetDelete();
            btnClose.Text = LangPack.GetClose();
            button1.Text  = LangPack.GetPlay();
            lbTime.Text   = "[0 " + LangPack.GetSec() + "]";

            if (LangPack.IsEng)
            {
                lbNumText.Text = "▶ Stored Message Number :  ";
            }
            else
            {
                lbNumText.Text = "▶ Хадгалагдсан мессежийн дугаар :  ";
            }
        }
Example #30
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            new ListViewSortManager(
                lvMsg,
                new Type[] {
                typeof(ListViewTextSort),
                typeof(ListViewInt32Sort),
                typeof(ListViewTextSort),
                typeof(ListViewTextSort),
            },
                1,
                SortOrder.Ascending
                );

            btnEnd.Text  = LangPack.GetSelect();
            lbTitle.Text = LangPack.GetSelMsg();
            label1.Text  = LangPack.GetReptCnt();
        }