Ejemplo n.º 1
0
        public void GivenIteratorWhenReadThenElementsAreRead()
        {
            var grd1 = new GRD
            {
                A = 123,
                B = 234,
                C = 345,
                D = 456,
                E = 567,
                F = 678,
                G = "789",
                H = 890,
                I = 3,
                J = 4
            };

            var grds = new List<GRD> { grd1 };
            var grdElements = CreateNavigator(grds);

            _iterator = grdElements.Select("./TSK/GRD");

            var result = _grdReader.Read(_iterator).First();

            Assert.AreEqual(grd1.A, result.A);
            Assert.AreEqual(grd1.B, result.B);
            Assert.AreEqual(grd1.C, result.C);
            Assert.AreEqual(grd1.D, result.D);
            Assert.AreEqual(grd1.E, result.E);
            Assert.AreEqual(grd1.F, result.F);
            Assert.AreEqual(grd1.G, result.G);
            Assert.AreEqual(grd1.H, result.H);
            Assert.AreEqual(grd1.I, result.I);
            Assert.AreEqual(grd1.J, result.J);
        }
Ejemplo n.º 2
0
        public IEnumerable <GRD> Read(XPathNodeIterator nodeIterator)
        {
            var grds = new List <GRD>();

            if (nodeIterator.Count == 0)
            {
                return(grds);
            }

            foreach (XPathNavigator node in nodeIterator)
            {
                var grd = new GRD
                {
                    A = GetGrdAttribute <double>(node, "A"),
                    B = GetGrdAttribute <double>(node, "B"),
                    C = GetGrdAttribute <double>(node, "C"),
                    D = GetGrdAttribute <double>(node, "D"),
                    E = GetGrdAttribute <ulong>(node, "E"),
                    F = GetGrdAttribute <ulong>(node, "F"),
                    G = GetGrdAttribute <string>(node, "G"),
                    H = GetGrdAttribute <ulong?>(node, "H"),
                    I = GetGrdAttribute <byte>(node, "I"),
                    J = GetGrdAttribute <byte?>(node, "J"),
                };

                grds.Add(grd);
            }

            return(grds);
        }
Ejemplo n.º 3
0
        public void GivenIteratorWithEmptyCollectionWhenReadThenEmpty()
        {
            var grd1 = new GRD
            {
                A = 123,
                B = 234,
                C = 345,
                D = 456,
                E = 567,
                F = 678,
                G = "789",
                H = 890,
                I = 3,
                J = 4
            };

            var grds = new List <GRD> {
                grd1
            };
            var grdElements = CreateNavigator(grds);

            _iterator = grdElements.Select("./TSK/NOTGRD");

            var result = _grdReader.Read(_iterator);

            Assert.IsEmpty(result);
        }
Ejemplo n.º 4
0
 public void Init_GRD()
 {
     try
     {
         GRD.DataSource = oEstudiante.GetAll("Estudiante_get").Tables[0];
         GRD.DataBind();
     }
     catch (Exception ex) {
         Console.WriteLine(ex.Message);
     }
 }
Ejemplo n.º 5
0
        public void GivenIteratorWithNoJWhenReadThenJIsNull()
        {
            var grd1 = new GRD();
            var grds = new List <GRD> {
                grd1
            };
            var grdElements = CreateNavigator(grds);

            _iterator = grdElements.Select("./TSK/GRD");

            var result = _grdReader.Read(_iterator).First();

            Assert.IsNull(result.J);
        }
Ejemplo n.º 6
0
        public void GivenIteratorWhenReadThenGrdAreRead()
        {
            var grd1 = new GRD();
            var grd2 = new GRD();

            var grds = new List<GRD> {grd1, grd2};
            var grdElements = CreateNavigator(grds);

            _iterator = grdElements.Select("./TSK/GRD");

            var result = _grdReader.Read(_iterator);

            Assert.AreEqual(grds.Count, result.Count());
        }
Ejemplo n.º 7
0
        private void Selection_Load(object sender, EventArgs e)
        {
            GRD.Row = 0;

            GRD.set_ColWidth(0, 1500);
            GRD.Col  = 0;
            GRD.Text = "Start Date";

            GRD.set_ColWidth(1, 1500);
            GRD.Col  = 1;
            GRD.Text = "Start Time";

            GRD.set_ColWidth(2, 1500);
            GRD.Col  = 2;
            GRD.Text = "End Time";
        }
Ejemplo n.º 8
0
        public void GivenIteratorWhenReadThenGrdAreRead()
        {
            var grd1 = new GRD();
            var grd2 = new GRD();

            var grds = new List <GRD> {
                grd1, grd2
            };
            var grdElements = CreateNavigator(grds);

            _iterator = grdElements.Select("./TSK/GRD");

            var result = _grdReader.Read(_iterator);

            Assert.AreEqual(grds.Count, result.Count());
        }
Ejemplo n.º 9
0
        private void GRDSave_Click(object sender, RoutedEventArgs e)
        {
            string filename = FileDialog_Save("gradation files (*.grd)|*.grd");

            if (filename == null)
            {
                return;
            }

            List <Pallet> pallets = new List <Pallet>();

            colorList.ForEach(item =>
            {
                pallets.Add(item.Pallet);
            });

            GRD.Export(filename, pallets);
        }
Ejemplo n.º 10
0
        public void Setup()
        {
            _dataPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
            Directory.CreateDirectory(_dataPath);

            _grd = new GRD
            {
                A = 123,
                B = 234,
                C = 345,
                D = 456,
                E = 567,
                F = 678,
                G = "Hold The Door",
                H = 789,
                I = 8,
                J = 1,
            };
        }
Ejemplo n.º 11
0
        public void GivenTskWithGrdWhenMapThenPrescriptionIdFromCatalogIsPassedToOperationMapper()
        {
            var prescription = new RasterGridPrescription();

            prescription.Id.UniqueIds = new List <UniqueId>
            {
                new UniqueId
                {
                    IdType = IdTypeEnum.String,
                    Id     = "FIX1",
                    Source = "http://dictionary.isobus.net/isobus/"
                }
            };

            _catalog.Prescriptions = new List <Prescription> {
                prescription
            };


            var existingLoggedData = new LoggedData();

            existingLoggedData.Id.UniqueIds.Add(new UniqueId {
                IdType = IdTypeEnum.String, Id = "FIX1", Source = UniqueIdMapper.IsoSource
            });
            _documents.LoggedData = new List <LoggedData> {
                existingLoggedData
            };

            var grd = new GRD();

            _tsk.Items = new List <IWriter> {
                grd
            }.ToArray();
            _tsk.A = "FIX1";

            MapSingle();

            _operationDataMapper.Verify(x => x.Map(It.IsAny <List <TLG> >(), prescription.Id.ReferenceId, _dataPath, existingLoggedData.Id.ReferenceId, _linkIds), Times.Once);
        }
Ejemplo n.º 12
0
        private void GRDLoad_Click(object sender, RoutedEventArgs e)
        {
            string filename = FileDialog_Open("gradation files (*.grd)|*.grd");

            if (filename == null)
            {
                return;
            }

            List <Pallet> pallets = GRD.Load(filename);

            colorList.Clear();
            colorIndex.Children.Clear();

            pallets.ForEach(item => colorList.Add(new ColorIndex(item, colorDelete)));

            colorList.Sort((a, b) => a.Pallet.Pos - b.Pallet.Pos);

            colorIndex.Children.Clear();
            colorList.ForEach(item => colorIndex.Children.Add(item.Panel));

            UpdateGradation();
        }
Ejemplo n.º 13
0
        public void GivenIteratorWhenReadThenElementsAreRead()
        {
            var grd1 = new GRD
            {
                A = 123,
                B = 234,
                C = 345,
                D = 456,
                E = 567,
                F = 678,
                G = "789",
                H = 890,
                I = 3,
                J = 4
            };

            var grds = new List <GRD> {
                grd1
            };
            var grdElements = CreateNavigator(grds);

            _iterator = grdElements.Select("./TSK/GRD");

            var result = _grdReader.Read(_iterator).First();

            Assert.AreEqual(grd1.A, result.A);
            Assert.AreEqual(grd1.B, result.B);
            Assert.AreEqual(grd1.C, result.C);
            Assert.AreEqual(grd1.D, result.D);
            Assert.AreEqual(grd1.E, result.E);
            Assert.AreEqual(grd1.F, result.F);
            Assert.AreEqual(grd1.G, result.G);
            Assert.AreEqual(grd1.H, result.H);
            Assert.AreEqual(grd1.I, result.I);
            Assert.AreEqual(grd1.J, result.J);
        }
Ejemplo n.º 14
0
        public void GivenTskWithGrdWhenMapThenPrescriptionIdFromCatalogIsPassedToOperationMapper()
        {
            var prescription = new RasterGridPrescription();
            prescription.Id.UniqueIds = new List<UniqueId>
            {
                new UniqueId
                {
                    CiTypeEnum = CompoundIdentifierTypeEnum.String,
                    Id = "FIX1",
                    Source = "http://dictionary.isobus.net/isobus/"
                }
            };

            _catalog.Prescriptions = new List<Prescription> { prescription };

            var existingLoggedData = new LoggedData();
            existingLoggedData.Id.UniqueIds.Add(new UniqueId { CiTypeEnum = CompoundIdentifierTypeEnum.String, Id = "FIX1", Source = UniqueIdMapper.IsoSource });
            _documents.LoggedData = new List<LoggedData> { existingLoggedData };

            var grd = new GRD();
            _tsk.Items = new List<IWriter> {grd}.ToArray();
            _tsk.A = "FIX1";

            MapSingle();

            _operationDataMapper.Verify(x => x.Map(It.IsAny<List<TLG>>(), prescription.Id.ReferenceId, _dataPath,existingLoggedData.Id.ReferenceId, _linkIds ), Times.Once);
        }
Ejemplo n.º 15
0
        private void Main_Load(object sender, EventArgs e)
        {
            GRD.Row = 0;

            GRD.set_ColWidth(0, 3000);
            GRD.Col  = 0;
            GRD.Text = "PRO Name";

            GRD.set_ColWidth(1, 4500);
            GRD.Col  = 1;
            GRD.Text = "Category";

            GRD.set_ColWidth(2, 1000);
            GRD.Col  = 2;
            GRD.Text = "Zip";

            GRD.set_ColWidth(3, 2000);
            GRD.Col  = 3;
            GRD.Text = "Contact";

            GRD.set_ColWidth(4, 1000);
            GRD.Col  = 4;
            GRD.Text = "Rating";

            GRD.set_ColWidth(5, 1000);
            GRD.Col  = 5;
            GRD.Text = "Jobs";

            GRD.set_ColWidth(6, 1000);
            GRD.Col  = 6;
            GRD.Text = "Pay";

            GRD.set_ColWidth(7, 3000);
            GRD.Col  = 7;
            GRD.Text = "Availability";

            GRD.set_ColWidth(8, 0);
            GRD.Col  = 8;
            GRD.Text = "Skills";

            GRD.set_ColWidth(9, 0);
            GRD.Col  = 9;
            GRD.Text = "Lat";

            GRD.set_ColWidth(10, 0);
            GRD.Col  = 10;
            GRD.Text = "Long";

            lstCategory.Items.Clear();

            try
            {
                using (SQLiteConnection conn = new SQLiteConnection(connectionString))
                {
                    conn.Open();
                    string sql = "SELECT DISTINCT S_CATEGORY FROM CATEGORY_SERVICE_MAPPING";

                    using (SQLiteCommand cmd = new SQLiteCommand(sql, conn))
                    {
                        using (SQLiteDataReader reader = cmd.ExecuteReader())
                        {
                            while (reader.Read())
                            {
                                lstCategory.Items.Add(reader["S_CATEGORY"].ToString());
                            }
                        }
                    }
                    conn.Close();
                }
            }
            catch (SQLiteException ex)
            {
                Console.Write(ex.StackTrace);
            }


            try
            {
                using (SQLiteConnection conn = new SQLiteConnection(connectionString))
                {
                    conn.Open();
                    string sql = "SELECT * FROM PRO_CUSTOMER_LIST";

                    using (SQLiteCommand cmd = new SQLiteCommand(sql, conn))
                    {
                        using (SQLiteDataReader reader = cmd.ExecuteReader())
                        {
                            while (reader.Read())
                            {
                                PRO_CUSTOMER cust = new PRO_CUSTOMER();
                                cust.Pro_Customer_Name = reader["Pro_Name"].ToString();
                                cust.Pro_Category_Name = reader["Pro_Category"].ToString();
                                cust.Pro_Zip_Code      = int.Parse(reader["Pro_Zip"].ToString());
                                cust.Pro_Phone_Number  = reader["Pro_Phone"].ToString();
                                cust.Pro_Rating_from_5 = double.Parse(reader["Pro_Rating"].ToString());
                                cust.Pro_No_Of_Orders  = int.Parse(reader["Pro_NoOfOrders"].ToString());
                                cust.Pro_Rate_in_USD   = double.Parse(reader["Pro_Rate"].ToString());
                                cust.Pro_Skills_List   = reader["Pro_Skills"].ToString();
                                cust.Lat      = reader["Latitude"].ToString();
                                cust.Lng      = reader["Longitude"].ToString();
                                cust.Username = reader["username"].ToString();
                                cust.Passwd   = reader["password"].ToString();
                                pros_list.Add(cust);
                            }
                        }
                    }
                    conn.Close();
                }
            }
            catch (SQLiteException ex)
            {
                Console.Write(ex.StackTrace);
            }
        }
 public override void Focus()
 {
     GRD.Focus();
 }
Ejemplo n.º 17
0
        public void GivenIteratorWithEmptyCollectionWhenReadThenEmpty()
        {
            var grd1 = new GRD
            {
                A = 123,
                B = 234,
                C = 345,
                D = 456,
                E = 567,
                F = 678,
                G = "789",
                H = 890,
                I = 3,
                J = 4
            };

            var grds = new List<GRD> { grd1 };
            var grdElements = CreateNavigator(grds);
            _iterator = grdElements.Select("./TSK/NOTGRD");

            var result = _grdReader.Read(_iterator);

            Assert.IsEmpty(result);
        }
Ejemplo n.º 18
0
        public void GivenIteratorWithNoJWhenReadThenJIsNull()
        {
            var grd1 = new GRD();
            var grds = new List<GRD> { grd1 };
            var grdElements = CreateNavigator(grds);

            _iterator = grdElements.Select("./TSK/GRD");

            var result = _grdReader.Read(_iterator).First();

            Assert.IsNull(result.J);
        }