Exemplo n.º 1
0
    public static SurveyDataYearly LoadScoreYearly(LoadYearlyData yearlyData)
    {
        //string path = "C:/coba/" + "/survey" + yearlyData.selectedYear + ".chaedir";
        string path = Application.persistentDataPath + "/survey" + yearlyData.selectedYear + ".chaedir";

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.Open);

            SurveyDataYearly DataYearly = formatter.Deserialize(stream) as SurveyDataYearly;
            stream.Close();

            yearlyData.announcement.text = "";

            return(DataYearly);
        }
        else
        {
            yearlyData.announcement.text       = "Data tidak ditemukan";
            yearlyData.loadSP_ScoreYearly.text = "";
            yearlyData.loadP_ScoreYearly.text  = "";
            yearlyData.loadTP_ScoreYearly.text = "";
            return(null);
        }
    }
    public void LoadScoreYearlyNow()
    {
        SurveyDataYearly data = SaveSystem.LoadScoreYearlyNow(this);

        sp_scoreYearly = data.sangatPuasYearly;
        p_scoreYearly  = data.puasYearly;
        tp_scoreYearly = data.tidakPuasYearly;
    }
Exemplo n.º 3
0
    public void LoadScoreYearly()
    {
        SurveyDataYearly data = SaveSystem.LoadScoreYearly(this);

        load_sp_scoreYearly = data.sangatPuasYearly;
        load_p_scoreYearly  = data.puasYearly;
        load_tp_scoreYearly = data.tidakPuasYearly;

        loadSP_ScoreYearly.text = "" + load_sp_scoreYearly;
        loadP_ScoreYearly.text  = "" + load_p_scoreYearly;
        loadTP_ScoreYearly.text = "" + load_tp_scoreYearly;
    }
Exemplo n.º 4
0
    public static void SaveScoreYearly(ButtonHandler Yearly)
    {
        DateTime time = DateTime.Now;
        int      year = time.Year;

        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/survey" + year + ".chaedir";
        //string path = "C:/coba/" + "/survey" + year + ".chaedir";
        FileStream stream = new FileStream(path, FileMode.Create);

        SurveyDataYearly data = new SurveyDataYearly(Yearly);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Exemplo n.º 5
0
    public static SurveyDataYearly LoadScoreYearlyNow(ButtonHandler yearlyDataNow)
    {
        DateTime time = DateTime.Now;
        //int second = time.Second;
        int year = time.Year;

        string path = Application.persistentDataPath + "/survey" + year + ".chaedir";

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.Open);

            SurveyDataYearly dataYearly = formatter.Deserialize(stream) as SurveyDataYearly;
            stream.Close();

            return(dataYearly);
        }
        else
        {
            return(null);
        }
    }