コード例 #1
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;
            }
        }
コード例 #2
0
ファイル: Memo.cs プロジェクト: GianiWVL/VUYLSTEKE
 public void Save(MemoObject memo)
 {
     try
     {
         CheckTransaction();
         new MemoDataService(Transaction).Save(memo);
         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();
         }
     }
 }
コード例 #3
0
            public bool Equals(MemoObject obj)
            {
                if (hashCode != obj.hashCode)
                {
                    return(false);
                }
                if (type != obj.type)
                {
                    return(false);
                }
                if (FieldsLength() != obj.FieldsLength())
                {
                    return(false);
                }
                int length = FieldsLength();

                for (int i = 0; i < length; i++)
                {
                    if (fields[i] != obj.fields[i])
                    {
                        return(false);
                    }
                }
                if (primitiveIntValue != obj.primitiveIntValue)
                {
                    return(false);
                }
                if (primitiveDoubleValue != obj.primitiveDoubleValue)
                {
                    return(false);
                }
                return(true);
            }
コード例 #4
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;
            }
        }
コード例 #5
0
ファイル: Memo.cs プロジェクト: GianiWVL/VUYLSTEKE
 public void Initialize()
 {
     try
     {
         MemoMember = new MemoObject();
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #6
0
ファイル: Material.cs プロジェクト: GianiWVL/VUYLSTEKE
 private void btnRemoveMemo_Click(object sender, EventArgs e)
 {
     try
     {
         MemoObject memo = (MemoObject)gdvMemo.GetRow(gdvMemo.FocusedRowHandle);
         memo.State         = PROF_IT.Common.Enumerations.ObjectState.Deleted;
         gdcMemo.DataSource = MaterialMember.Memos.GetActive();
     }
     catch (System.Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }
コード例 #7
0
ファイル: Material.cs プロジェクト: GianiWVL/VUYLSTEKE
 private void gdvMemo_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     try
     {
         CardView view = (CardView)sender;
         if (view.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle)
         {
             MemoObject memo = (MemoObject)view.GetRow(view.FocusedRowHandle);
             if (memo != null)
             {
                 memo.Material = MaterialMember;
                 new BL.Internal.Memo().Save(memo);
             }
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }
コード例 #8
0
ファイル: Memo.cs プロジェクト: GianiWVL/VUYLSTEKE
 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);
     }
 }
コード例 #9
0
ファイル: MemoState.cs プロジェクト: DragonXYZ/cilpe
 public bool Equals(MemoObject obj)
 {
     if(hashCode != obj.hashCode)
         return(false);
     if(type != obj.type)
         return(false);
     if(FieldsLength() != obj.FieldsLength())
         return(false);
     int length = FieldsLength();
     for(int i=0; i<length; i++)
     {
         if(fields[i] != obj.fields[i])
             return(false);
     }
     if(primitiveIntValue != obj.primitiveIntValue)
         return(false);
     if(primitiveDoubleValue != obj.primitiveDoubleValue)
         return(false);
     return(true);
 }