コード例 #1
0
        public static UserAdditionalDetailsViewBaseModel ToModel(this UserAdditionalDetailsBaseModel entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var model = new UserAdditionalDetailsViewBaseModel
            {
                UserAdditionalDetailID = entity.UserAdditionalDetailID,
                UserID            = entity.UserID,
                ContractingEntity = entity.ContractingEntity,
                IDNumber          = entity.IDNumber,
                EffectiveDate     = entity.EffectiveDate,
                ExpirationDate    = entity.ExpirationDate,
                ModifiedOn        = entity.ModifiedOn
            };

            return(model);
        }
コード例 #2
0
 public void WriteToXML(XmlWriter XWriter, UserAdditionalDetailsBaseModel details, bool isupdate = false)
 {
     XWriter.WriteStartElement("UserAdditionalDetails");
     if (isupdate)
     {
         XWriter.WriteElementString("UserAdditionalDetailID", details.UserAdditionalDetailID.ToString());
     }
     XWriter.WriteElementString("UserID", details.UserID.ToString());
     XWriter.WriteElementString("ContractingEntity", details.ContractingEntity);
     XWriter.WriteElementString("IDNumber", details.IDNumber);
     if (details.EffectiveDate.HasValue)
     {
         XWriter.WriteElementString("EffectiveDate", details.EffectiveDate.Value.ToString());
     }
     if (details.ExpirationDate.HasValue)
     {
         XWriter.WriteElementString("ExpirationDate", details.ExpirationDate.Value.ToString());
     }
     XWriter.WriteElementString("IsActive", true.ToString());
     //XWriter.WriteElementString("ModifiedBy", details.UserID.ToString());
     //XWriter.WriteElementString("ModifiedOn", DateTime.Now.ToString());
     XWriter.WriteEndElement();
 }