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); }
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; }
public int Add(MemoObject value) { try { return(List.Add(value)); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public void Remove(MemoObject value) { try { List.Remove(value); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
// 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); } }
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); } }
// 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); } }
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); } }
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); } }
// 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); } }
public int Add(MemoObject value) { try { return List.Add(value); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
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; } }
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; } }
public void Initialize() { try { MemoMember = new MemoObject(); } catch (System.Exception exception1) { System.Exception innerException = exception1; throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException); } }