public void setLocale(Locale lo) { localeName.Text = lo.LocaleName; LocaleState state = (LocaleState)Enum.Parse(typeof(LocaleState), lo.LocaleState); if (state == LocaleState.正常) { rbEnable.Select(); } else { rbDisable.Select(); } LocaleType type = (LocaleType)Enum.Parse(typeof(LocaleType), lo.LocaleType); if (type == LocaleType.固定资产) { rbFixed.Select(); } else { rbConsumables.Select(); } tbExplain.Text = lo.LocaleExplain; }
private void disableLocale(object sender, EventArgs e) { Locale locale = (Locale)dataGridView1.CurrentRow.Tag; if (locale == null) { Tool.show("请选择一行"); return; } LocaleState bs = (LocaleState)Enum.Parse(typeof(LocaleState), locale.LocaleState); if (bs == LocaleState.正常) { locale.LocaleState = LocaleState.报废.ToString(); } else { locale.LocaleState = LocaleState.正常.ToString(); } dao.updateLocale(locale); initData(); }
private void cellClick(object sender, EventArgs e) { if (dataGridView1.CurrentRow == null) { return; } Locale locale = (Locale)dataGridView1.CurrentRow.Tag; if (locale == null) { return; } LocaleState ls = (LocaleState)Enum.Parse(typeof(LocaleState), locale.LocaleState); if (ls == LocaleState.正常) { button3.Text = "设为报废"; } else { button3.Text = "设为正常"; } }