コード例 #1
0
ファイル: NewZHGUT.cs プロジェクト: malekula/smngit
        private void NewWPN_Load(object sender, EventArgs e)
        {
            DBCategory dbc = new DBCategory("ZHGUTLIST");

            cbCategory.ValueMember   = "ID";
            cbCategory.DisplayMember = "CATEGORYNAME";
            cbCategory.DataSource    = dbc.GetAllExceptAll();

            if (AccessMode == "NEWCLONE")
            {
                if (Clone.IDCat != 0)
                {
                    cbCategory.SelectedValue = Clone.IDCat;
                }
                else
                {
                    cbCategory.SelectedIndex = 0;
                }
            }
            if (AccessMode == "NEW")
            {
                cbCategory.SelectedIndex = 0;
            }
            if (AccessMode == "EDIT")
            {
                if (EditWP.IDCat != 0)
                {
                    cbCategory.SelectedValue = EditWP.IDCat;
                }
                else
                {
                    cbCategory.SelectedIndex = 0;
                }
            }
            if (AccessMode == "VIEWONLY")
            {
                if (ViewWP.IDCat != 0)
                {
                    cbCategory.SelectedValue = ViewWP.IDCat;
                }
                else
                {
                    cbCategory.SelectedIndex = 0;
                }
            }
            LoadSubs((int)cbCategory.SelectedValue);
            if (AccessMode == "NEWCLONE")
            {
                cbSubCategory.SelectedValue = Clone.IDSubCat;
            }
            if (AccessMode == "EDIT")
            {
                cbSubCategory.SelectedValue = EditWP.IDSubCat;
            }
            if (AccessMode == "VIEWONLY")
            {
                cbSubCategory.SelectedValue = ViewWP.IDSubCat;
            }
        }
コード例 #2
0
ファイル: EditWPN.cs プロジェクト: malekula/smngit
        private void EditWPN_Load(object sender, EventArgs e)
        {
            DBCategory dbc = new DBCategory("WPNAMELIST");

            cbCategory.ValueMember   = "ID";
            cbCategory.DisplayMember = "CATEGORYNAME";
            cbCategory.DataSource    = dbc.GetAllExceptAll();

            DBWPName dbwp = new DBWPName();
            WPNameVO wp   = WPNameVO.WPNameVOByID(this.IDW);

            cbCategory.SelectedValue = wp.IDCat;

            LoadSubs((int)cbCategory.SelectedValue);
        }