Beispiel #1
0
 private void cmdTransaction_Click(object sender, EventArgs e)
 {
     frmTransaction transaction = new frmTransaction();
     transaction.Show();
 }
Beispiel #2
0
        private void update()
        {
            if (string.IsNullOrEmpty(this.txtItemId.Text))
            {
                MessageBox.Show("Please input (Item no)");
                this.txtItemId.Focus();
                return;
            }
            SqlCeConnection myConnection = default(SqlCeConnection);
            myConnection = new SqlCeConnection("Data source="
                + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
                + "\\GodDB.sdf;"));
            myConnection.Open();
            SqlCeCommand myCommand = myConnection.CreateCommand();

            myCommand.CommandText = "Update [receipt] SET [itemid] = '" + this.txtItemId.Text + "'" +
                ",[batch]= '" + this.txtBatch.Text + "'" +
                ",[qty] =" + this.txtQty.Text + "" +
                ",[zone]='" + this.txtZone.Text + "'" +
                ",[channel]='" + this.txtChannel.Text + "'" +
                //",[receiptdate]'"+this.txtReceiptDate.Text+"'"+
                //",[receiptby]'"+this.txtReceiptBy.Text+"'"+
                " where id ='" + strID + "'";
            myCommand.CommandType = CommandType.Text;
            myCommand.ExecuteNonQuery();
            myConnection.Close();

            MessageBox.Show("Update successfully");
            this.Close();
            // this.Close();
            //frmTransaction tr
            frmTransaction transaction = new frmTransaction();
            transaction.Show();
        }