예제 #1
0
        private void mOborud_Click(object sender, EventArgs e)
        {
            fOborud frm = new fOborud();

            frm.Text      = mOborud.Text;
            frm.MdiParent = this;
            frm.Show();
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            fOborud fOb = new fOborud();

            try
            {
                SqlCommand cmd = new SqlCommand
                {
                    Connection  = new SqlConnection(Properties.Settings.Default.itInventorConnectionString),
                    CommandText = "updateOborud",
                    CommandType = CommandType.StoredProcedure
                };

                cmd.Parameters.AddWithValue("@indPass", indPass);

                cmd.Parameters.AddWithValue("@objNote", txParam.Text); // параметры
                cmd.Parameters.AddWithValue("@cost", nuCost.Value);
                cmd.Parameters.AddWithValue("@objDate", dtEnter.Value.Date);
                cmd.Parameters.AddWithValue("@garantDate", dtGarant.Value.Date);
                cmd.Parameters.AddWithValue("@model", txModel.Text);
                cmd.Parameters.AddWithValue("@sNo", txSNo.Text);
                cmd.Parameters.AddWithValue("@id_us", cbUser.SelectedValue);
                cmd.Parameters.AddWithValue("@id_kn", cbKind.SelectedValue);
                cmd.Parameters.AddWithValue("@id_ps", cbPost.SelectedValue);
                cmd.Parameters.AddWithValue("@id_pr", cbProd.SelectedValue);

                cmd.Parameters.AddWithValue("@objDism", chBox_Spisan.Checked);
                cmd.Parameters.AddWithValue("@onRemont", cheBox_Remont.Checked);

                cmd.Connection.Open();
                cmd.ExecuteNonQuery();
                cmd.Connection.Close();

                MessageBox.Show("Успешно обновлено");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            Close();
        }