Exemplo n.º 1
0
    public TIGER_MACHINE FindById(string id)
    {
        this.cs = Document.Instance.GetSheet("TIGER_MACHINE");
        if (this.cs == null)
        {
            return(null);
        }

        TIGER_MACHINE ss = new TIGER_MACHINE();

        DataRow[] drs = this.cs.Data.Select("NUM='" + id + "'");
        if (drs.Length > 0)
        {
            DataRow dr = drs[0];
            ss.NUM      = dr["NUM"].ToString();
            ss.GOLD     = int.Parse(dr["GOLD"].ToString());
            ss.HP       = double.Parse(dr["HP"].ToString());
            ss.NULL_PCT = double.Parse(dr["NULL_PCT"].ToString());
        }

        return(ss);
    }
Exemplo n.º 2
0
    public List <TIGER_MACHINE> GetAll()
    {
        List <TIGER_MACHINE> list = new List <TIGER_MACHINE>();

        this.cs = Document.Instance.GetSheet("TIGER_MACHINE");
        if (this.cs == null)
        {
            return(list);
        }

        DataRow[] drs = this.cs.Data.Select();
        foreach (DataRow dr in drs)
        {
            TIGER_MACHINE ss = new TIGER_MACHINE();

            ss.NUM      = dr["NUM"].ToString();
            ss.GOLD     = int.Parse(dr["GOLD"].ToString());
            ss.HP       = double.Parse(dr["HP"].ToString());
            ss.NULL_PCT = double.Parse(dr["NULL_PCT"].ToString());
            list.Add(ss);
        }

        return(list);
    }