Пример #1
0
 public bool Delete(bool isWeb = false)
 {
     ClassLibrary.JConnection C  = new ClassLibrary.JConnection();
     ClassLibrary.JDataBase   db = new ClassLibrary.JDataBase(C.GetConnection("Server02", 0));
     try
     {
         if (!JPermission.CheckPermission("BusManagment.Bus.JBus.Delete"))
         {
             return(false);
         }
         JBusTable AT = new JBusTable();
         AT.SetValueProperty(this);
         if (AT.Delete(db))
         {
             if (!isWeb)
             {
                 Nodes.Delete(Nodes.CurrentNode);
             }
             ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory();
             jHistory.Save("BusManagment.JBus", AT.Code, 0, 0, 0, "حذف اتوبوس", "", 0);
             return(true);
         }
         else
         {
             return(false);
         }
     }
     finally
     {
         db.Dispose();
     }
 }
Пример #2
0
 public int Insert(bool isWeb = false)
 {
     ClassLibrary.JConnection C  = new ClassLibrary.JConnection();
     ClassLibrary.JDataBase   db = new ClassLibrary.JDataBase(C.GetConnection("Server02", 0));
     try
     {
         if (!JPermission.CheckPermission("BusManagment.Bus.JBus.Insert"))
         {
             return(0);
         }
         JBusTable AT = new JBusTable();
         AT.SetValueProperty(this);
         Code = AT.Insert(db);
         ClassLibrary.JHistory jHistory = new ClassLibrary.JHistory();
         jHistory.Save("BusManagment.JBus", Code, 0, 0, 0, "ثبت اتوبوس", "", 0);
         return(Code);
     }
     finally
     {
         db.Dispose();
     }
 }