private void MainForm_Load(object sender, EventArgs e) { //默认打开界面 //XtraTabbedMdiManager mdiManager = new XtraTabbedMdiManager(); //mdiManager.MdiParent = this; bool isopen = true; foreach (Form f in this.MdiChildren) { if (f.Name == "SaleType") { f.Visible = true; f.Activate(); //f.WindowState = FormWindowState.Maximized; isopen = false; break; } } if (isopen) { SaleType Frm = SaleType.GetInstance(); Frm.MdiParent = this; //Frm.WindowState = FormWindowState.Maximized; Frm.Show(); } }
public static SaleType GetInstance() { if (stform == null || stform.IsDisposed) { stform = new SaleType(); } return(stform); }
private void simpleButton1_Click(object sender, EventArgs e) { SaleType Frm = SaleType.GetInstance(); Frm.TopLevel = false; Frm.Parent = this; Frm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; Frm.WindowState = FormWindowState.Maximized; Frm.Show(); }
public static void cEnable() { string sql; bool isdone = true; ConnDB conn = new ConnDB(); if (stqform == null || stqform.IsDisposed) { MessageBox.Show("没有选中要反禁用的记录!"); } else if (stqform.gridView1.SelectedRowsCount == 0) { MessageBox.Show("没有选中要反禁用的记录!"); } else { MessageBoxButtons messButton = MessageBoxButtons.OKCancel; DialogResult dr = MessageBox.Show("确定要反禁用吗?", "营业类型反禁用", messButton); if (dr == DialogResult.OK) { for (int i = 0; i < stqform.gridView1.SelectedRowsCount; i++) { sql = "update i set i.forbidden = 'false' from cost_saletype i where cname = '" + stqform.gridView1.GetDataRow(stqform.gridView1.GetSelectedRows()[i]).ItemArray[0].ToString() + "'"; isdone = conn.EditDatabase(sql); if (!isdone) { break; } } if (isdone) { SaleType.ForbiddenEnable(); SaleType.UnforbiddenDisable(); MessageBox.Show("反禁用成功!"); } } } conn.Close(); }
private void barButtonItem营业分类_ItemClick(object sender, ItemClickEventArgs e) { bool isopen = true; foreach (Form f in this.MdiChildren) { if (f.Name == "SaleType") { f.Visible = true; f.Activate(); f.WindowState = FormWindowState.Maximized; isopen = false; break; } } if (isopen) { SaleType Frm = SaleType.GetInstance(); Frm.MdiParent = this; Frm.WindowState = FormWindowState.Maximized; Frm.Show(); } }
private void IsForbidden() { if (stqform == null || stqform.IsDisposed) { } else if (stqform.gridView1.SelectedRowsCount == 0) { } else { if (stqform.gridView1.GetDataRow(stqform.gridView1.GetSelectedRows()[0]).ItemArray[1].ToString() == "True") { SaleType.ForbiddenDisable(); SaleType.UnforbiddenEnable(); } else { SaleType.ForbiddenEnable(); SaleType.UnforbiddenDisable(); } } }