Beispiel #1
0
 private void editBtn_Click(object sender, EventArgs e)
 {
     using (FrmObat obat = new FrmObat())
     {
         obat.IsEdit = true;
         foreach (DataGridViewRow row in dataGridView1.SelectedRows)
         {
             obat.PrimaryKey          = row.Cells[0].Value.ToString();
             obat.merekTxt.Text       = row.Cells[1].Value.ToString();
             obat.nmObatTxt.Text      = row.Cells[2].Value.ToString();
             obat.kategoriCBX.Text    = row.Cells[3].Value.ToString();
             obat.tipeCBX.Text        = row.Cells[4].Value.ToString();
             obat.satuanStockCBX.Text = row.Cells[5].Value.ToString();
             obat.satuanJualCBX.Text  = row.Cells[6].Value.ToString();
             obat.hargaPokokTxt.Value = Convert.ToDecimal(row.Cells[7].Value);
             obat.hargaJualTxt.Value  = Convert.ToDecimal(row.Cells[8].Value);
             obat.marginTxt.Value     = Convert.ToDecimal(row.Cells[9].Value);
             if (row.Cells[10].Value.ToString() == "1")
             {
                 obat.statusResepCBX.Text = "Ya";
             }
             else
             {
                 obat.statusResepCBX.Text = "Tidak";
             }
             obat.keteranganTXT.Text = row.Cells[11].Value.ToString();
             obat.selisihTXT.Text    = "";
         }
         obat.ShowDialog();
     }
     BgWorkerDoWork();
 }
Beispiel #2
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     using (FrmObat obat = new FrmObat())
     {
         obat.IsEdit = false;
         obat.ShowDialog();
     }
     BgWorkerDoWork();
 }