private void btnHamStokDetayGuncelle_Click(object sender, EventArgs e) { if (seciliHamStokDetay != null) { new Stok.Services.HamStok().HamStokDetayKaydet(seciliHamStokDetay.Id, Convert.ToInt32(cmbSarj.EditValue), seciliHamStok.Id, Convert.ToDecimal(txtBirimMiktar.Text)); GridHamStokDetayDoldur(); seciliHamStokDetay = null; } else { MessageBox.Show("Kaydedilmemiş veriyi değiştiremezsiniz"); } }
/// <summary> /// Deprecated Method for adding a new object to the HamStokDetay EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToHamStokDetay(HamStokDetay hamStokDetay) { base.AddObject("HamStokDetay", hamStokDetay); }
/// <summary> /// Create a new HamStokDetay object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="sarjId">Initial value of the SarjId property.</param> /// <param name="hamStokId">Initial value of the HamStokId property.</param> /// <param name="miktar">Initial value of the Miktar property.</param> /// <param name="sevkMiktar">Initial value of the SevkMiktar property.</param> public static HamStokDetay CreateHamStokDetay(global::System.Int64 id, global::System.Int32 sarjId, global::System.Int32 hamStokId, global::System.Decimal miktar, global::System.Decimal sevkMiktar) { HamStokDetay hamStokDetay = new HamStokDetay(); hamStokDetay.Id = id; hamStokDetay.SarjId = sarjId; hamStokDetay.HamStokId = hamStokId; hamStokDetay.Miktar = miktar; hamStokDetay.SevkMiktar = sevkMiktar; return hamStokDetay; }
private void gridView1_RowClick(object sender, RowClickEventArgs e) { int hamStokDetayId = Convert.ToInt32(gridView1.GetFocusedRowCellValue("Id")); seciliHamStokDetay = new Stok.Services.HamStok().GetHamStokDetaybyHamStokDetayId(hamStokDetayId); if (seciliHamStokDetay != null) { cmbMalzeme.EditValue = seciliHamStokDetay.Sarj.HamMalzemeId; cmbSarj.EditValue = seciliHamStokDetay.SarjId; txtBirimMiktar.Text = seciliHamStokDetay.Miktar.ToString(); } else { cmbMalzeme.EditValue = new Stok.Services.Sarj().GetbyId(Convert.ToInt32(gridView1.GetFocusedRowCellValue("SarjId"))).HamMalzemeId; cmbSarj.EditValue = Convert.ToInt32(gridView1.GetFocusedRowCellValue("SarjId")); txtBirimMiktar.Text = gridView1.GetFocusedRowCellValue("Birim Miktar").ToString(); } }
private void gridControl1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete) { if (seciliHamStokDetay != null) { if (new Stok.Services.IslenmisMalzeme().GetDetaybyHamStokDetayId(seciliHamStokDetay.Id) != null) { MessageBox.Show(this, "Silmek istediğiniz malzemeden imalat yapılmış", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DialogResult result = MessageBox.Show(this, "Silmek istediğinizden emin misiniz ?", "Soru", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { new Stok.Services.HamStok().DeleteHamStokDetaybyId(seciliHamStokDetay.Id); seciliHamStokDetay = null; } } } gridView1.DeleteRow(gridView1.GetSelectedRows()[0]); tableCookie.Clear(); for (int i = 0; i < gridView1.RowCount; i++) { string[] a = new string[6]; for (int ii = 0; ii < 6; ii++) { a[ii] = gridView1.GetRowCellValue(i, gridView1.Columns[ii]).ToString(); } tableCookie.Rows.Add(a[0], a[1], a[2], a[3], a[4], a[5]); } table.Clear(); for (int i = 0; i < tableCookie.Rows.Count; i++) { table.Rows.Add(tableCookie.Rows[i][0].ToString(), tableCookie.Rows[i][1].ToString(), tableCookie.Rows[i][2].ToString(), tableCookie.Rows[i][3].ToString(), tableCookie.Rows[i][4].ToString(), tableCookie.Rows[i][5].ToString()); } gridControl1.DataSource = table; } }