Exemplo n.º 1
0
        public virtual OperationResult Delete(Service service)
        {
            try
            {
                using var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions, TransactionScopeAsyncFlowOption.Enabled);
                _dao.Delete(service);
                transactionScope.Complete();

                return(new OperationResult()
                {
                    Success = true
                });
            }
            catch (Exception e)
            {
                return(new OperationResult()
                {
                    Success = false, Exception = e
                });
            }
        }
Exemplo n.º 2
0
 protected void lv_ThongTinSP_ItemDeleting(object sender, ListViewDeleteEventArgs e)
 {
     if (objCheckPermision.Permission(objCheckPermision.LayQuyen("strTinhNang_Xoa")))
     {
         var hdf = (lv_ThongTinSP.Items[e.ItemIndex].FindControl("hfID")) as HiddenField;
         if (hdf != null)
         {
             ServiceDAO.Delete(Int32.Parse(hdf.Value));
             lv_ThongTinSP.EditIndex = -1;
             BinList();
         }
     }
     else
     {
         iRightAccess.Visible = false;
         objControl.LoadMyControl(idNotPermissionAccess, NotPermissControl);
     }
 }