public int Add(ParameterSystemObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void Remove(ParameterSystemObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Called by ParameterSystemObject when it changes
 internal void ParameterSystemObjectChanged(ParameterSystemObject parameterSystem)
 {
     try
     {
         int index = List.IndexOf(parameterSystem);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         ParameterSystemObject parameterSystem = new ParameterSystemObject();
         List.Add(parameterSystem);
         return(parameterSystem);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 protected override void OnRemoveComplete(int index, object value)
 {
     try
     {
         ParameterSystemObject ParameterSystem = (ParameterSystemObject)value;
         ParameterSystem.Parent = this;
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
示例#6
0
 public void Save(ParameterSystemObject parameter)
 {
     try
     {
         CheckTransaction();
         new ParameterSystemDataService(Transaction).Save(parameter);
         if (IsOwner) Transaction.Commit();
     }
     catch (Exception exception1)
     {
         if (IsOwner) Transaction.Rollback();
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (IsOwner) Connection.Close();
     }
 }
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            try
            {
                if (oldValue != newValue)
                {
                    ParameterSystemObject oldParameterSystem = (ParameterSystemObject)oldValue;
                    ParameterSystemObject newParameterSystem = (ParameterSystemObject)newValue;
                    oldParameterSystem.Parent = null;
                    newParameterSystem.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
 public static ParameterSystemObject ParameterSystemRowToObject(DataRow parameterSystem)
 {
     ParameterSystemObject obj = new ParameterSystemObject();
     try
     {
         if (parameterSystem != null)
         {
             obj.ParID = RowFunctions.GetValueFromRowToGuid(parameterSystem, ParameterSystemObject.PAR_ID, true, DataRowVersion.Current);
             obj.KeyName = RowFunctions.GetValueFromRowToString(parameterSystem, ParameterSystemObject.KEYNAME, true, DataRowVersion.Current);
             obj.Value = RowFunctions.GetValueFromRowToString(parameterSystem, ParameterSystemObject.VALUE, true, DataRowVersion.Current);
             return obj;
         }
         obj = null;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return obj;
 }
示例#9
0
        public static ParameterSystemObject ParameterSystemRowToObject(DataRow parameterSystem)
        {
            ParameterSystemObject obj = new ParameterSystemObject();

            try
            {
                if (parameterSystem != null)
                {
                    obj.ParID   = RowFunctions.GetValueFromRowToGuid(parameterSystem, ParameterSystemObject.PAR_ID, true, DataRowVersion.Current);
                    obj.KeyName = RowFunctions.GetValueFromRowToString(parameterSystem, ParameterSystemObject.KEYNAME, true, DataRowVersion.Current);
                    obj.Value   = RowFunctions.GetValueFromRowToString(parameterSystem, ParameterSystemObject.VALUE, true, DataRowVersion.Current);
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
 public bool Remove(ParameterSystemObject parameterSystem)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "ParameterSystem_DELETE",
             CreateParameter("@parID", SqlDbType.UniqueIdentifier, parameterSystem.ParID, ParameterDirection.Input)
             );
         return true;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
 public void Save(ParameterSystemObject parameterSystem)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "ParameterSystem_SAVE",
             CreateParameter("@parID", SqlDbType.UniqueIdentifier, parameterSystem.ParID, ParameterDirection.InputOutput),
             CreateParameter("@KeyName", SqlDbType.NVarChar, parameterSystem.KeyName),
             CreateParameter("@Value", SqlDbType.NVarChar, parameterSystem.Value)
             );
         parameterSystem.ParID = (Guid)cmd.Parameters["@parID"].Value;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
 // Called by ParameterSystemObject when it changes
 internal void ParameterSystemObjectChanged(ParameterSystemObject parameterSystem)
 {
     try
     {
         int index = List.IndexOf(parameterSystem);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void Remove(ParameterSystemObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         ParameterSystemObject parameterSystem = new ParameterSystemObject();
         List.Add(parameterSystem);
         return parameterSystem;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public int Add(ParameterSystemObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }