예제 #1
0
    public IEnumerator SaveData(Expenses a_expenses)
    {
        ExpenseDataHandler.m_yearlyExpenseInfo.expenseInfo[m_myDate.Month - 1].Bazaar[m_myDate.Day - 1]   = a_expenses.Bazaar;
        ExpenseDataHandler.m_yearlyExpenseInfo.expenseInfo[m_myDate.Month - 1].Shopping[m_myDate.Day - 1] = a_expenses.Shopping;
        ExpenseDataHandler.m_yearlyExpenseInfo.expenseInfo[m_myDate.Month - 1].Office[m_myDate.Day - 1]   = a_expenses.Office;
        ExpenseDataHandler.m_yearlyExpenseInfo.expenseInfo[m_myDate.Month - 1].Others[m_myDate.Day - 1]   = a_expenses.Other;

        yield return(new WaitForSeconds(0.5f));

        ExpenseDataHandler.SaveData("2018", ExpenseDataHandler.m_yearlyExpenseInfo);
        MonthManager.m_instance.m_Start();
    }
    // Use this for initialization
    //   IEnumerator Start () {
    //       //Calendar a = new GregorianCalendar();
    //       Hashtable hash;
    //       m_text.text = m_text.text + Application.persistentDataPath+ "/utt.txt";
    //       try
    //       {
    //            hash = FileHandler.GetData("utt", ref m_text);
    //
    //       }
    //       catch(Exception ex)
    //       {
    //           m_text.text = m_text.text + ex.Message;
    //       }
    //       try
    //       {
    //           FileHandler.SetData("utt", "  Oye Who the hell is there = Main hoon be");
    //       }
    //       catch(Exception ex)
    //       {
    //           m_text.text = m_text.text + ex.Message;
    //       }
    //
    //       yield return new WaitForSeconds(2);
    //       hash = FileHandler.GetData("utt", ref m_text);
    //
    //
    //}
    //void Start()
    //{
    //    DayWiseShortDataInfo[] shortData = CalendarHandler.GetSpecificMonthData(DateTime.Today);
    //    Debug.Log("Short data: ");
    //}
    private void Awake()
    {
        //TextAsset l_Text = Resources.Load("uttas") as TextAsset;

        //YearlyExpenseInfo exp = new YearlyExpenseInfo();
        //JsonUtility.FromJsonOverwrite(l_Text.text,exp);

        //Debug.Log("boom: "+exp.expenseInfo[0].Bazaar[2]);

        ExpenseDataHandler.LoadData("2018");
        ExpenseDataHandler.SaveData("2018", ExpenseDataHandler.m_yearlyExpenseInfo);

        // m_text.text = AndroidUtility.GetAndroidExternalStoragePath();
        Debug.Log("Data loading complete");
    }
예제 #3
0
    public void SaveData()
    {
        if (m_expensePanelZone.m_bazar != null)
        {
            Expenses l_expenses = new Expenses();

            l_expenses.Bazaar   = int.Parse(m_expensePanelZone.m_bazar.m_expenseCellZone.m_inputField.text);
            l_expenses.Shopping = int.Parse(m_expensePanelZone.m_shopping.m_expenseCellZone.m_inputField.text);
            l_expenses.Office   = int.Parse(m_expensePanelZone.m_office.m_expenseCellZone.m_inputField.text);
            l_expenses.Other    = GenerateOtherString(m_expensePanelZone.m_other.m_expenseOtherCellZone);

            UIManager.m_instance.OpenMonthPanel();
            m_action.Invoke(l_expenses);
        }
        else
        {
            ExpenseDataHandler.m_yearlyExpenseInfo.expenseInfo[GlobalRuntimeValue.m_CurrentMonthStartDate.Month].Fixed = GenerateOtherString(m_expensePanelZone.m_fixed.m_expenseOtherCellZone);
            ExpenseDataHandler.SaveData("2018", ExpenseDataHandler.m_yearlyExpenseInfo);

            //UIManager.m_instance.OpenMonthPanel();
            // UIManager.m_instance.m_uiZone.FixedPanel.gameObject.SetActive(false);
        }
    }