public void Should_FileNotFoundException_When_FileDoesNotExist()
        {
            Mock <IDirectoryFile> mockDirectoryFile = new Mock <IDirectoryFile>();

            mockDirectoryFile
            .Setup(o => o.IsValidFileName(It.IsAny <string>()))
            .Returns(true);
            mockDirectoryFile
            .Setup(o => o.FileExists(It.IsAny <string>()))
            .Returns(false);

            ReadFromFile readFromFile = new ReadFromFile(mockDirectoryFile.Object);

            Assert.Throws <FileNotFoundException>(() => readFromFile.ReadAllLines(string.Empty));
        }
Beispiel #2
0
        public static void Main()
        {
            ReadFromFile.Read();
            Queue <char> QueueEdge = new Queue <char>();

            Console.Write("Input Total Days Infected: ");
            int time = Convert.ToInt32(Console.ReadLine());

            //ReadFromFile.EdgeData is data which contains Data of Edge
            //ReadFromFile.GraphData is data which contains Data of Graph

            //Init Graph G sudah di ReadFile
            ReadFromFile.province.printGraph();
            BFS.BFSCompute(time, ReadFromFile.source);
            BFS.printSol(time);
            Visualisasi.Visual();
        }
        public void Should_ReturnNull_When_DirectoryDoesNotExist()
        {
            Mock <IDirectoryFile> mockDirectoryFile = new Mock <IDirectoryFile>();

            mockDirectoryFile
            .Setup(o => o.GetCurrentDirectory())
            .Returns("DirectoryTeste");
            mockDirectoryFile
            .Setup(o => o.DirectoryExists(It.IsAny <string>()))
            .Returns(false);

            ReadFromFile readFromFile = new ReadFromFile(mockDirectoryFile.Object);
            var          files        = readFromFile.GetFiles("folder");

            Assert.Null(files);
            mockDirectoryFile.Verify(o => o.GetCurrentDirectory(), Times.Once);
            mockDirectoryFile.Verify(o => o.DirectoryExists(It.IsAny <string>()), Times.Once);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            // How to iterate through a directory tree
            RecursiveFileSearch.Run();
            StackBasedIteration.Run(@"C:\SAJ");

            FileSysInfo.Run();
            CreateFileOrFolder.Run();
            SimpleFileCopy.Run();
            SimpleFileMove.Run();
            SimpleFileDelete.Run();
            WriteTextFile.Run();
            ReadFromFile.Run();
            // How to create a key in the registry
            RegistryTest.Run();
        }
Beispiel #5
0
    void Awake()
    {
        if (GM)
        {
            Destroy(this);
        }
        else
        {
            GM = this;
            IC = FindObjectOfType <IngameConsole>();
        }

        IC.WriteToConsole("i will load the feeds now");   //===== ===== LOG ===== =====
        AllFeeds = ReadFromFile.LoadFeeds(FeedPath);
        IC.WriteToConsole("i will load the filters now"); //===== ===== LOG ===== =====
        AllFilters = ReadFromFile.LoadFilters(FilterPath);

        IC.WriteToConsole("i will restart the game now");//===== ===== LOG ===== =====
        restart();
    }
        public MainGenerator()
        {
            string gameLocation = File.ReadAllLines(Folder + @"\config.ini").First();

            _characterdata = ReadFromFile.GetDictionaryFromFile(@"..\..\..\Extra\racepng.txt");
            _features      = ReadFromFile.GetDictionaryFromFile(@"..\..\..\Extra\features.txt");
            _cloudtiles    = ReadFromFile.GetDictionaryFromFile(@"..\..\..\Extra\clouds.txt");
            _itemdata      = ReadFromFile.GetDictionaryFromFile(@"..\..\..\Extra\items.txt");

            _floorandwall = ReadFromFile.GetFloorAndWallNamesForDungeons(@"..\..\..\Extra\tilefloor.txt");
            _monsterdata  = ReadFromFile.GetMonsterData(gameLocation + @"\mon-data.h");

            _floorpng      = ReadFromFile.GetBitmapDictionaryFromFolder(gameLocation + @"\rltiles\dngn\floor");
            _wallpng       = ReadFromFile.GetBitmapDictionaryFromFolder(gameLocation + @"\rltiles\dngn\wall");
            _alldngnpng    = ReadFromFile.GetBitmapDictionaryFromFolder(gameLocation + @"\rltiles\dngn");
            _alleffects    = ReadFromFile.GetBitmapDictionaryFromFolder(gameLocation + @"\rltiles\effect");
            _miscallaneous = ReadFromFile.GetBitmapDictionaryFromFolder(gameLocation + @"\rltiles\misc");

            _characterpng = ReadFromFile.GetCharacterPNG(gameLocation);
            _monsterpng   = ReadFromFile.GetMonsterPNG(gameLocation);
            _itempng      = ReadFromFile.ItemsPNG(gameLocation);
        }
Beispiel #7
0
        private void button2_Click(object sender, EventArgs e)
        {
            daysInfected++;
            label2.Text = "Current\ndays: " + daysInfected.ToString();
            ReadFromFile.Read();
            Queue <char> QueueEdge = new Queue <char>();

            //ReadFromFile.EdgeData is data which contains Data of Edge
            //ReadFromFile.GraphData is data which contains Data of Graph

            this.Controls.Remove(Visualisasi.viewer);
            //Init Graph G sudah di ReadFile
            ReadFromFile.province.printGraph();
            BFS.BFSCompute(daysInfected, ReadFromFile.source);
            BFS.printSol(daysInfected);
            Visualisasi.Visual();

            //associate the viewer with the GUI
            this.SuspendLayout();
            this.Controls.Add(Visualisasi.viewer);
            this.ResumeLayout();
        }
Beispiel #8
0
        private void openFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //MEMBACA FILE dari openfiledialog
            DialogResult hasil = openFileDialog1.ShowDialog();

            textBox1.Text = openFileDialog1.FileName;

            if (!File.Exists(textBox1.Text))
            {
                //Jika file tidak ditemukan
                MessageBox.Show("File not found");
            }
            else
            {
                //file ditemukan
                button6.Enabled   = true;
                richTextBox1.Text = "";
                ReadFromFile inputanFile = new ReadFromFile();

                //Proses load output file ke rich textbox
                inputanFile.read(textBox1.Text, out resultGraph, out pemetaanIndex);
                foreach (KeyValuePair <int, string> entry in pemetaanIndex)
                {
                    richTextBox1.Text = richTextBox1.Text + entry.Key.ToString() + " = " + entry.Value + "\r\n";
                }

                for (int i = 0; i < resultGraph.getSize(); i++)
                {
                    string temp = "";
                    for (int j = 0; j < resultGraph.getSize(); j++)
                    {
                        temp = temp + (resultGraph.isAdjacent(i, j) ? 1.ToString() : 0.ToString()) + " ";
                    }
                    temp = temp + "\r\n";
                    richTextBox1.Text = richTextBox1.Text + temp;
                }
            }
        }
        public static List <TransactionModel> GetAllTransactions()
        {
            List <TransactionModel> transactionsList = new List <TransactionModel>();

            string filePath = ConstructInputFilePath.GetInputFilePath();

            string[] inputLines = ReadFromFile.GetAllTextLines(filePath);

            foreach (string line in inputLines)
            {
                string[] lineValues = ParseLineValues(line);

                transactionsList.Add(new TransactionModel()
                {
                    date              = Convert.ToDateTime(lineValues[0]),
                    merchantName      = lineValues[1],
                    transactionAmount = Convert.ToDecimal(lineValues[2])
                });
            }

            allTransactions = transactionsList;
            return(transactionsList);
        }
Beispiel #10
0
    // Use this for initialization
    void Start()
    {
        // Add prefabs to container
        // This allows us to skip the ugly if/else
        menuItemPrefabContainer.Add("rectangle", rectMenuItem);
        menuItemPrefabContainer.Add("circle", circleMenuItem);

        // Create a new instance of the ReadFromFile class
        // Allows us to access the method that turns a .json file into a string
        ReadFromFile readFromFile = new ReadFromFile();

        // Parse the .json file into a string
        string menu = readFromFile.LoadJSONResourceFile("ReferenceFiles/menu.json");

        // Turn that string into a SimpleJSON JSONNode
        _jsonNode = JSONNode.Parse(menu);

        // Use a recursive method to generate all of the Menu Items at start up
        generateMenuItems(_jsonNode["Menu"]);

        // This method "creates" the menu items
        createMenuItems(_jsonNode["Menu"]);

        // Positions the menu items correctly
        positionMenuItems(_jsonNode["Menu"]);

        // Hides the menu items
        hideAllItems(_jsonNode["Menu"]);

        // Update a reference variable
        GameObject.Find("GameManager").GetComponent <RevealMenuItems>().updateMenuItemsReference();

        // Update the top level ChildController script
        // For some reason, it is the only one that doesn't update
        GameObject.Find("MenuHolder").GetComponent <ChildController>().handleChildrenSetup();
    }
Beispiel #11
0
 public static void Main(string[] args)
 {
     ReadFromFile.Read();
     CreateWebHostBuilder(args).Build().Run();
 }
Beispiel #12
0
 private void button4_Click(object sender, EventArgs e)
 {
     ReadFromFile.Invoke(sender, e);
 }
Beispiel #13
0
    static void Main(string[] args)
    {
        ReadFromFile read = new ReadFromFile();

        read.hola();
    }
Beispiel #14
0
 public static void Add <T>(string extension, ReadFromFile read)
 {
     ExtensionRegistry.Add(typeof(T), extension);
     ReadRegistry.Add(typeof(T), read);
 }
Beispiel #15
0
        protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L5ZW_SDfNC_1707 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Bool();
            returnValue.Result = false;

            //Put your code here
            #region get securityTicket and businessParticipantID by Paramter.AccountID and set defaultLanguageID
            Guid tenantID;
            Guid businessParticipantID;

            if (Parameter.AccountID == Guid.Empty)
            {
                return(returnValue);
            }

            ORM_USR_Account orm_account = new ORM_USR_Account();
            var             result      = orm_account.Load(Connection, Transaction, Parameter.AccountID);
            if (result.Status != FR_Status.Success || orm_account.USR_AccountID == Guid.Empty)
            {
                return(returnValue);
            }

            tenantID       = orm_account.Tenant_RefID;
            securityTicket = new CSV2Core.SessionSecurity.SessionSecurityTicket()
            {
                TenantID = tenantID
            };

            ORM_CMN_BPT_BusinessParticipant.Query businessParticipantQuery = new ORM_CMN_BPT_BusinessParticipant.Query();
            businessParticipantQuery.IfTenant_Tenant_RefID = tenantID;
            businessParticipantQuery.IsDeleted             = false;
            ORM_CMN_BPT_BusinessParticipant businessParticipant = ORM_CMN_BPT_BusinessParticipant.Query.Search(Connection, Transaction, businessParticipantQuery).FirstOrDefault();

            if (businessParticipant == null)
            {
                return(returnValue);
            }

            businessParticipantID = businessParticipant.CMN_BPT_BusinessParticipantID;
            #endregion

            #region get languages for tenant and set parameter dict values
            P_L2LN_GALFTID_1530 languageParam = new P_L2LN_GALFTID_1530()
            {
                Tenant_RefID = tenantID
            };
            L2LN_GALFTID_1530[] languages = cls_Get_All_Languages_ForTenantID.Invoke(Connection, Transaction, languageParam, securityTicket).Result;
            SetParameterDictValues(Parameter, languages);

            List <ISOLanguage> languagesISOs = new List <ISOLanguage>();
            languagesISOs.AddRange(languages.Select(l => new ISOLanguage()
            {
                ISO        = l.ISO_639_1,
                LanguageID = l.CMN_LanguageID
            }).ToList());
            #endregion

            #region save defaultLanguage

            // We are setting language for bp and acc
            var defaultLanguage = languages.FirstOrDefault(i => i.ISO_639_1.ToLower().Contains(Parameter.DefaultLanguageCode.ToLower()));
            if (defaultLanguage != null)
            {
                businessParticipant.DefaultLanguage_RefID = defaultLanguage.CMN_LanguageID;
                businessParticipant.Save(Connection, Transaction);

                orm_account.DefaultLanguage_RefID = defaultLanguage.CMN_LanguageID;
                orm_account.Save(Connection, Transaction);
            }

            #endregion

            #region save default country

            if (Parameter.DefaultCountry != null)
            {
                ORM_CMN_Country country = new ORM_CMN_Country();
                country.CMN_CountryID          = Guid.NewGuid();
                country.Country_ISOCode_Alpha3 = Parameter.DefaultCountry.Code;
                country.Country_Name           = new Dict()
                {
                    DictionaryID = Guid.NewGuid()
                };
                country.Creation_Timestamp     = DateTime.Now;
                country.Default_Currency_RefID = Guid.Empty;
                country.Default_Language_RefID = Guid.Empty;
                country.Tenant_RefID           = tenantID;
                country.IsDeleted = false;
                country.IsDefault = true;

                foreach (var languageItem in languages)
                {
                    country.Country_Name.UpdateEntry(languageItem.CMN_LanguageID, Parameter.DefaultCountry.Name);
                }

                country.Save(Connection, Transaction);
            }

            #endregion

            #region save default currency

            //asign currency
            if (Parameter.DefaultCurrency != null)
            {
                ORM_CMN_Currency currency = new ORM_CMN_Currency();
                currency.CMN_CurrencyID     = Guid.NewGuid();
                currency.Creation_Timestamp = DateTime.Now;
                currency.IsDeleted          = false;
                currency.ISO4127            = Parameter.DefaultCurrency.Code;
                currency.Name = new Dict()
                {
                    DictionaryID = Guid.NewGuid()
                };
                currency.Tenant_RefID = tenantID;

                foreach (var language in languages)
                {
                    currency.Name.UpdateEntry(language.CMN_LanguageID, Parameter.DefaultCurrency.Name);
                }

                currency.Save(Connection, Transaction);

                //set default currency
                ORM_CMN_BPT_BusinessParticipant businessPart = new ORM_CMN_BPT_BusinessParticipant();
                businessPart.Load(Connection, Transaction, businessParticipantID);

                businessPart.DefaultCurrency_RefID = currency.CMN_CurrencyID;
                businessPart.Save(Connection, Transaction);
            }

            #endregion

            #region save organisational units
            if (Parameter.OrganisationalUnitParameters.Length > 0)
            {
                foreach (var item in Parameter.OrganisationalUnitParameters)
                {
                    cls_Save_Office.Invoke(Connection, Transaction, item, securityTicket);
                }
            }
            #endregion

            #region save cost centers
            if (Parameter.CostCenterParameters.Length > 0)
            {
                foreach (var item in Parameter.CostCenterParameters)
                {
                    cls_Save_CostCenter.Invoke(Connection, Transaction, item, securityTicket);
                }
            }
            #endregion

            #region save warehouses
            if (Parameter.WarehousesParameters.Length > 0)
            {
                #region save warehouse group
                P_L2WH_SWHG_1327 warehouseGroupParam = new P_L2WH_SWHG_1327();
                warehouseGroupParam.Parent_RefID               = Guid.Empty;
                warehouseGroupParam.WarehouseGroup_Name        = "Waregouse group";
                warehouseGroupParam.WarehouseGroup_Description = new Dict()
                {
                    DictionaryID = Guid.NewGuid()
                };
                foreach (var language in languages)
                {
                    warehouseGroupParam.WarehouseGroup_Description.UpdateEntry(language.CMN_LanguageID, String.Empty);
                }

                var warehouseGroupID = cls_Save_Warehouse_Group.Invoke(Connection, Transaction, warehouseGroupParam, securityTicket).Result;
                #endregion

                foreach (var item in Parameter.WarehousesParameters)
                {
                    item.LOG_WRH_WarehouseGroupID = warehouseGroupID;
                    cls_Save_Warehouse.Invoke(Connection, Transaction, item, securityTicket);
                }
            }
            #endregion

            #region create dimension templates
            string           jsonTemplates      = ReadFromFile.LoadContentFromFile(@"Dimensions.json");
            List <Dimension> dimensionTemplates = JsonConvert.DeserializeObject <List <Dimension> >(jsonTemplates);

            int orderSequence = 1;
            ORM_CMN_PRO_Dimension       orm_dimension;
            ORM_CMN_PRO_Dimension_Value orm_dimensionValue;
            foreach (var template in dimensionTemplates)
            {
                orderSequence = 1;

                #region save dimension
                orm_dimension = new ORM_CMN_PRO_Dimension();
                orm_dimension.Product_RefID = Guid.Empty;
                orm_dimension.DimensionName = new Dict()
                {
                    DictionaryID = Guid.NewGuid()
                };
                orm_dimension.IsDimensionTemplate = true;
                orm_dimension.Tenant_RefID        = tenantID;

                foreach (var language in languages)
                {
                    orm_dimension.DimensionName.UpdateEntry(language.CMN_LanguageID, template.Name);
                }

                orm_dimension.Save(Connection, Transaction);
                #endregion

                #region save dimension values
                foreach (var templateValue in template.DimansionValues)
                {
                    orm_dimensionValue = new ORM_CMN_PRO_Dimension_Value();
                    orm_dimensionValue.Dimensions_RefID    = orm_dimension.CMN_PRO_DimensionID;
                    orm_dimensionValue.DimensionValue_Text = new Dict()
                    {
                        DictionaryID = Guid.NewGuid()
                    };
                    orm_dimensionValue.Tenant_RefID  = tenantID;
                    orm_dimensionValue.OrderSequence = orderSequence;

                    foreach (var language in languages)
                    {
                        orm_dimensionValue.DimensionValue_Text.UpdateEntry(language.CMN_LanguageID, templateValue);
                    }

                    orm_dimensionValue.Save(Connection, Transaction);

                    orderSequence++;
                }
                #endregion
            }
            #endregion

            #region create shipment types
            string shipmentTypesJson           = ReadFromFile.LoadContentFromFile(@"ShipmentTypes.json");
            List <ShipmentTypes> shipmentTypes = JsonConvert.DeserializeObject <List <ShipmentTypes> >(shipmentTypesJson);

            ORM_LOG_SHP_Shipment_Type orm_shipmentType;
            foreach (var type in shipmentTypes)
            {
                #region save LOG_SHP_Shipment_Type
                orm_shipmentType = new ORM_LOG_SHP_Shipment_Type();
                orm_shipmentType.ShipmentType_Name = new Dict()
                {
                    DictionaryID = Guid.NewGuid()
                };
                orm_shipmentType.ShipmentType_Description = new Dict()
                {
                    DictionaryID = Guid.NewGuid()
                };
                orm_shipmentType.Tenant_RefID = tenantID;

                foreach (var language in languages)
                {
                    orm_shipmentType.ShipmentType_Name.UpdateEntry(language.CMN_LanguageID, type.Name);
                    orm_shipmentType.ShipmentType_Description.UpdateEntry(language.CMN_LanguageID, string.Empty);
                }

                orm_shipmentType.Save(Connection, Transaction);
                #endregion
            }
            #endregion

            #region create number ranges

            string      numberRangesJson = ReadFromFile.LoadContentFromFile(@"NumberRanges.json");
            NumberRange numberRanges     = JsonConvert.DeserializeObject <NumberRange>(numberRangesJson);


            ORM_CMN_NumberRange_UsageArea numberRangeUsageArea;
            ORM_CMN_NumberRange           orm_numberRanges;
            foreach (var item in numberRanges.NumberRanges)
            {
                if (Parameter.IsCustomerRegistration && item.Name == "Customer orders")
                {
                    continue;
                }

                if (!Parameter.IsCustomerRegistration && item.Name == "Distribution orders")
                {
                    continue;
                }

                if (!Parameter.IsCustomerRegistration && item.Name == "Procurement orders")
                {
                    continue;
                }

                numberRangeUsageArea = new ORM_CMN_NumberRange_UsageArea();
                numberRangeUsageArea.UsageArea_Name = new Dict()
                {
                    DictionaryID = Guid.NewGuid()
                };
                numberRangeUsageArea.UsageArea_Description = new Dict()
                {
                    DictionaryID = Guid.NewGuid()
                };
                foreach (var language in languages)
                {
                    numberRangeUsageArea.UsageArea_Name.UpdateEntry(language.CMN_LanguageID, item.Name);
                    numberRangeUsageArea.UsageArea_Description.UpdateEntry(language.CMN_LanguageID, string.Empty);
                }
                numberRangeUsageArea.Tenant_RefID           = tenantID;
                numberRangeUsageArea.GlobalStaticMatchingID = item.GlobalStaticMatchingID;
                numberRangeUsageArea.Save(Connection, Transaction);

                orm_numberRanges = new ORM_CMN_NumberRange();
                orm_numberRanges.NumberRange_Name            = item.Name;
                orm_numberRanges.Tenant_RefID                = tenantID;
                orm_numberRanges.NumberRange_UsageArea_RefID = numberRangeUsageArea.CMN_NumberRange_UsageAreaID;
                orm_numberRanges.FixedPrefix = item.FixedPrefix;
                orm_numberRanges.Formatting_LeadingFillCharacter = item.FillCharacter;
                orm_numberRanges.Formatting_NumberLength         = item.Length;
                orm_numberRanges.Value_Current = item.CurrentValue;
                orm_numberRanges.Value_Start   = item.StartValue;
                orm_numberRanges.Value_End     = item.EndValue;
                orm_numberRanges.Save(Connection, Transaction);
            }


            #endregion

            #region create inventory change reasons

            string inventoryChangeReasonsJson = ReadFromFile.LoadContentFromFile(@"InventoryChangeReasons.json");
            List <InventoryChangeReasons> inventoryChangeReasons = JsonConvert.DeserializeObject <List <InventoryChangeReasons> >(inventoryChangeReasonsJson);

            ORM_LOG_WRH_InventoryChangeReason orm_inventoryChangeReason;
            foreach (var reason in inventoryChangeReasons)
            {
                #region save inventory change reason

                orm_inventoryChangeReason = new ORM_LOG_WRH_InventoryChangeReason();
                orm_inventoryChangeReason.GlobalPropertyMatchingID = InventoryChangeReasons.InventoryChangeReasonGlobalPropertyMatchingID + "-" + reason.Name;
                orm_inventoryChangeReason.InventoryChange_Name     = new Dict()
                {
                    DictionaryID = Guid.NewGuid()
                };
                orm_inventoryChangeReason.InventoryChange_Description = new Dict()
                {
                    DictionaryID = Guid.NewGuid()
                };
                orm_inventoryChangeReason.Tenant_RefID = tenantID;

                foreach (var language in languages)
                {
                    orm_inventoryChangeReason.InventoryChange_Name.UpdateEntry(language.CMN_LanguageID, reason.Name);
                    orm_inventoryChangeReason.InventoryChange_Description.UpdateEntry(language.CMN_LanguageID, string.Empty);
                }

                orm_inventoryChangeReason.Save(Connection, Transaction);

                #endregion
            }

            #endregion

            #region create shipment statuses
            var shipmentStatuses = Enum.GetValues(typeof(EShipmentStatus));

            var shipmentStatusDicts = EnumUtils.GetDictObjectsForStaticListData <EShipmentStatus>(
                ResourceFilePath.ShipmentStatus, ORM_LOG_SHP_Shipment_Status.TableName, languagesISOs);

            var statusCodeCount = 1;
            ORM_LOG_SHP_Shipment_Status shipmentStatus;
            foreach (EShipmentStatus status in shipmentStatuses)
            {
                shipmentStatus = new ORM_LOG_SHP_Shipment_Status();
                shipmentStatus.GlobalPropertyMatchingID = EnumUtils.GetEnumDescription((EShipmentStatus)status);
                shipmentStatus.Status_Code  = statusCodeCount++;
                shipmentStatus.Status_Name  = shipmentStatusDicts[EnumUtils.GetEnumDescription((EShipmentStatus)status)];
                shipmentStatus.Tenant_RefID = tenantID;

                shipmentStatus.Save(Connection, Transaction);
            }
            #endregion

            if (Parameter.IsCustomerRegistration)
            {
                #region create procurement order statuses
                var procurementStatuses = Enum.GetValues(typeof(EProcurementStatus));
                ORM_ORD_PRC_ProcurementOrder_Status procurementOrderStatus;
                foreach (EProcurementStatus status in procurementStatuses)
                {
                    procurementOrderStatus = new ORM_ORD_PRC_ProcurementOrder_Status();
                    procurementOrderStatus.GlobalPropertyMatchingID = EnumUtils.GetEnumDescription(status);
                    procurementOrderStatus.Tenant_RefID             = tenantID;

                    procurementOrderStatus.Save(Connection, Transaction);
                }
                #endregion
            }
            else
            {
                #region create customer order statuses
                var customerOrderStatuses = Enum.GetValues(typeof(ECustomerOrderStatus));

                var customerOrderStatusesDicts = EnumUtils.GetDictObjectsForStaticListData <ECustomerOrderStatus>(
                    ResourceFilePath.CustomerOrderStatus, ORM_ORD_CUO_CustomerOrder_Status.TableName, languagesISOs);

                var count = 1;
                ORM_ORD_CUO_CustomerOrder_Status customerOrderStatus;
                foreach (var status in customerOrderStatuses)
                {
                    customerOrderStatus = new ORM_ORD_CUO_CustomerOrder_Status();
                    customerOrderStatus.GlobalPropertyMatchingID = EnumUtils.GetEnumDescription((ECustomerOrderStatus)status);
                    customerOrderStatus.Status_Code  = count++;
                    customerOrderStatus.Status_Name  = customerOrderStatusesDicts[EnumUtils.GetEnumDescription((ECustomerOrderStatus)status)];
                    customerOrderStatus.Tenant_RefID = tenantID;

                    customerOrderStatus.Save(Connection, Transaction);
                }
                #endregion
            }

            returnValue.Result = true;
            return(returnValue);

            #endregion UserCode
        }
 public void LoadingMatrixGraphTest()
 {
     repr = new MatrixRepresentation(21);
     ReadFromFile.LoadGraph(repr, path);
     Assert.IsNotNull(repr);
 }
Beispiel #17
0
        public void TestReadTransaction()
        {
            var read = new ReadFromFile(@"C:\Users\Paulius\Documents\GitHub\VaikuDarzelis\DarzelioVaikai.csv");

            Assert.ThrowsException <FormatException>(() => read.ReadTransaction(false));
        }