示例#1
0
        /// <summary>
        /// 登録または更新ようにコントロールの値を行にを設定
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="row"></param>
        /// <param name="id"></param>
//        protected override void SetRowData<T>(T t_row, int id)
        protected override bool SetRowData(object t_row, int id)
        {
            bool bRet = true;

            TabletMaster row       = (TabletMaster)t_row;
            string       tablet_ip = this.tablet_ip.Text;

            //  IPチェック
            if (IsValidIP(tablet_ip, Properties.Resources.TABLET_IP))
            {
                row.tablet_id      = id;
                row.tablet_name_en = this.tablet_name_en.Text;
                row.tablet_name_jp = this.tablet_name_jp.Text;
                row.tablet_name_cn = this.tablet_name_cn.Text;
                row.tablet_sect    = (int)this.tablet_sect.SelectedValue;
                row.tablet_ip_tmp  = tablet_ip;

                int tablet_type;
                if (IsValidInt(this.tablet_type.Text, Properties.Resources.TABLET_TYPE, out tablet_type))
                {
                    row.tablet_type = (Int16)tablet_type;
                }
                else
                {
                    bRet = false;
                }
            }
            else
            {
                bRet = false;
            }

            return(bRet);
        }
示例#2
0
        private void SetData(TabletMaster row)
        {
            bool isNew = false;

            if (row.tablet_id != 0)
            {
                //  更新のとき  変更不可
                this.tablet_id.IsEnabled = false;

                //  削除を有効に
                this.deleteButton.IsEnabled = true;

                this.tablet_id.Text = row.tablet_id.ToString();
            }
            else
            {
                isNew = true;

                //  新規のとき  変更可
                this.tablet_id.IsEnabled = true;

                //  削除を無効に
                this.deleteButton.IsEnabled = false;

                this.tablet_id.Text = "";
            }
            this.tablet_name_en.Text = row.tablet_name_en;
            this.tablet_name_jp.Text = row.tablet_name_jp;
            this.tablet_name_cn.Text = row.tablet_name_cn;
            SelectTextBoxNumber(this.tablet_type, row.tablet_type, isNew);
            this.tablet_sect.SelectedValue = row.tablet_sect;
            this.tablet_ip.Text            = row.tablet_ip_tmp;
        }
示例#3
0
        private void UpdateData()
        {
            if (this.comboNames.SelectedValue != null)
            {
                int id = int.Parse(this.comboNames.SelectedValue.ToString());

                TabletMaster row = BaseMasterModel.Find <TabletMaster>(this.m_db.Conn, id);

                SetData(row);
            }
        }
示例#4
0
        protected override void SetID(object t_row, int id)
        {
            TabletMaster row = (TabletMaster)t_row;

            row.tablet_id = id;
        }