Ejemplo n.º 1
0
 private void gv_RowDeleting(object sender, DevExpress.Data.RowDeletingEventArgs e)
 {
     try
     {
         filen ct = (from c in dbData.filens select c).Single(x => x.key == gv.GetFocusedRowCellValue("key").ToString());
         dbData.filens.DeleteOnSubmit(ct);
     }
     catch
     {
     }
 }
Ejemplo n.º 2
0
        public void xoa(string key)
        {
            using (var trans = new TransactionScope())
            {
                dbData = new KetNoiDBDataContext();
                nhansu ns = (from a in dbData.nhansus select a).Single(t => t.key == key);
                dbData.nhansus.DeleteOnSubmit(ns);

                var f = (from a in dbData.filens where a.keyns == key select a);
                foreach (var fa in f)
                {
                    filen file = fa;
                    dbData.filens.DeleteOnSubmit(fa);
                }
                dbData.SubmitChanges();
                trans.Complete();
            }
        }