示例#1
0
    public void resetColors()
    {
        ColorDB mColorDB = new ColorDB();

        mColorDB.deleteAllData();
        txt.text = "Select a Color for Family:";
    }
示例#2
0
    void addColor(string id, string group, string color)
    {
        ColorDB mColorDB = new ColorDB();

        mColorDB.addData(new ColorData(id, group, color));
        mColorDB.close();
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        /*
         * Ignore this error.  It is a LIE.  A flithy LIE.  It really compiles.
         *      |
         *      |
         *      V
         */
        if (Request.Cookies[COOKIE_ID] != null)
        {
            //this.ti
            HttpCookie orgCookie = Request.Cookies[COOKIE_ID];
            titleLbl.Text = orgCookie.Value + " Movie Exchange";
        }
        //siteHeader.Attributes.Add("bgcolor", "red");
        //PageBody.Attributes.Add("bgcolor", "red");

        try
        {
            if (Request.Cookies[COOKIE_ID].Value != null)
            {
                Tuple <String, String> output = ColorDB.getColors(Request.Cookies[COOKIE_ID].Value);
                testingLabel.Text = output.Item1 + " " + output.Item2;
                PageBody.Attributes.Add("bgcolor", output.Item1);
                BackgroundPanel.Attributes.Add("BackColor", output.Item2);
            }
        }
        catch (Exception exp)
        {
            testingLabel.Text = exp.Message;
        }
    }
    public void SetColors()
    {
        ColorDB mColorDB = new ColorDB();

        System.Data.IDataReader reader = mColorDB.getAllData();

        List <ColorData> myList = new List <ColorData>();

        while (reader.Read())
        {
            ColorData entity = new ColorData(reader[0].ToString(),
                                             reader[1].ToString(),
                                             reader[2].ToString(),
                                             reader[3].ToString());

            Debug.Log("id: " + entity._id + "\tcolor: " + entity._color + "\tgroup: " + entity._type);
            myList.Add(entity);
        }
        int i = 0;

        foreach (ColorData entity in myList)
        {
            if (i == 0)
            {
                closeColor = myList[i]._color;
                Debug.Log("Close color is " + myList[i]._color.ToString());
                closeCircle.material = mats[MatNum(myList[i]._color.ToString())];
            }
            else if (i == 1)
            {
                nearColor = myList[i]._color;
                Debug.Log("Near color is " + myList[i]._color.ToString());
                nearCircle.material = mats[MatNum(myList[i]._color.ToString())];
            }
            else
            {
                farColor = myList[i]._color;
                Debug.Log("Far color is " + myList[i]._color.ToString());
                farCircle.material = mats[MatNum(myList[i]._color.ToString())];
            }
            i++;
        }
    }
示例#5
0
    public void readDatabase()
    {
        ColorDB mColorDB = new ColorDB();

        System.Data.IDataReader reader = mColorDB.getAllData();

        List <ColorData> myList = new List <ColorData>();

        while (reader.Read())
        {
            ColorData entity = new ColorData(reader[0].ToString(),
                                             reader[1].ToString(),
                                             reader[2].ToString(),
                                             reader[3].ToString());

            Debug.Log("id: " + entity._id + "\tcolor: " + entity._color + "\tgroup: " + entity._type);
            myList.Add(entity);
        }
    }
示例#6
0
    public void selectColor()
    {
        ColorDB mColorDB = new ColorDB();

        System.Data.IDataReader reader = mColorDB.getAllData();

        List <ColorData> myList = new List <ColorData>();

        while (reader.Read())
        {
            ColorData entity = new ColorData(reader[0].ToString(),
                                             reader[1].ToString(),
                                             reader[2].ToString(),
                                             reader[3].ToString());
            myList.Add(entity);
        }

        int count = myList.Count;

        string btn = EventSystem.current.currentSelectedGameObject.name;

        if (count == 0)
        {
            addColor("1", "Family", btn);
            txt.text = "Select a Color for Friends:";
        }
        else if (count == 1)
        {
            addColor("2", "Friends", btn);
            txt.text = "Select a Color for Strangers:";
        }
        else if (count == 2)
        {
            addColor("3", "Strangers", btn);
            SceneManager.LoadScene("UploadPicOrNotSection");
        }
        else
        {
            resetColors();
        }
        mColorDB.close();
    }
示例#7
0
 public void methodTest()
 {
     Tuple <String, String> output = ColorDB.getColors("Western Oregon University");
     String Color1 = output.Item1;
     String Color2 = output.Item2;
 }