private void btnBorclandir_ItemClick(object sender, ItemClickEventArgs e) { SiteDBEntities2 db = new SiteDBEntities2(); gridControl1.DataSource = null; dsAktivite_OdemePlaniSenet.Tables.Clear(); dsAktivite_OdemePlaniSenet.Tables.Add(DataControls.ListToDt(db.S_Odemeler(-1).ToList())); if (dsAktivite_OdemePlaniSenet.Tables[0].Rows.Count != 0) { dsAktivite_OdemePlaniSenet.Tables[0].Rows.Clear(); } int vadeSayisi = Convert.ToInt32(textEdit1.EditValue); if (vadeSayisi > 0) { for (int i = 0; i < vadeSayisi; i++) { TaksitEkle(VadeGridMaxTarihBul(), (decimal)(txtTutar.EditValue)); } } else { TaksitEkle(dateEdit1.DateTime.Date, (decimal)(txtTutar.EditValue)); } gridControl1.DataSource = dsAktivite_OdemePlaniSenet.Tables[0]; }
private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e) { try { SiteDBEntities2 db = new SiteDBEntities2(); if (!(gridView1.PostEditor() && gridView1.UpdateCurrentRow())) { return; } GridView view = sender as GridView; Object obj = view.GetRow(view.FocusedRowHandle); if (obj == null) { return; } int kayitid = (gridView1.GetFocusedRowCellValue("ID") == DBNull.Value) ? -1 : (int)gridView1.GetFocusedRowCellValue("ID"); db.UDI_OdemeTipiTanimlari(1, kayitid, gridView1.GetFocusedRowCellValue("OdemeAdi").ToString()); var list = db.S_OdemeTipi().Where(c => c.IsDeleted == false).ToList(); dt = DataControls.ListToDt(list); gridControl1.DataSource = dt; } catch (Exception hata) { throw; } }
private void OdemeTipiTanimlari_Load(object sender, EventArgs e) { SiteDBEntities2 db = new SiteDBEntities2(); var list = db.S_OdemeTipi().Where(c => c.IsDeleted == false).ToList(); dt = DataControls.ListToDt(list); gridControl1.DataSource = dt; }
private void BlokTanimlari_Load(object sender, EventArgs e) { try { SiteDBEntities2 db = new SiteDBEntities2(); //gridControl1.DataSource = db.S_Bloklar().ToList(); var list = db.S_Bloklar().Where(c => c.IsDeleted == false).ToList(); dt = DataControls.ListToDt(list); gridControl1.DataSource = dt; } catch (Exception hata) { throw; } }
private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e) { try { SiteDBEntities2 db = new SiteDBEntities2(); if (!(gridView1.PostEditor() && gridView1.UpdateCurrentRow())) { return; } GridView view = sender as GridView; Object obj = view.GetRow(view.FocusedRowHandle); if (obj == null) { return; } //int product_id_grid = Convert.ToInt32(view.GetDataRow(view.FocusedRowHandle)["ID"].ToString()); int kayitid = (gridView1.GetFocusedRowCellValue("ID") == DBNull.Value) ? -1 : (int)gridView1.GetFocusedRowCellValue("ID"); db.UDI_BlokTanimlari(1, kayitid, gridView1.GetFocusedRowCellValue("BlokAdi").ToString()); //if (view.IsNewItemRow(e.RowHandle)) //{ // //INSERT TSQL // db.UDI_BlokTanimlari(1, kayitid, // gridView1.GetFocusedRowCellValue("BlokAdi").ToString()); //} //else //{ // //UPDATE TSQL // db.UDI_BlokTanimlari(1, kayitid, // gridView1.GetFocusedRowCellValue("BlokAdi").ToString()); //} var list = db.S_Bloklar().Where(c => c.IsDeleted == false).ToList(); dt = DataControls.ListToDt(list); gridControl1.DataSource = dt; } catch (Exception hata) { throw; } }
private void btnSil_ItemClick(object sender, ItemClickEventArgs e) { try { if (XtraMessageBox.Show("Kayıdı silmek istediğinizden eminmisiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { SiteDBEntities2 db = new SiteDBEntities2(); int kayitid = (gridView1.GetFocusedRowCellValue("ID") == DBNull.Value) ? -1 : (int)gridView1.GetFocusedRowCellValue("ID"); db.UDI_BlokTanimlari(2, kayitid, ""); var list = db.S_Bloklar().Where(c => c.IsDeleted == false).ToList(); dt = DataControls.ListToDt(list); gridControl1.DataSource = dt; } } catch (Exception hata) { throw; } }