All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alachisoft.ncache.ncactivate.appdata.UserInf Maven / Gradle / Ivy

There is a newer version: 5.3.3
Show newest version
/*
 * UserInfo.java
 *
 * Created on October 7, 2006, 3:40 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.alachisoft.ncache.ncactivate.appdata;

import com.alachisoft.ncache.licensing.config.InfoType;
import com.alachisoft.ncache.ncactivate.utils.RegKeys;
import com.alachisoft.ncache.ncactivate.utils.RegUtil;

import java.util.Locale;

/**
 * @author Administrator
 */
public class UserInf {

    public String FirstName;
    public String LastName;
    public String Company;
    public String Address1;
    public String Zip;
    public String City;
    public String State;
    public String Country;
    public String Phone;
    public String EmailAddr;

    /**
     * Creates a new instance of UserInfo
     */
    public UserInf() {
    }

    public int Load() {
        FirstName = RegUtil.getKey(InfoType.USER, RegKeys.FirstName);
        LastName = RegUtil.getKey(InfoType.USER, RegKeys.LastName);
        Company = RegUtil.getKey(InfoType.USER, RegKeys.Company);
        Address1 = RegUtil.getKey(InfoType.USER, RegKeys.Zip);
        Zip = RegUtil.getKey(InfoType.USER, RegKeys.Zip);
        City = RegUtil.getKey(InfoType.USER, RegKeys.City);
        State = RegUtil.getKey(InfoType.USER, RegKeys.State);
        Country = RegUtil.getKey(InfoType.USER, RegKeys.Country);
        Phone = RegUtil.getKey(InfoType.USER, RegKeys.Phone);
        EmailAddr = RegUtil.getKey(InfoType.USER, RegKeys.Email);
        return 0;
    }

    public void Save() {
        RegUtil.setKey(InfoType.USER, RegKeys.FirstName, FirstName);
        RegUtil.setKey(InfoType.USER, RegKeys.LastName, LastName);
        RegUtil.setKey(InfoType.USER, RegKeys.Company, Company);
        RegUtil.setKey(InfoType.USER, RegKeys.Address, Address1);
        RegUtil.setKey(InfoType.USER, RegKeys.Zip, Zip);
        RegUtil.setKey(InfoType.USER, RegKeys.City, City);
        RegUtil.setKey(InfoType.USER, RegKeys.State, State);
        RegUtil.setKey(InfoType.USER, RegKeys.Country, Country);
        RegUtil.setKey(InfoType.USER, RegKeys.Phone, Phone);
        RegUtil.setKey(InfoType.USER, RegKeys.Email, EmailAddr);

    }

    public String ToXml() {
        String xml = new String("");

        xml += "";
        xml += FirstName;
        xml += "";

        xml += "";
        xml += LastName;
        xml += "";

        xml += "";
        xml += EmailAddr;
        xml += "";

        xml += "";
        xml += Company;
        xml += "";

        xml += "
"; xml += Address1; xml += "
"; xml += ""; xml += City; xml += ""; xml += ""; xml += State; xml += ""; xml += ""; xml += Zip; xml += ""; xml += ""; xml += Country; xml += ""; xml += ""; xml += Phone; xml += ""; xml += "
"; return xml; } public String ToLinearText() { String text = String.format(Locale.US, "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s", FirstName, LastName, EmailAddr, Company, Address1, City, State, Zip, Country, Phone); return text; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy