示例#1
0
        public void MODIFY(INTERNATIONALRATE item)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("update INTERNATIONAL_RATE set");
            sb.AppendFormat(" lrate={0}, lsec={1}, mrate={2}, msec={3} where areacode={4}", item.lrate, item.lsec, item.mrate, item.msec, item.areacode);

            using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn))
            {
                try
                {
                    int count = db.GetEffectedCount();
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fex)
                {
                    db.Rollback();
                    util.WriteLog(string.Format("{0} MODIFY ERR : {1}", this.GetType(), fex.Message));
                    return;
                }
            }

            INTERNATIONALRATE _tmpobj = (INTERNATIONALRATE)_list.Where(x => x.areacode == item.areacode);

            _tmpobj.lrate = item.lrate;
            _tmpobj.lsec  = item.lsec;
            _tmpobj.mrate = item.mrate;
            _tmpobj.msec  = item.msec;

            //INIT();
        }
示例#2
0
        public void ADD(INTERNATIONALRATE item)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("insert into INTERNATIONAL_RATE");
            sb.Append("( areacode, lrate, lsec, mrate, msec )");
            sb.Append(" values ");
            sb.AppendFormat("( {0}, {1}, {2}, {3}, {4} )", item.areacode, item.lrate, item.lsec, item.mrate, item.msec);

            using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn))
            {
                try
                {
                    int count = db.GetEffectedCount();
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fex)
                {
                    db.Rollback();
                    util.WriteLog(string.Format("{0} ADD ERR : {1}", this.GetType(), fex.Message));
                    return;
                }
            }

            _list.Add(item);

            //INIT();
        }
示例#3
0
        public void REMOVE(INTERNATIONALRATE item)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("delete from INTERNATIONAL_RATE where areacode={0}", item.areacode);

            using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn))
            {
                try
                {
                    int count = db.GetEffectedCount();
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fex)
                {
                    db.Rollback();
                    util.WriteLog(string.Format("{0} REMOVE ERR : {1}", this.GetType(), fex.Message));
                    return;
                }
            }

            _list.Remove(item);

            //INIT();
        }
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            // 값 filter
            if (string.IsNullOrEmpty(txtKind.Text.Trim()))
            {
                MessageBox.Show("대역 번호를 입력하세요.");
                txtKind.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtLRate.Text.Trim()))
            {
                MessageBox.Show("유선 착신 요율(원)을 입력하세요.");
                txtLRate.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtLSec.Text.Trim()))
            {
                MessageBox.Show("유선 착신 요율(초)을 입력하세요.");
                txtLSec.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtMRate.Text.Trim()))
            {
                MessageBox.Show("무선 착신 요율(원)을 입력하세요.");
                txtMRate.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtMSec.Text.Trim()))
            {
                MessageBox.Show("무선 착신 요율(초)을 입력하세요.");
                txtMSec.Focus();
                return;
            }

            if (_mode == AddPrefixStates.Add)
            {

                _obj = new INTERNATIONALRATE()
                {
                    areacode = int.Parse(txtKind.Text.Trim())
                    ,
                    lrate = float.Parse(txtLRate.Text.Trim())
                    ,
                    lsec = int.Parse(txtLSec.Text.Trim())
                    ,
                    mrate = float.Parse(txtMRate.Text.Trim())
                    ,
                    msec = int.Parse(txtMSec.Text.Trim())
                };

                txtKind.Text = string.Empty;
                txtLRate.Text = "50";
                txtLSec.Text = "60";
                txtMRate.Text = "50";
                txtMSec.Text = "60";

                _parentWin.internationalrates.ADD(_obj);
            }
            else if (_mode == AddPrefixStates.Modify)
            {
                //_obj.areacode = int.Parse(txtKind.Text.Trim());
                //_obj.lrate = float.Parse(txtLRate.Text.Trim());
                //_obj.lsec = int.Parse(txtLSec.Text.Trim());
                //_obj.mrate = float.Parse(txtMRate.Text.Trim());
                //_obj.msec = int.Parse(txtMSec.Text.Trim());
                _parentWin.internationalrates.MODIFY(_obj);
                this.Close();
            }
        }
示例#5
0
        public void REMOVE(INTERNATIONALRATE item)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("delete from INTERNATIONAL_RATE where areacode={0}", item.areacode);

            using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn))
            {
                try
                {
                    int count = db.GetEffectedCount();
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fex)
                {
                    db.Rollback();
                    util.WriteLog(string.Format("{0} REMOVE ERR : {1}", this.GetType(), fex.Message));
                    return;
                }
            }

            _list.Remove(item);

            //INIT();
        }
示例#6
0
        public void MODIFY(INTERNATIONALRATE item)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("update INTERNATIONAL_RATE set");
            sb.AppendFormat(" lrate={0}, lsec={1}, mrate={2}, msec={3} where areacode={4}", item.lrate, item.lsec, item.mrate, item.msec, item.areacode);

            using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn))
            {
                try
                {
                    int count = db.GetEffectedCount();
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fex)
                {
                    db.Rollback();
                    util.WriteLog(string.Format("{0} MODIFY ERR : {1}", this.GetType(), fex.Message));
                    return;
                }
            }

            INTERNATIONALRATE _tmpobj = (INTERNATIONALRATE)_list.Where(x => x.areacode == item.areacode);
            _tmpobj.lrate = item.lrate;
            _tmpobj.lsec = item.lsec;
            _tmpobj.mrate = item.mrate;
            _tmpobj.msec = item.msec;

            //INIT();
        }
示例#7
0
        public void ADD(INTERNATIONALRATE item)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("insert into INTERNATIONAL_RATE");
            sb.Append("( areacode, lrate, lsec, mrate, msec )");
            sb.Append(" values ");
            sb.AppendFormat("( {0}, {1}, {2}, {3}, {4} )", item.areacode, item.lrate, item.lsec, item.mrate, item.msec);

            using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn))
            {
                try
                {
                    int count = db.GetEffectedCount();
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fex)
                {
                    db.Rollback();
                    util.WriteLog(string.Format("{0} ADD ERR : {1}", this.GetType(), fex.Message));
                    return;
                }
            }

            _list.Add(item);

            //INIT();
        }