private void LineTypeUpdate_Load(object sender, EventArgs e) { //this.WindowState = FormWindowState.Maximized; string cname = "", cnamemes = "", saletypename = "", workshop = ""; int id = 0, saletypeid = 0, workshopid = 0; ConnDB conn = new ConnDB(); LineTypeQuery.GetInfo(ref id, ref cname, ref cnamemes, ref saletypeid, ref saletypename, ref workshopid, ref workshop); string sql = "select * from cost_saletype where cid = " + saletypeid + " and isnull(forbidden,'false') = 'true'"; int rows = conn.ReturnRecordCount(sql); Common.BasicDataBind("cost_saletype", comboBoxSaleType); BindWorkShop(); if (cname != "" || cnamemes != "") { textEditName.Text = cname; textEditNameMes.Text = cnamemes; if (rows == 0) { comboBoxSaleType.SelectedIndex = -1; comboBoxSaleType.SelectedValue = saletypeid; } comboBoxWorkShop.SelectedIndex = -1; comboBoxWorkShop.SelectedValue = workshopid; textEditID.Text = id.ToString(); textEditSaleTypeID.Text = saletypeid.ToString(); } }
public static LineTypeQuery GetInstance() { if (ltqform == null || ltqform.IsDisposed) { ltqform = new LineTypeQuery(); } return(ltqform); }
private void barButtonItem查询_ItemClick(object sender, ItemClickEventArgs e) { LineTypeQuery Frm = LineTypeQuery.GetInstance(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); }
private void LineType_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; LineTypeQuery Frm = LineTypeQuery.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 = "", cnamemes = ""; int cid = 0, saletypeid = 0, workshopid = 0; string saletypename = "", workshop = ""; LineTypeQuery.GetInfo(ref cid, ref cname, ref cnamemes, ref saletypeid, ref saletypename, ref workshopid, ref workshop); if (cname != "") { LineTypeUpdate Frm = new LineTypeUpdate(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); } }
private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string sql = "update cost_linetype set cname = '" + textEditName.Text.ToString().Trim() + "',cname_mes = '" + textEditNameMes.Text.ToString().Trim() + "', saletype_id =" + comboBoxSaleType.SelectedValue.ToString() + ",WORK_SHOP =" + comboBoxWorkShop.SelectedValue.ToString(); sql = sql + " where cid = " + textEditID.Text.ToString(); string sql2 = "select cname from cost_linetype where cname = '" + textEditName.Text.ToString().Trim() + "' and cname_mes = '" + textEditName.Text.ToString().Trim() + "' and saletype_id = " + comboBoxSaleType.SelectedValue.ToString(); if ((textEditName.Text.ToString().Trim() != "" || textEditNameMes.Text.ToString().Trim() != "") && comboBoxSaleType.SelectedValue.ToString() != "0" && comboBoxWorkShop.SelectedValue.ToString() != "0") { int rows = conn.ReturnRecordCount(sql2); if (rows > 0) { MessageBox.Show("该线体已经存在!"); } else { bool isok = conn.EditDatabase(sql); if (isok) { MessageBox.Show("修改成功!"); LineTypeQuery.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_linetype(CNAME,CNAME_MES,SALETYPE_ID,WORK_SHOP) values'" + textEditName.Text.ToString().Trim() + "','" + textEditNameMes.Text.ToString().Trim() + "'," + comboBoxSaleType.SelectedValue.ToString() + "," + comboBoxWorkShop.SelectedValue.ToString() + ")"; strsql2 = "select cname from cost_linetype where cname = '" + textEditName.Text.ToString().Trim() + "'"; if (textEditName.Text.ToString().Trim() != "" || textEditNameMes.Text.ToString().Trim() != "") { rows = conn.ReturnRecordCount(strsql2); if (rows > 0) { MessageBox.Show("该线体已经存在!"); } else { bool isok = conn.EditDatabase(strsql); if (isok) { MessageBox.Show("添加成功!"); LineTypeQuery.RefreshEX(); this.Close(); } else { MessageBox.Show("失败!"); } } } else { MessageBox.Show("名称不能为空!"); } conn.Close(); }
private void barButtonItem刷新_ItemClick(object sender, ItemClickEventArgs e) { LineTypeQuery.RefreshEX(); }