private void simpleButtonOK_Click(object sender, EventArgs e) { ConnDB conn = new ConnDB(); string strsql, strsql2; int rows; strsql = "insert into cost_transfer(cdate,sale_type_id,transfer_type,hours) values('" + dateEditDate.Text.ToString() + "','" + Common.IsZero(comboBoxSaleType.SelectedValue.ToString()) + "','" + Common.IsZero(comboBoxTransferType.SelectedValue.ToString()) + "'," + textEditHours.Text.ToString().Trim() + ")"; strsql2 = "select cdate from cost_transfer where cdate ='" + dateEditDate.Text.ToString() + "' and sale_type_id = " + comboBoxSaleType.SelectedValue.ToString() + " and transfer_type = " + comboBoxTransferType.SelectedValue.ToString(); if (textEditHours.Text.ToString() != "") { rows = conn.ReturnRecordCount(strsql2); if (rows > 0) { MessageBox.Show("此转嫁工时已经存在!"); } else { bool isok = conn.EditDatabase(strsql); if (isok) { MessageBox.Show("添加成功!"); CostTransferQuery.RefreshEX(); this.Close(); } } } else { MessageBox.Show("转嫁工时不能为空!"); } conn.Close(); }
public static CostTransferQuery GetInstance() { if (ehqform == null || ehqform.IsDisposed) { ehqform = new CostTransferQuery(); } return(ehqform); }
private void barButtonItem查询_ItemClick(object sender, ItemClickEventArgs e) { CostTransferQuery Frm = CostTransferQuery.GetInstance(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); }
private void CostTransfer_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; CostTransferQuery Frm = CostTransferQuery.GetInstance(); Frm.TopLevel = false; Frm.Parent = this; Frm.Show(); Frm.BringToFront(); Frm.Height = this.Height - 20; }
private void barButtonItem刷新_ItemClick(object sender, ItemClickEventArgs e) { CostTransferQuery.RefreshEX(); }