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; } }
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); }