private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string sql = "update cost_saletype set cname = ltrim(rtrim('" + textEditNew.Text.ToString() + "')) where cname = ltrim(rtrim('" + textEditOld.Text.ToString() + "'))"; string sql2 = "select cname from cost_saletype where cname = LTRIM(rtrim('" + textEditNew.Text.ToString() + "'))"; if (textEditNew.Text.ToString().Trim() != "") { int rows = conn.ReturnRecordCount(sql2); if (rows > 0) { MessageBox.Show("该营业类型已经存在!"); } else { bool isok = conn.EditDatabase(sql); if (isok) { MessageBox.Show("修改成功!"); SaleTypeQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } } else { MessageBox.Show("新值不能为空!"); } conn.Close(); }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string strsql, strsql2; int rows; strsql = "insert into cost_saletype(CNAME) values(LTRIM(rtrim('" + textEditName.Text.ToString() + "')))"; strsql2 = "select cname from cost_saletype where cname = LTRIM(rtrim('" + textEditName.Text.ToString() + "'))"; if (textEditName.Text.ToString().Trim() != "") { rows = conn.ReturnRecordCount(strsql2); if (rows > 0) { MessageBox.Show("该营业类型已经存在!"); } else { bool isok = conn.EditDatabase(strsql); if (isok) { MessageBox.Show("添加成功!"); SaleTypeQuery.RefreshEX(); this.Close(); } } } else { MessageBox.Show("名称不能为空!"); } conn.Close(); }
public static SaleTypeQuery GetInstance() { if (stqform == null || stqform.IsDisposed) { stqform = new SaleTypeQuery(); } return(stqform); }
private void barButtonItem查询_ItemClick(object sender, ItemClickEventArgs e) { SaleTypeQuery Frm = SaleTypeQuery.GetInstance(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); }
private void SaleTypeUpdate_Load(object sender, EventArgs e) { //this.WindowState = FormWindowState.Maximized; string cname = SaleTypeQuery.GetCname(); if (cname != "") { textEditOld.Text = cname; } }
private void SaleType_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; SaleTypeQuery Frm = SaleTypeQuery.GetInstance(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); //Frm.Width = this.Width - 15; //Frm.Height = this.Width - 60; }
private void barButtonItem修改_ItemClick(object sender, ItemClickEventArgs e) { string cname = SaleTypeQuery.GetCname(); if (cname != "") { //SaleTypeUpdate Frm = SaleTypeUpdate.GetInstance(); SaleTypeUpdate Frm = new SaleTypeUpdate(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); } }
private void barButtonItem反禁用_ItemClick(object sender, ItemClickEventArgs e) { SaleTypeQuery.cEnable(); SaleTypeQuery.RefreshEX(); }
private void barButtonItem删除_ItemClick(object sender, ItemClickEventArgs e) { SaleTypeQuery.Delete(); SaleTypeQuery.RefreshEX(); }