public void mapData(AccountingLib.Models.service service) { this.serviceID = service.ID; this.receiverEntityID = (int)service.receiverEntityID; this.issuerEntityID = (int)service.issuerEntityID; this.serviceName = (string)service.name; }
public void New() { using (var ctx = new AccContexts()) { var giverPerson = ctx.person.Where(x => x.entityID == issuerEntityID).FirstOrDefault(); var receiverPerson = ctx.person.Where(x => x.entityID == receiverEntityID).FirstOrDefault(); if (receiverPerson == null || giverPerson == null) throw new Exception("No entities defined"); var newService = new AccountingLib.Models.service() { issuerEntityID=issuerEntityID, receiverEntityID=receiverEntityID, name=serviceName }; ctx.service.AddObject(newService); ctx.SaveChanges(); mapData(newService); } }
public void New() { using (var ctx = new AccContexts()) { var giverPerson = ctx.person.Where(x => x.entityID == issuerEntityID).FirstOrDefault(); var receiverPerson = ctx.person.Where(x => x.entityID == receiverEntityID).FirstOrDefault(); if (receiverPerson == null || giverPerson == null) { throw new Exception("No entities defined"); } var newService = new AccountingLib.Models.service() { issuerEntityID = issuerEntityID, receiverEntityID = receiverEntityID, name = serviceName }; ctx.service.AddObject(newService); ctx.SaveChanges(); mapData(newService); } }
/// <summary> /// Deprecated Method for adding a new object to the service EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToservice(service service) { base.AddObject("service", service); }
/// <summary> /// Create a new service object. /// </summary> /// <param name="id">Initial value of the ID property.</param> public static service Createservice(global::System.Int32 id) { service service = new service(); service.ID = id; return service; }