アプリケーションの定型コードを短くしたい (1)
05/29/2011

ShortRefl2.SomeModel

using System;
using System.Collections;
using System.Collections.Generic;
using CodeCompress;

using System.Reflection;

namespace CodeCompress.ShortRefl2
{
    public class SomeModel : AbstractModel
    {
         /// <summary>
        /// コンストラクタ
        /// </summary>
        public SomeModel()
        {
        }

        /// <summary>
        /// コンストラクタ
        /// </summary>
        public SomeModel(SomeModel someModel) : base(someModel)
        {
        }

        /// <summary>
        /// メッセージ
        /// </summary>
        private class Message
        {
            /// <summary>
            /// エラー
            /// </summary>
            public class Error
            {
                /// <summary>
                /// 必須入力
                /// </summary>
                public const string Required = "{0}は、必須入力です。";
            }
        }


        /// <summary>
        /// 何かコード
        /// </summary>
        public string SomeCd
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 表示順
        /// </summary>
        public int Order
        {
            get { return (int)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 名称漢字
        /// </summary>
        public string Nmj
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 名称カナ
        /// </summary>
        public string Nmk
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 略称
        /// </summary>
        public string Nms
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 何かグループコード
        /// </summary>
        public string SomeAreaCd
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 何か区分
        /// </summary>
        public int SomeType
        {
            get { return (int)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 何か形態
        /// </summary>
        public int Mode
        {
            get { return (int)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 契約形態
        /// </summary>
        public int Catego
        {
            get { return (int)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 倉庫コード
        /// </summary>
        public string WarehouseCd
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 郵便番号
        /// </summary>
        public string Postno
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 住所1
        /// </summary>
        public string Addre1
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 住所2
        /// </summary>
        public string Addre2
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 住所3
        /// </summary>
        public string Addre3
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 電話番号
        /// </summary>
        public string Telno
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// FAX番号
        /// </summary>
        public string Faxno
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// URL
        /// </summary>
        public string Url
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// E-Mailアドレス
        /// </summary>
        public string EMail
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 床数
        /// </summary>
        public decimal FloorNum
        {
            get { return (decimal)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// POS台数
        /// </summary>
        public decimal PosNum
        {
            get { return (decimal)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 参加者数
        /// </summary>
        public decimal EmpNum
        {
            get { return (decimal)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 定休日
        /// </summary>
        public DateTime Rest
        {
            get { return (DateTime)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 区分1
        /// </summary>
        public string Rsv1
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 区分2
        /// </summary>
        public string Rsv2
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 区分3
        /// </summary>
        public string Rsv3
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 稼動フラグ
        /// </summary>
        public bool ActiveFlg
        {
            get { return (bool)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 更新フラグ
        /// </summary>
        public bool UpdateFlg
        {
            get { return (bool)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 更新実行日
        /// </summary>
        public DateTime UpdateYmd
        {
            get { return (DateTime)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 登録日
        /// </summary>
        public DateTime RegistYmd
        {
            get { return (DateTime)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 修正日
        /// </summary>
        public DateTime ModifyYmd
        {
            get { return (DateTime)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 登録何かコード
        /// </summary>
        public string RegistSomeCd
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }

        /// <summary>
        /// 登録参加者コード
        /// </summary>
        public string RegistEmpCd
        {
            get { return (string)GetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), this); }
            set { SetPropValue(this.RemoveSetterPrefix(MethodBase.GetCurrentMethod().Name), value, this); }
        }
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="messages"></param>
        protected void SetPropValidate_SomeCd(ref IList<string>messages)
        {
            if (string.IsNullOrEmpty(this.SomeCd))
            {
                messages.Add(string.Format(Message.Error.Required, "何かコード"));
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="messages"></param>
        protected void SetPropValidate_SomeAreaCd(ref IList<string> messages)
        {
            if (string.IsNullOrEmpty(this.SomeAreaCd))
            {
                messages.Add(string.Format(Message.Error.Required, "何かグループ"));
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="messages"></param>
        protected void SetPropValidate_Nmj(ref IList<string> messages)
        {
            if (string.IsNullOrEmpty(this.Nmj))
            {
                messages.Add(string.Format(Message.Error.Required, "名称(漢字)"));
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="messages"></param>
        protected void SetPropValidate_Nmk(ref IList<string> messages)
        {
            if (string.IsNullOrEmpty(this.Nmk))
            {
                messages.Add(string.Format(Message.Error.Required, "名称(カナ)"));
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="messages"></param>
        protected void SetPropValidate_Nms(ref IList<string> messages)
        {
            if (string.IsNullOrEmpty(this.Nms))
            {
                messages.Add(string.Format(Message.Error.Required, "略称(漢字)"));
            }
        }
    }
}

Top of Site
Copyright (c) 2011 Takao Tamura