Esempio n. 1
0
        public static EntityORM Map(VerificationDb verify, HashSet <string> attributes)
        {
            EntityORM entity = new EntityORM();

            foreach (string attribute in attributes)
            {
                object value = null;

                switch (attribute)
                {
                case "EMAIL":
                    value = $"\'{verify.Email}\'";
                    break;

                case "TOKEN":
                    value = $"\'{verify.Token}\'";
                    break;

                case "ENDVERIFYDATE":
                    value = $"TO_TIMESTAMP(\'{verify.EndVerifyDate.ToString("dd.MM.yyyy HH:mm:ss")}\', 'DD.MM.YYYY HH24:MI:SS')";
                    break;
                }

                entity.attributeValue.Add(attribute, value);
            }

            return(entity);
        }
Esempio n. 2
0
        public VerificationDb Map(Verification verify)
        {
            VerificationDb verify_newType = new VerificationDb();

            verify_newType.Email         = verify.Email;
            verify_newType.EndVerifyDate = verify.EndVerifyDate;
            verify_newType.Token         = verify.Token;

            return(verify_newType);
        }
Esempio n. 3
0
        public static void Map(EntityORM entity, out VerificationDb verify)
        {
            verify = new VerificationDb();

            foreach (KeyValuePair <string, object> aV in entity.attributeValue)
            {
                switch (aV.Key)  // entity attribute
                {
                case "EMAIL":
                    verify.Email = aV.Value.ToString();
                    break;

                case "TOKEN":
                    verify.Token = aV.Value.ToString();
                    break;

                case "ENDVERIFYDATE":
                    verify.EndVerifyDate = (DateTime)(aV.Value);
                    break;
                }
            }
        }
Esempio n. 4
0
        public long Create(Verification verify)
        {
            VerificationDb verifydb = mapper.Map(verify);

            return(verifyDAO.Save(verifydb));
        }