예제 #1
0
        public static void SetEquipmentTable(ref DataGrid TableGridWPF, ref List <Equipment> equipment)
        {
            equipment = GetEquipment();
            List <EquipmentTable> tableList = new List <EquipmentTable>();

            for (int i = 0; i < equipment.Count; ++i)
            {
                tableList.Add(new EquipmentTable {
                    ID       = equipment[i].id.ToString(),
                    Provider = TransferInfo.namesInsteadOfIds ? Funcad.GetProvider(equipment[i].providerId).name : equipment[i].providerId.ToString(),
                    Amount   = equipment[i].amount,
                    Type     = equipment[i].type
                });
            }
            TableGridWPF.ItemsSource = tableList;
        }
예제 #2
0
        public static void SetMachinesTable(ref DataGrid TableGridWPF, ref List <Machine> machines)
        {
            machines = GetMachines();
            List <MachineTable> tableList = new List <MachineTable>();

            for (int i = 0; i < machines.Count; ++i)
            {
                tableList.Add(new MachineTable {
                    ID        = machines[i].id.ToString(),
                    Provider  = TransferInfo.namesInsteadOfIds ? Funcad.GetProvider(machines[i].providerId).name : machines[i].providerId.ToString(),
                    Condition = machines[i].condition,
                    Type      = machines[i].type
                });
            }
            TableGridWPF.ItemsSource = tableList;
        }
예제 #3
0
        public static void SetReleasesTable(ref DataGrid TableGridWPF, ref List <Release> machines)
        {
            machines = GetReleases();
            List <ReleaseTable> tableList = new List <ReleaseTable>();

            for (int i = 0; i < machines.Count; ++i)
            {
                tableList.Add(new ReleaseTable {
                    ID        = TransferInfo.idOnReleases ? machines[i].id.ToString() : "",
                    Amount    = machines[i].amount,
                    Newspaper = TransferInfo.namesInsteadOfIds ? Funcad.GetNewspaper(machines[i].newspaperId).title : machines[i].newspaperId.ToString(),
                    Paper     = TransferInfo.namesInsteadOfIds ? Funcad.GetProvider(Funcad.GetEquipment(machines[i].paperId).providerId).name : machines[i].paperId.ToString(),
                    Ink       = TransferInfo.namesInsteadOfIds ? Funcad.GetProvider(Funcad.GetEquipment(machines[i].inkId).providerId).name : machines[i].inkId.ToString(),
                    Checker   = TransferInfo.namesInsteadOfIds ? Funcad.GetProvider(Funcad.GetMachine(machines[i].checkerId).providerId).name : machines[i].checkerId.ToString(),
                });
            }
            TableGridWPF.ItemsSource = tableList;
        }