Пример #1
0
        public static MemoObject MemoRowToObject(DataRow Memo)
        {
            MemoObject obj = new MemoObject();

            try
            {
                if (Memo != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(Memo, MemoObject.MEMO_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.MemoID = RowFunctions.GetValueFromRowToGuid(Memo, MemoObject.MEMO_ID, true, DataRowVersion.Current);
                        //obj.Material = MaterialConvertor.MaterialRowToObject(Memo);
                        obj.DateTime = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(Memo, MemoObject.DATETIME, false, DataRowVersion.Current));
                        obj.Memo     = RowFunctions.GetValueFromRowToString(Memo, MemoObject.MEMO, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
Пример #2
0
 public static MemoObject MemoRowToObject(DataRow Memo)
 {
     MemoObject obj = new MemoObject();
     try
     {
         if (Memo != null)
         {
             if (RowFunctions.GetValueFromRowToGuid(Memo, MemoObject.MEMO_ID, false, DataRowVersion.Current) != Guid.Empty)
             {
                 obj.MemoID = RowFunctions.GetValueFromRowToGuid(Memo, MemoObject.MEMO_ID, true, DataRowVersion.Current);
                 //obj.Material = MaterialConvertor.MaterialRowToObject(Memo);
                 obj.DateTime = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(Memo, MemoObject.DATETIME, false, DataRowVersion.Current));
                 obj.Memo = RowFunctions.GetValueFromRowToString(Memo, MemoObject.MEMO, false, DataRowVersion.Current);
             }
             return obj;
         }
         obj = null;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return obj;
 }
Пример #3
0
 public int Add(MemoObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #4
0
 public void Remove(MemoObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #5
0
 // Called by MemoObject when it changes
 internal void MemoObjectChanged(MemoObject Memo)
 {
     try
     {
         int index = List.IndexOf(Memo);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #6
0
 protected override void OnRemoveComplete(int index, object value)
 {
     try
     {
         MemoObject Memo = (MemoObject)value;
         Memo.Parent = this;
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #7
0
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         MemoObject Memo = new MemoObject();
         List.Add(Memo);
         return(Memo);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #8
0
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            try
            {
                if (oldValue != newValue)
                {
                    MemoObject oldMemo = (MemoObject)oldValue;
                    MemoObject newMemo = (MemoObject)newValue;
                    oldMemo.Parent = null;
                    newMemo.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Пример #9
0
 public Memo(PROF_IT.Common.Enumerations.TypeForm typeForm, MemoObject memo)
 {
     try
     {
         InitializeComponent();
         _memo     = memo;
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             throw new NotImplementedException();
         }
         else
         {
             InitializePropertyForm();
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #10
0
 public Memo(PROF_IT.Common.Enumerations.TypeForm typeForm, MemoObject memo)
 {
     try
     {
         InitializeComponent();
         _memo = memo;
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             throw new NotImplementedException();
         }
         else
         {
             InitializePropertyForm();
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #11
0
 // Called by MemoObject when it changes
 internal void MemoObjectChanged(MemoObject Memo)
 {
     try
     {
         int index = List.IndexOf(Memo);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #12
0
 public void Remove(MemoObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #13
0
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         MemoObject Memo = new MemoObject();
         List.Add(Memo);
         return Memo;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #14
0
 public int Add(MemoObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Пример #15
0
 public bool Remove(MemoObject memo)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "Memo_DELETE",
             CreateParameter("@memoID", SqlDbType.UniqueIdentifier, memo.Memo, 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;
     }
 }
Пример #16
0
 public void Save(MemoObject memo)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "Memo_SAVE",
             CreateParameter("@memoID", SqlDbType.UniqueIdentifier, memo.MemoID, ParameterDirection.InputOutput),
             CreateParameter("@matID", SqlDbType.UniqueIdentifier, memo.Material == null ? Guid.Empty : memo.Material.MatID),
             CreateParameter("@datetime", SqlDbType.VarChar, PROF_IT.Common.Convert.DateFunctions.DateToLongStrDate(memo.DateTime)),
             CreateParameter("@memo", SqlDbType.VarChar, memo.Memo)
             );
         memo.MemoID = (Guid)cmd.Parameters["@memoID"].Value;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
Пример #17
0
        public void Initialize()
        {
            try
            {
                MemoMember = new MemoObject();

            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }