Пример #1
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         Acc_COA selectedNode = _COA.Find(p => p.COAKey == _SelectedCOAKey);
         if (selectedNode != null)
         {
             //selectedNode.COAKey
             Acc_VoucherDet obj = null;
             if (selectedNode.IsSubsidiary)
             {
                 obj = Acc_VoucherDet.CheckToDelete(selectedNode.COAKey);
             }
             if (obj.IsAdded)
             {
                 selectedNode.Delete();
                 if (SaveCOA())
                 {
                     ((Hr.Web.UI.ACC.COA) this.Page).SuccessMessage = StaticInfo.DeletedSuccessfullyMsg;
                 }
             }
             else
             {
                 ((Hr.Web.UI.ACC.COA) this.Page).ErrorMessage = "Transaction has been occured to this head!";
             }
         }
     }
     catch (Exception ex)
     {
         ((Hr.Web.UI.ACC.COA) this.Page).ErrorMessage = ex.Message;
     }
 }
Пример #2
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         Acc_COA selectedNode = _COA.Find(p => p.COAKey == _SelectedCOAKey);
         if (selectedNode != null)
         {
             selectedNode.Delete();
             if (SaveCOA())
             {
                 ((API.UI.ACC.COA) this.Page).SuccessMessage = StaticInfo.DeletedSuccessfullyMsg;
             }
             ;
         }
     }
     catch (Exception ex)
     {
         ((API.UI.ACC.COA) this.Page).ErrorMessage = ex.Message;
     }
 }