InvoiceItemRecord newEmptyRecord()
    {
        InvoiceItemRecord newInvoiceItems = new InvoiceItemRecord();

        newInvoiceItems.description_List = new List <string> ();
        newInvoiceItems.quantity_List    = new List <string> ();
        newInvoiceItems.unitPrice_List   = new List <string> ();
        newInvoiceItems.nettAmount_List  = new List <string> ();

        for (int i = 0; i < 17; i++)
        {
            newInvoiceItems.description_List.Add("");
            newInvoiceItems.quantity_List.Add("");
            newInvoiceItems.unitPrice_List.Add("");
            newInvoiceItems.nettAmount_List.Add("");
        }
        return(newInvoiceItems);
    }
    InvoiceRecords_Details NewEmptyInvoice()
    {
        InvoiceRecords_Details newInvoice = new InvoiceRecords_Details();

        newInvoice.invoiceID = (invoiceList.Count).ToString("0000");
        Debug.Log("Here Invoice ID : " + newInvoice.invoiceID);
        newInvoice.projectTitle  = "New Project " + newInvoice.invoiceID;
        newInvoice.clientData_ID = "empty";

        //Create a newRecords for one page
        InvoiceItemRecord newInvoiceItems = new InvoiceItemRecord();

        newInvoiceItems = newEmptyRecord();

        newInvoice.itemDetails_List = new List <InvoiceItemRecord> ();
        newInvoice.itemDetails_List.Add(newInvoiceItems);

        return(newInvoice);
    }
Ejemplo n.º 3
0
    public void startLoad()
    {
        thisPageRecords = new InvoiceItemRecord();
        thisPageRecords.quantity_List    = new List <string> ();
        thisPageRecords.description_List = new List <string> ();
        thisPageRecords.unitPrice_List   = new List <string> ();
        thisPageRecords.nettAmount_List  = new List <string> ();

        targetQuantity.newEmptyList();
        targetDescription.newEmptyList();
        targetUnitPrice.newEmptyList();
        targetNettAmount.newEmptyList();

        thisPageRecords = DataManager_New.instance.invoiceList [thisPage_invoiceID].itemDetails_List[thisPage_id];

        for (int i = 0; i < thisPageRecords.quantity_List.Count; i++)
        {
            targetQuantity.currentStringList[i] = thisPageRecords.quantity_List[i];
        }

        for (int i = 0; i < thisPageRecords.description_List.Count; i++)
        {
            targetDescription.currentStringList[i] = thisPageRecords.description_List[i];
        }
        for (int i = 0; i < thisPageRecords.unitPrice_List.Count; i++)
        {
            targetUnitPrice.currentStringList[i] = thisPageRecords.unitPrice_List[i];
        }
        for (int i = 0; i < thisPageRecords.nettAmount_List.Count; i++)
        {
            targetNettAmount.currentStringList[i] = thisPageRecords.nettAmount_List[i];
        }

        targetQuantity.RefreshList();
        targetDescription.RefreshList();
        targetUnitPrice.RefreshList();
        targetNettAmount.RefreshList();
    }
    public void copyData(int from_, int to_)
    {
        Debug.Log("COPY DATA START");
        InvoiceItemRecord[] newInvoiceItemRecord = new InvoiceItemRecord[invoiceList [from_].itemDetails_List.Count];
        invoiceList [from_].itemDetails_List.CopyTo(newInvoiceItemRecord);
        invoiceList [to_].itemDetails_List.Clear();

        for (int i = 0; i < newInvoiceItemRecord.Length; i++)
        {
            invoiceList [to_].itemDetails_List.Add(newEmptyRecord());
            invoiceList [to_].itemDetails_List [i].quantity_List.Clear();
            invoiceList [to_].itemDetails_List [i].description_List.Clear();
            invoiceList [to_].itemDetails_List [i].unitPrice_List.Clear();
            invoiceList [to_].itemDetails_List [i].nettAmount_List.Clear();

            for (int j = 0; j < 17; j++)
            {
                string newString;

                //List<string> newStringList_qty = new List<string> ();
                newString = newInvoiceItemRecord [i].quantity_List [j];
                invoiceList [to_].itemDetails_List[i].quantity_List.Add(newString);

                //List<string> newStringList_des = new List<string> ();
                newString = newInvoiceItemRecord [i].description_List [j];
                invoiceList [to_].itemDetails_List[i].description_List.Add(newString);

                //List<string> newStringList_uPrice = new List<string> ();
                newString = newInvoiceItemRecord [i].unitPrice_List [j];
                invoiceList [to_].itemDetails_List[i].unitPrice_List.Add(newString);

                //List<string> newStringList_nett = new List<string> ();
                newString = newInvoiceItemRecord [i].nettAmount_List [j];
                invoiceList [to_].itemDetails_List[i].nettAmount_List.Add(newString);
            }
        }
        saveInvoiceFile(invoiceList);
    }
Ejemplo n.º 5
0
 void set(InvoiceItemRecord inputData)
 {
     thisPageRecords = inputData;
     putToUI();
 }