public void OpenOrder(string orderno) { if ((prop.UpdatePaymentTable > 0) || (checkAutoUpdate.Checked)) tmr.Stop(); SqlCommand tmp_cmd = new SqlCommand("SELECT [id_order] FROM [vwOrderNoList] WHERE [id_order] = " + orderno + "", db_connection); SqlDataReader tmp_rdr = tmp_cmd.ExecuteReader(); int tmp_id = 0; if (tmp_rdr.Read()) { if (!tmp_rdr.IsDBNull(0)) { tmp_id = tmp_rdr.GetInt32(0); } } tmp_rdr.Close(); if (tmp_id > 0) { using (frmOrderClose fOrder = new frmOrderClose(db_connection, usr, tmp_id)) { fOrder.fixDouble = checkDouble.Checked; fOrder.ShowDialog(); } } if ((prop.UpdatePaymentTable > 0) || (checkAutoUpdate.Checked)) tmr.Start(); }
private void OpenOrder(string orderno) { if (CheckState(db_connection)) { SqlCommand tmp_cmd = new SqlCommand("SELECT [id_order] FROM [vwOrderNoList] WHERE RTRIM([number]) = RTRIM('" + orderno + "')", db_connection); SqlDataReader tmp_rdr = tmp_cmd.ExecuteReader(); int tmp_id = 0; if (tmp_rdr.Read()) { if (!tmp_rdr.IsDBNull(0)) { tmp_id = tmp_rdr.GetInt32(0); } } tmp_rdr.Close(); if (tmp_id > 0) { frmOrderClose fOrder = new frmOrderClose(db_connection, usr, tmp_id); fOrder.ShowDialog(); } } }
private void OpenOrder2(string orderno) { SqlCommand tmp_cmd = new SqlCommand("SELECT [id_order] FROM [vwOrderNoList] WHERE RTRIM([number]) LIKE '%' + RTRIM('" + orderno + "') + '%'", db_connection); SqlDataReader tmp_rdr = tmp_cmd.ExecuteReader(); int tmp_id = 0; if (tmp_rdr.Read()) { if (!tmp_rdr.IsDBNull(0)) { tmp_id = tmp_rdr.GetInt32(0); } } tmp_rdr.Close(); if (tmp_id > 0) { using (frmOrderClose fOrder = new frmOrderClose(db_connection, usr, tmp_id)) { //fOrder.fixDouble = checkDouble.Checked; fOrder.ShowDialog(); } } }
private void OpenOrder(string id) { using (SqlConnection con = new SqlConnection(prop.Connection_string)) { using (SqlCommand cmd = new SqlCommand("SELECT dbo.[order].id_order FROM dbo.[order] WHERE (dbo.[order].id_order = '" + id + "')", con)) { int id_order = -1; con.Open(); SqlDataReader r = cmd.ExecuteReader(); if (r.Read()) { id_order = r.GetInt32(0); } r.Close(); if (id_order > -1) { using (frmOrderClose f = new frmOrderClose(con, usr, id_order)) { f.ShowDialog(); } } else { MessageBox.Show("Заказ не найден в базе!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }