protected override long OnDownload(object ctx, long start, long end) { if (ctx == null) { throw new System.ArgumentNullException("ctx"); } System.Net.HttpListenerContext context = (System.Net.HttpListenerContext)ctx; string entityTypeName; string propertyName; string entityKey; ParseUri(context.Request.Url, out entityTypeName, out propertyName, out entityKey); if (entityTypeName == "ContactManager.User") { if (propertyName == "Photo") { ContactManager.User entity = ContactManager.User.LoadByEntityKey(entityKey); if (entity != null) { return(OnDownload(context, entity.Photo, start, end)); } throw new System.InvalidOperationException(ContactManager.Resources.Manager.GetStringWithDefault("bitsServerEntityNotFound", "Entity of type '{0}' with entity key '{1}' was not found.", new object[] { entityTypeName, entityKey })); } } throw new System.InvalidOperationException(ContactManager.Resources.Manager.GetStringWithDefault("bitsServerInvalidUrl", "Invalid url '{0}'.", new object[] { context.Request.Url })); }
public virtual ContactManager.ContactCollection LoadByUser(string userEntityKey) { if ((userEntityKey == null)) { throw new System.ArgumentNullException("userEntityKey"); } ContactManager.User user = ContactManager.User.LoadByEntityKey(userEntityKey); return(ContactManager.ContactCollection.LoadByUser(user)); }
public virtual bool DeleteByKey(int id) { ContactManager.User user = ContactManager.User.Load(id); if ((user == null)) { return(CodeFluentPersistence.DefaultBooleanValue); } return(user.Delete()); }
public virtual ContactManager.ContactCollection PageLoadByUser(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, string userEntityKey) { if ((userEntityKey == null)) { throw new System.ArgumentNullException("userEntityKey"); } ContactManager.User user = ContactManager.User.LoadByEntityKey(userEntityKey); return(ContactManager.ContactCollection.PageLoadByUser(pageIndex, pageSize, pageOptions, user)); }
public virtual bool Save(ContactManager.User user) { ContactManager.User user1 = user; if ((user1 == null)) { return(CodeFluentPersistence.DefaultBooleanValue); } return(user1.Save()); }
public virtual string Validate(ContactManager.User user, string culture) { System.Globalization.CultureInfo cultureInfo = ConvertUtilities.ToCultureInfo(culture); ContactManager.User user1 = user; if ((user1 == null)) { return(default(string)); } return(user1.Validate(cultureInfo)); }
public virtual bool SaveByRef(ref ContactManager.User user) { ContactManager.User user1 = user; if ((user1 == null)) { return(CodeFluentPersistence.DefaultBooleanValue); } bool ret = user1.Save(); user = user1; return(ret); }
public virtual CodeFluent.Runtime.BinaryServices.BinaryLargeObjectMessage SavePhoto(CodeFluent.Runtime.BinaryServices.BinaryLargeObjectMessage request) { if ((request == null)) { throw new System.ArgumentNullException("request"); } ContactManager.User user = ContactManager.User.LoadByEntityKey(request.EntityKey); if ((user == null)) { return(new CodeFluent.Runtime.BinaryServices.BinaryLargeObjectMessage(request)); } return(UserService._cf_rt_wcfServer.Save(user.Photo, request)); }
public override CodeFluent.Runtime.BinaryServices.BinaryLargeObject LoadBinaryLargeObject(System.Web.HttpContext context, string propertyName, object[] identifiersValues) { if ((this.EntityClrFullTypeName == "ContactManager.User")) { ContactManager.User User = ContactManager.User.Load(((int)(ConvertUtilities.ChangeType(identifiersValues[0], typeof(int), -1)))); if ((User == null)) { return(null); } if ((propertyName == "User_Photo")) { return(User.Photo); } } return(null); }
protected virtual void OnSessionClose(System.Net.HttpListenerContext context, CodeFluent.Runtime.BinaryServices.Session session, string entityTypeName, string propertyName, string entityKey) { if (entityTypeName == "ContactManager.User") { if (propertyName == "Photo") { ContactManager.User entity = ContactManager.User.LoadByEntityKey(entityKey); if (entity != null) { CloseSession(context, entity.Photo, session); return; } } } throw new System.InvalidOperationException(ContactManager.Resources.Manager.GetStringWithDefault("bitsServerInvalidUrl", "Invalid url '{0}'.", new object[] { context.Request.Url })); }
protected internal void OnEntityDeserializing(System.Runtime.Serialization.StreamingContext context) { this.IsDeserializing = true; this._raisePropertyChangedEvents = true; this._id = -1; this._email = default(string); this._firstName = default(string); this._lastName = default(string); this._contactSourceId = -1; this._contactSource = null; this._status = ContactManager.Status.Valid; this._addressId = -1; this._address = null; this._userId = -1; this._user = null; this._description = default(string); this._entityState = CodeFluent.Runtime.CodeFluentEntityState.Created; this._raisePropertyChangedEvents = true; }