public FI.Common.Data.FIDataTable GetContactsPage(int CurrentPage, int RowCount, string FilterExpression, string SortExpression) { int StartIndex = (CurrentPage - 1) * RowCount; FI.Common.DataAccess.IContactsDA dacObj = DataAccessFactory.Instance.GetContactsDA(); FI.Common.Data.FIDataTable table = dacObj.ReadContactsPage(_owner.ID, StartIndex, RowCount, FilterExpression, SortExpression); return(table); }
internal Contact(User Owner) { _owner = Owner; FI.Common.DataAccess.IContactsDA dacObj = DataAccessFactory.Instance.GetContactsDA(); _id = dacObj.InsertContact(_owner.ID, this.Name, this.EMail, this.DistributionFormat.ToString()); _isProxy = false; _isDirty = false; }
public void Save() { this.Validate(true); if (this.IsProxy) { throw new Exception("Cannot save proxy"); } FI.Common.DataAccess.IContactsDA dacObj = DataAccessFactory.Instance.GetContactsDA(); dacObj.UpdateContact(this.Owner.ID, this.ID, this.Name, this.EMail, this.DistributionFormat.ToString()); _isDirty = false; }
public void Fetch() { this.Validate(true); FI.Common.DataAccess.IContactsDA dacObj = DataAccessFactory.Instance.GetContactsDA(); System.Data.DataRow row = dacObj.ReadContact(this._owner.ID, this.ID).Rows[0]; this._name = (string)row["Name"]; this._email = (string)row["EMail"]; this._distributionFormat = (Contact.DistributionFormatEnum)System.Enum.Parse(typeof(Contact.DistributionFormatEnum), (string)row["DistributionFormat"]); _isDirty = false; _isProxy = false; }
public void DeleteContact(Contact contact) { contact.Validate(true); if (BeforeDeleteContact != null) { BeforeDeleteContact(contact, EventArgs.Empty); } FI.Common.DataAccess.IContactsDA dacObj = DataAccessFactory.Instance.GetContactsDA(); dacObj.DeleteContact(contact.Owner.ID, contact.ID); contact = null; }