Ejemplo n.º 1
0
        public Guid Insert(IGeneralInfoEntity entity)
        {
            var guid = Guid.NewGuid();

            Update(guid, entity);
            return(guid);
        }
Ejemplo n.º 2
0
        public void Update(Guid guid, IGeneralInfoEntity entity)
        {
            XDocument doc = persister.Load <IGeneralInfoEntity>();

            var ele = GetXElement(doc, guid);

            ele.ReplaceWith(ConvertToXml(guid, entity));

            persister.Persist <IGeneralInfoEntity>(doc);
        }
Ejemplo n.º 3
0
 private XElement ConvertToXml(Guid guid, IGeneralInfoEntity entity)
 {
     return
         (new XElement("GeneralInfo",
                       new XAttribute("Guid", entity.ID),
                       new XElement("FullName", entity.FullName),
                       new XElement("AddLine1", entity.Add1),
                       new XElement("AddLine2", entity.Add2),
                       new XElement("Email", entity.Email),
                       new XElement("Phone", entity.Phone)));
 }
Ejemplo n.º 4
0
 public void Update(Guid g, IGeneralInfoEntity t)
 {
     try
     {
         xs.Update(g, t);
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 5
0
 public Guid Add(IGeneralInfoEntity entity)
 {
     try
     {
         return(xs.Insert(entity));
     }
     catch (Exception)
     {
         throw;
     }
 }