private void updatestock_Click(object sender, EventArgs e)
        {
            try {
                var editsubcat = new editSubCatagory();
                foreach (DataGridViewRow row in itemdetails.SelectedRows)
                {
                    editsubcat.subcatnameupdate.Text    = row.Cells[1].Value.ToString();
                    editsubcat.subcatppupdate.Text      = row.Cells[5].Value.ToString();
                    editsubcat.subcatspupdate.Text      = row.Cells[6].Value.ToString();
                    editsubcat.subcatqtyupdate.Text     = row.Cells[2].Value.ToString();
                    editsubcat.scid.Text                = row.Cells[0].Value.ToString();
                    editsubcat.subcatnameupdate.Enabled = false;
                    editsubcat.subcatppupdate.Enabled   = false;
                    editsubcat.subcatspupdate.Enabled   = false;
                    editsubcat.edititemheader.Text      = "Update Stock";

                    editsubcat.ShowDialog();
                }
                dboperation     operation = new dboperation();
                SqlCeConnection conn      = operation.dbConnection(Settings.Default.DatabasePath);
                //  load_subcat_gridview(conn);
                operation.closeDBConnection(conn);
            }catch (Exception ex)
            {
                MessageBox.Show("" + ex);
            }
        }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            var editsubcat = new editSubCatagory();

            foreach (DataGridViewRow row in subCatList.SelectedRows)
            {
                editsubcat.subcatnameupdate.Text = row.Cells[1].Value.ToString();
                editsubcat.subcatppupdate.Text   = row.Cells[5].Value.ToString();
                editsubcat.subcatspupdate.Text   = row.Cells[4].Value.ToString();
                editsubcat.subcatqtyupdate.Text  = row.Cells[3].Value.ToString();
                editsubcat.scid.Text             = row.Cells[0].Value.ToString();
                editsubcat.ShowDialog();
            }
            dboperation     operation = new dboperation();
            SqlCeConnection conn      = operation.dbConnection(Settings.Default.DatabasePath);

            load_subcat_gridview(conn);
            operation.closeDBConnection(conn);
        }