Example #1
0
 /// <summary>
 /// 중복 아이피 접근 체크
 /// </summary>
 /// <param name="ConnectHost"></param>
 /// <param name="Cache"></param>
 /// <returns></returns>
 public string DuplicateIP(string ConnectHost, System.Web.Caching.Cache Cache)
 {
     DateTime CurrentTime = Convert.ToDateTime(DateTime.Now.ToString("HH:mm"));
     //접속 가능 시간 체크
     if (CurrentTime >= Convert.ToDateTime("03:00") && CurrentTime <= Convert.ToDateTime("07:00"))
     {
         if (Cache == null || Cache["ConnectIP"] == null)
         {
             //Cache가 없을 경우, 접속IP로 Cache 생성
             Cache.Insert("ConnectIP", ConnectHost, null, DateTime.Now.AddMinutes(5), TimeSpan.Zero);
             return "접속 가능 (첫 접속)";
         }
         else
         {
             if (Cache["ConnectIP"].ToString() == ConnectHost)
             {
                 //5분이내 같은 IP주소로 접속한 경우
                 return "5분이내에 같은 IP로 접속했습니다! 5분 후에 다시 시도해 주세요.";
             }
             else
             {
                 //다른 IP로 접속했을 경우 Cache에 업데이트
                 Cache.Remove("ConnectIP");
                 Cache.Insert("ConnectIP", ConnectHost, null, DateTime.Now.AddMinutes(5), TimeSpan.Zero);
                 return "접속 가능 (Cache 업데이트)";
             }
         }
     }
     else
     {
         return "접속 가능 시간이 아닙니다.(03:00~07:00)";
     }
 }
Example #2
0
        /// <summary>
        /// Perform mapping for each character of input.
        /// </summary>
        /// <param name="result">Result is modified in place.</param>
        public override void Prepare(System.Text.StringBuilder result)
        {
            // From RFC3454, section 3: Mapped characters are not
            // re-scanned during the mapping step.  That is, if
            // character A at position X is mapped to character B,
            // character B which is now at position X is not checked
            // against the mapping table.
            int pos;
            string map;
            int len;
            for (int i=0; i<result.Length; i++)
            {
                pos = Array.BinarySearch(m_table, result[i], m_comp);
                if (pos < 0)
                    continue;

                map = m_table[pos];
                len = map.Length;
                if (len == 1)
                {
                    result.Remove(i, 1);
                    i--;
                }
                else
                {
                    result[i] = map[1];
                    if (len > 2)
                    {
                        result.Insert(i+1, map.ToCharArray(2, len - 2));
                        i += len - 2;
                    }
                }
            }
        }
 public override void ModifyWizardPages(object source, GXPropertyPageType type, System.Collections.Generic.List<Control> pages)
 {
     if (type == GXPropertyPageType.Device)
     {
         pages.Insert(1, new GXDLT645DeviceWizardDlg());
     }
     else if (type == GXPropertyPageType.Property ||
         type == GXPropertyPageType.Table)
     {
         //Remove default pages.
         pages.Clear();
         pages.Add(new AddressDlg());
     }
     else if (type == GXPropertyPageType.Import)
     {
         pages.Insert(1, new DeviceImportForm());
     }
 }
Example #4
0
        public static object GetInsertCacheItem(System.Web.Caching.Cache cache, string key, Delegate action, object[] args, bool flushCache = false)
        {
            var cacheItem = cache[key];
              if (cacheItem != null && !flushCache) return cacheItem;

              cacheItem = action.DynamicInvoke(args);
              cache.Insert(key, cacheItem);

              return cacheItem;
        }
        private static void InsertToolStripTypeItem(System.Collections.IList items, ToolStripItem newItem)
        {
            ToolStripItem item2 = newItem;
            ToolStripMenuItem menuItem2 = item2 as ToolStripMenuItem;
            for (int i = 0; i < items.Count; i++)
            {
                ToolStripItem item1 = items[i] as ToolStripItem;
                ToolStripMenuItem menuItem1 = item1 as ToolStripMenuItem;
                if (item1 == null)
                    continue;

                bool item1IsType = item1.Tag is Type;
                bool item2IsType = item2.Tag is Type;
                System.Reflection.Assembly assembly1 = item1.Tag is Type ? (item1.Tag as Type).Assembly : item1.Tag as System.Reflection.Assembly;
                System.Reflection.Assembly assembly2 = item2.Tag is Type ? (item2.Tag as Type).Assembly : item2.Tag as System.Reflection.Assembly;
                int result =
                    (assembly2 == typeof(DualityApp).Assembly ? 1 : 0) -
                    (assembly1 == typeof(DualityApp).Assembly ? 1 : 0);
                if (result > 0)
                {
                    items.Insert(i, newItem);
                    return;
                }
                else if (result != 0) continue;

                result =
                    (item2IsType ? 1 : 0) -
                    (item1IsType ? 1 : 0);
                if (result > 0)
                {
                    items.Insert(i, newItem);
                    return;
                }
                else if (result != 0) continue;

                result = string.Compare(item1.Text, item2.Text);
                if (result > 0)
                {
                    items.Insert(i, newItem);
                    return;
                }
                else if (result != 0) continue;
            }

            items.Add(newItem);
        }
        private static void PublishResults(decimal initialTime, decimal baseTime, int warmupSamples, decimal warmupMean, decimal warmupStandardDeviation, int testSamples, decimal testMean, decimal testStandardDeviation)
        {
            Trace.WriteLine(string.Format("initialTime: {0}:", FormatTime(1, initialTime)));
            Trace.WriteLine(string.Format("baseTime: {0}:", FormatTime(1, baseTime)));
            Trace.WriteLine(string.Format("warmupSamples: {0}", warmupSamples));
            Trace.WriteLine(string.Format("warmupMean: {0}:", FormatTime(warmupSamples, warmupMean, warmupStandardDeviation)));
            Trace.WriteLine(string.Format("testSamples: {0}", testSamples));
            Trace.WriteLine(string.Format("testMean: {0}:", FormatTime(testSamples, testMean, testStandardDeviation)));

            var testName = TestContext.CurrentContext.Test.FullName;
            var resultsFolder = Path.Combine(
                TestContext.CurrentContext.TestDirectory,
                "performance");
            var outputPath = Path.Combine(
                resultsFolder,
                testName + ".csv");

            var columns = "date,testSamples,testMean,testStandardDeviation,warmupSamples,warmupMean,warmupStandardDeviation,initialTime,baseTime,machine";

            if (File.Exists(outputPath))
            {
                var lines = File.ReadAllLines(outputPath);
                Assume.That(lines.Length, Is.GreaterThanOrEqualTo(1));
                Assume.That(lines[0], Is.EqualTo(columns));
            }
            else
            {
                if (!Directory.Exists(resultsFolder))
                {
                    Directory.CreateDirectory(resultsFolder);
                }

                File.WriteAllLines(outputPath, new[]
                {
                    columns
                });
            }

            var data = new[] { testSamples, testMean, testStandardDeviation, warmupSamples, warmupMean, warmupStandardDeviation, initialTime, baseTime }.Select(d => d.ToString(CultureInfo.InvariantCulture)).ToList();
            data.Insert(0, DateTime.UtcNow.ToString("O"));
            data.Insert(9, Environment.MachineName);
            File.AppendAllLines(outputPath, new[]
            {
                string.Join(",", data),
            });
        }
		private void Can_insert_and_select_from_ModelWithFieldsOfDifferentAndNullableTypes_table_impl(System.Data.IDbConnection db)
		{
			{
				db.CreateTable<ModelWithFieldsOfDifferentAndNullableTypes>(true);

				var row = ModelWithFieldsOfDifferentAndNullableTypes.Create(1);
				
				Console.WriteLine(OrmLiteConfig.DialectProvider.ToInsertRowStatement(null, row));
				db.Insert(row);

				var rows = db.Select<ModelWithFieldsOfDifferentAndNullableTypes>();

				Assert.That(rows, Has.Count.EqualTo(1));

				ModelWithFieldsOfDifferentAndNullableTypes.AssertIsEqual(rows[0], row);
			}
		}
Example #8
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;
            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            //Insert
            sqlInsert = "INSERT INTO " + table
            + "(suncrylicRoofID,partName,description,partNumber,color,maxLength,lengthUnits,usdPrice,cadPrice,status)"
            + "VALUES"
            + "(" + (count + 1) + ",'" + SuncrylicName + "','" + SuncrylicDescription + "','" + PartNumber + "','" + SuncrylicColor + "'," + SuncrylicMaxLength + ",'" + SuncrylicLengthUnits + "',"
            + UsdPrice + "," + CadPrice + "," + 1 + ")";

            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
Example #9
0
        /// <summary>
        /// Parse a rfc 2822 date and time specification. rfc 2822 section 3.3
        /// </summary>
        /// <param name="date">rfc 2822 date-time</param>
        /// <returns>A <see cref="System.DateTime" /> from the parsed header body</returns>
        public static System.DateTime parseDate( System.String date )
        {
            if ( date==null || date.Equals(System.String.Empty) )
                return System.DateTime.MinValue;
            System.DateTime msgDateTime;
            date = anmar.SharpMimeTools.SharpMimeTools.uncommentString (date);
            msgDateTime = new System.DateTime (0);
            try {
                // TODO: Complete the list
                date = date.Replace("UT", "+0000");
                date = date.Replace("GMT", "+0000");
                date = date.Replace("EDT", "-0400");
                date = date.Replace("EST", "-0500");
                date = date.Replace("CDT", "-0500");
                date = date.Replace("MDT", "-0600");
                date = date.Replace("MST", "-0600");
                date = date.Replace("EST", "-0700");
                date = date.Replace("PDT", "-0700");
                date = date.Replace("PST", "-0800");

                date = date.Replace("AM", System.String.Empty);
                date = date.Replace("PM", System.String.Empty);
                int rpos = date.LastIndexOfAny(new Char[]{' ', '\t'});
                if (rpos>0 && rpos != date.Length - 6)
                    date = date.Substring(0, rpos + 1) + "-0000";
                date = date.Insert(date.Length-2, ":");
                msgDateTime = DateTime.ParseExact(date,
                    _date_formats,
                    System.Globalization.CultureInfo.CreateSpecificCulture("en-us"),
                    System.Globalization.DateTimeStyles.AllowInnerWhite);
            #if LOG
            } catch ( System.Exception e ) {
                if ( log.IsErrorEnabled )
                    log.Error(System.String.Concat("Error parsing date: [", date, "]"), e);
            #else
            } catch ( System.Exception ) {
            #endif
                msgDateTime = new System.DateTime (0);
            }
            return msgDateTime;
        }
Example #10
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;
            string inchesInsert;
            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            if (Sunrail300MaxLengthInches == null)
            {

                inchesInsert = "null,null,";
            }
            else
            {
                inchesInsert = Sunrail300MaxLengthInches + ",'" + Sunrail300MaxLengthInchesUnits + "',";
            }

            //Insert
            sqlInsert = "INSERT INTO " + table
            + "(sr300ID,partName,description,partNumber,color,maxLengthFeet,lengthFeetUnits,maxLengthInches,lengthInchesUnits,usdPrice,cadPrice,status)"
            + "VALUES"
            + "(" + (count + 1) + ",'" + Sunrail300Name + "','" + Sunrail300Description + "','" + PartNumber + "','" + Sunrail300Color + "'," + Sunrail300MaxLengthFeet + ",'"
            + Sunrail300MaxLengthFeetUnits + "'," + inchesInsert
            + Sunrail300UsdPrice + "," + Sunrail300CadPrice + "," + 1 + ")";

            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
	/// <summary> Based on pattern of odd-even ('L' and 'G') patterns used to encoded the explicitly-encoded
	/// digits in a barcode, determines the implicitly encoded first digit and adds it to the
	/// result string.
	/// 
	/// </summary>
	/// <param name="resultString">string to insert decoded first digit into
	/// </param>
	/// <param name="lgPatternFound">int whose bits indicates the pattern of odd/even L/G patterns used to
	/// encode digits
	/// </param>
	/// <throws>  ReaderException if first digit cannot be determined </throws>
	private static void  determineFirstDigit(System.Text.StringBuilder resultString, int lgPatternFound)
	{
		for (int d = 0; d < 10; d++)
		{
			if (lgPatternFound == FIRST_DIGIT_ENCODINGS[d])
			{
                   resultString.Insert(0, ((char)('0' + d)).ToString());
				//resultString.Insert(0, (char) ('0' + d));
				return ;
			}
		}
		throw ReaderException.Instance;
	}
Example #12
0
        public void Insert(System.Web.UI.WebControls.SqlDataSource dataSource, string table)
        {
            string sqlCount;
            string sqlInsert;
            System.Data.DataView selectTable = new System.Data.DataView();
            int count;

            sqlCount = "SELECT * FROM " + table;

            dataSource.SelectCommand = sqlCount;
            selectTable = (System.Data.DataView)dataSource.Select(System.Web.UI.DataSourceSelectArguments.Empty);

            //find out how many records are in the table in order to set the primary key
            count = selectTable.Count;

            //Insert
            sqlInsert = "INSERT INTO " + table
            + "(rollID,partName,partNumber,color,width,widthUnits,weight,weightUnits,usdPrice,cadPrice,status)"
            + "VALUES"
            + "(" + (count + 1) + ",'" + VinylRollName + "','" + PartNumber + "','" + VinylRollColor + "'," + VinylRollWidth + ",'" + VinylRollWidthUnits + "',"
            + VinylRollWeight + ",'" + VinylRollWeightUnits + "',"
            + UsdPrice + "," + CadPrice + "," + 1 + ")";

            dataSource.InsertCommand = sqlInsert;
            dataSource.Insert();
        }
        public void RegisterRoutes(System.Web.Routing.RouteCollection routes)
        {
            ViewEngines.Engines.Insert(0, new AUConsignorViewEngine());


            //this is needed to get sename converted to category id - not using as it's too difficult to munge in sale id
            ////routes.MapGenericPathRoute("SaleUrl",
            ////    "{generic_se_name}",
            ////    new { controller = "Common", action = "GenericUrl" },
            ////    new[] { "Nop.Web.Controllers" });


            ////////this will map seo name to your controller/action --- this gets to your action without saleId
            //////routes.MapLocalizedRoute("SaleCategory",
            //////     "{SeName}",

            //////     new { controller = "AUConsignor", action = "Category" },
            //////     new[] { "Nop.Web.Controllers" });

            //////GOT RID OF THIS
            //////routes.MapLocalizedRoute("AUProductDetails",
            //////     "{productid}",       //these names must match the names passed in @Url.RouteUrl
            //////     new { controller = "AUConsignor", action = "ProductDetails" },
            //////      //new { seoName = @"."},
            //////      new[] { "Nop.Web.Controllers" });
            //new { productId = @"\d+", shoppingCartTypeId = @"\d+", quantity = @"\d+" },

            // "Product/ProductDetails/{productid}/{SeName}",

           



            //routes.MapLocalizedRoute("ChangeCurrency",
            //                "changecurrency/{customercurrency}",
            //                new { controller = "Common", action = "SetCurrency" },
            //                new { customercurrency = @"\d+" },
            //                new[] { "Nop.Web.Controllers" });


           // var route = routes.MapRoute("SaleCategory", "AUConsignor/Category/{seoId}/{saleId}",
           //     new { controller = "AUConsignor", action = "Category" }, //What controller and action to use -->notice 'area="Admin"' is added                new { id = @"\d+" },
           //     new { seoId = @".", saleId = @"\d+" },
           //     new[] { "Nop.Web.Controllers" }
           //);
           // routes.Remove(route);
           // routes.Insert(0, route);






            //public static Route MapRoute(this RouteCollection routes, string name, string url, object defaults, object constraints, string[] namespaces);
            //                                //Route Name                                 URL that will be controlled
            //???


            //NULL for now
           // var route = routes.MapRoute("Plugin.Misc.AUConsignor.ManageConsignors", "Admin/AUConsignor/ManageConsignors",
           //     new { controller = "AUConsignor", action = "ManageConsignors" }, //What controller and action to use -->notice 'area="Admin"' is added
           //     new[] { "Nop.Plugin.Misc.AUConsignor.Controllers" }
           //);
           // routes.Remove(route);
           // routes.Insert(0, route);

           // route = null;

            // Uncommented to avoid "routing-the-current-request-for-action-is-ambiguous"
             var route = routes.MapRoute("Plugin.Misc.AUConsignor.EditCustomer", "AUConsignorAdmin/Edit/{id}",
                new { controller = "AUConsignorAdmin", action = "Edit", area = "Admin" }, //What controller and action to use -->notice 'area="Admin"' is added
                new { id = @"\d+" },
                new[] { "Nop.Admin.Controllers" }
           );
            routes.Remove(route);
            routes.Insert(0, route);

            //Override Product edit route 
            //var route2 = routes.MapRoute("Plugin.Misc.AUConsignor.Edit",
            //     "Admin/Product/Edit/{id}",
            //     new { controller = "AULot", action = "Edit", area = "Admin" }, //notice 'area="Admin"' is added
            //     new { id = @"\d+" },
            //     new[] { "Nop.Plugin.Misc.AUConsignor.Controllers" }
            //);


            //Override primary Customer edit routes - You need the promary route definition for the Master view override for some reason
            route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.Edit",            //this name can be anything but must be unique in the routetable
                "Admin/Customer/Edit/{id}",
                new { controller = "Customer", action = "Edit", area = "Admin" }, //notice 'area="Admin"' is added
                new { id = @"\d+" },
                new[] { "Nop.Admin.Controllers" }
           );

            routes.Remove(route);
            routes.Insert(0, route);


            route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.OrderList",            //this name can be anything but must be unique in the routetable
               "Admin/Customer/OrderList/{id}",
               new { controller = "Customer", action = "OrderList", area = "Admin" }, //notice 'area="Admin"' is added
               new { id = @"\d+" },
               new[] { "Nop.Admin.Controllers" }
          );

            routes.Remove(route);
            routes.Insert(0, route);


            route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.AddressesSelect",            //this name can be anything but must be unique in the routetable
               "Admin/Customer/AddressesSelect/{id}",
               new { controller = "Customer", action = "AddressesSelect", area = "Admin" }, //notice 'area="Admin"' is added
               new { id = @"\d+" },
               new[] { "Nop.Admin.Controllers" }
          );

            routes.Remove(route);
            routes.Insert(0, route);


            //Have no clue why this works with one parameter
            route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.GetCartList",            //this name can be anything but must be unique in the routetable
               "Admin/Customer/GetCartList/{id}",
               new { controller = "Customer", action = "GetCartList", area = "Admin" }, //notice 'area="Admin"' is added
               new { id = @"\d+" },
               new[] { "Nop.Admin.Controllers" }
          );

            routes.Remove(route);
            routes.Insert(0, route);


            route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.ListActivityLog",            //this name can be anything but must be unique in the routetable
              "Admin/Customer/ListActivityLog/{id}",
              new { controller = "Customer", action = "ListActivityLog", area = "Admin" }, //notice 'area="Admin"' is added
              new { id = @"\d+" },
              new[] { "Nop.Admin.Controllers" }
         );

            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.RewardPointsHistorySelect",            //this name can be anything but must be unique in the routetable
              "Admin/Customer/RewardPointsHistorySelect/{id}",
              new { controller = "Customer", action = "RewardPointsHistorySelect", area = "Admin" }, //notice 'area="Admin"' is added
              new { id = @"\d+" },
              new[] { "Nop.Admin.Controllers" }
         );

            routes.Remove(route);
            routes.Insert(0, route);


            route = routes.MapRoute("AddressEdit",
                           "customer/addressedit/{addressId}",
                           new { controller = "Customer", action = "AddressEdit", area = "Admin" },
                           new { addressId = @"\d+" },
                           new[] { "Nop.Admin.Controllers" });

 ////////           route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.AddressEdit",            //this name can be anything but must be unique in the routetable
 ////////             "Admin/Customer/AddressEdit/{addressId}/{customerId}",
 ////////             new { controller = "Customer", action = "AddressEdit", area = "Admin" }, //notice 'area="Admin"' is added
 //////////             new { addressId = @"\d+", customerId = @"\d+" },
 ////////             new[] { "Nop.Admin.Controllers" }
 ////////        );


         //   route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.AddressEdit",            //this name can be anything but must be unique in the routetable
         //     "Admin/Customer/AddressEdit/{id}",
         //     new { controller = "Customer", action = "AddressEdit", area = "Admin" }, //notice 'area="Admin"' is added
         //     new { id = @"\d+"},
         //     new[] { "Nop.Admin.Controllers" }
         //);

            routes.Remove(route);
            routes.Insert(0, route);


            route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.CreateAddress",            //this name can be anything but must be unique in the routetable
          "Admin/Customer/AddressCreate/{id}",
          new { controller = "Customer", action = "AddressCreate", area = "Admin" }, //notice 'area="Admin"' is added
          new { id = @"\d+" },
          new[] { "Nop.Admin.Controllers" }
        );

            routes.Remove(route);
            routes.Insert(0, route);


            route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.SendEmail",            //this name can be anything but must be unique in the routetable
              "Admin/Customer/SendEmail/{id}",
              new { controller = "Customer", action = "SendEmail", area = "Admin" }, //notice 'area="Admin"' is added
              new { id = @"\d+" },
              new[] { "Nop.Admin.Controllers" }
         );

            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.SendPm",            //this name can be anything but must be unique in the routetable
              "Admin/Customer/SendPm/{id}",
              new { controller = "Customer", action = "SendPm", area = "Admin" }, //notice 'area="Admin"' is added
              new { id = @"\d+" },
              new[] { "Nop.Admin.Controllers" }
         );

            routes.Remove(route);
            routes.Insert(0, route);





            route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.Delete",            //this name can be anything but must be unique in the routetable
              "Admin/Customer/Delete/{id}",
              new { controller = "Customer", action = "Delete", area = "Admin" }, //notice 'area="Admin"' is added
              new { id = @"\d+" },
              new[] { "Nop.Admin.Controllers" }
         );

            routes.Remove(route);
            routes.Insert(0, route);




            //-------------------------------------------------------------------------------------------------------------------------------------------

            //Override primary Product edit route - You need this primary route definition for the Master Edit.cshtml view override for some reason
            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.Edit",
                 "Admin/Product/Edit/{id}",
                 new { controller = "Product", action = "Edit", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);


            //Override primary Product Create route - You need this primary route definition for the Master Create.cshtml view override for some reason
            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.Create",
                 "Admin/Product/Create",
                 new { controller = "Product", action = "Create", area = "Admin" }, //notice 'area="Admin"' is added
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductPictureList",
                 "Admin/Product/ProductPictureList/{id}",
                 new { controller = "Product", action = "ProductPictureList", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);



            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductCategoryList",
                 "Admin/Product/ProductCategoryList/{id}",
                 new { controller = "Product", action = "ProductCategoryList", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);


            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductCategoryDelete",
                "Admin/Product/ProductCategoryDelete/{id}",
                new { controller = "Product", action = "ProductCategoryDelete", area = "Admin" }, //notice 'area="Admin"' is added
                new { id = @"\d+" },
                new[] { "Nop.Admin.Controllers" }
           );


            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductManufacturerList",
                 "Admin/Product/ProductManufacturerList/{id}",
                 new { controller = "Product", action = "ProductManufacturerList", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);



            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductSpecAttrList",
                 "Admin/Product/ProductSpecAttrList/{id}",
                 new { controller = "Product", action = "ProductSpecAttrList", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);



            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductAttributeMappingList",
                 "Admin/Product/ProductAttributeMappingList/{id}",
                 new { controller = "Product", action = "ProductAttributeMappingList", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductAttributeCombinationList",
                 "Admin/Product/ProductAttributeCombinationList/{id}",
                 new { controller = "Product", action = "ProductAttributeCombinationList", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.TierPriceList",
                 "Admin/Product/TierPriceList/{id}",
                 new { controller = "Product", action = "TierPriceList", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.RelatedProductList",
                 "Admin/Product/RelatedProductList/{id}",
                 new { controller = "Product", action = "RelatedProductList", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);



            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.CrossSellProductList",
                 "Admin/Product/CrossSellProductList/{id}",
                 new { controller = "Product", action = "CrossSellProductList", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);



            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.AssociatedProductList",
                 "Admin/Product/AssociatedProductList/{id}",
                 new { controller = "Product", action = "AssociatedProductList", area = "Admin" }, //notice 'area="Admin"' is added
                 new { id = @"\d+" },
                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);



            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.PurchasedWithOrders",
                 "Admin/Product/PurchasedWithOrders/{id}",
                 new { controller = "Product", action = "PurchasedWithOrders", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.PurchasedWithOrders",
                 "Admin/Product/PurchasedWithOrders/{id}",
                 new { controller = "Product", action = "PurchasedWithOrders", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.Delete",
                 "Admin/Product/Delete/{id}",
                 new { controller = "Product", action = "Delete", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);


            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductPictureAdd",
                 "Admin/Product/ProductPictureAdd/{id}",
                 new { controller = "Product", action = "ProductPictureAdd", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductCategoryInsert",
                 "Admin/Product/ProductCategoryInsert/{id}",
                 new { controller = "Product", action = "ProductCategoryInsert", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);





            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductManufacturerInsert",
                 "Admin/Product/ProductManufacturerInsert/{id}",
                 new { controller = "Product", action = "ProductManufacturerInsert", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);





            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductSpecificationAttributeAdd",
                 "Admin/Product/ProductSpecificationAttributeAdd/{id}",
                 new { controller = "Product", action = "ProductSpecificationAttributeAdd", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);


            

            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.ProductAttributeMappingInsert",
                 "Admin/Product/ProductAttributeMappingInsert/{id}",
                 new { controller = "Product", action = "ProductAttributeMappingInsert", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);


            

            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.TierPriceInsert",
                 "Admin/Product/TierPriceInsert/{id}",
                 new { controller = "Product", action = "TierPriceInsert", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);


            

            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.RelatedProductAddPopup",
                 "Admin/Product/RelatedProductAddPopup/{id}",
                 new { controller = "Product", action = "RelatedProductAddPopup", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);

            

            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.CrossSellProductAddPopup",
                 "Admin/Product/CrossSellProductAddPopup/{id}",
                 new { controller = "Product", action = "CrossSellProductAddPopup", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.RelatedProductAddPopupList",
                 "Admin/Product/RelatedProductAddPopupList/{id}",
                 new { controller = "Product", action = "RelatedProductAddPopupList", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);



            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.AssociatedProductAddPopupList",
                 "Admin/Product/AssociatedProductAddPopupList/{id}",
                 new { controller = "Product", action = "AssociatedProductAddPopupList", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);

            

            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.CrossSellProductAddPopupList",
                 "Admin/Product/CrossSellProductAddPopupList/{id}",
                 new { controller = "Product", action = "CrossSellProductAddPopupList", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);


            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.AssociatedProductAddPopup",
                "Admin/Product/AssociatedProductAddPopup/{id}",
                new { controller = "Product", action = "AssociatedProductAddPopup", area = "Admin" }, //notice 'area="Admin"' is added

                new[] { "Nop.Admin.Controllers" }
           );


            routes.Remove(route);
            routes.Insert(0, route);

            
            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.RelatedProductUpdate",
                 "Admin/Product/RelatedProductUpdate/{id}",
                 new { controller = "Product", action = "RelatedProductUpdate", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);


            
            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.RelatedProductDelete",
                 "Admin/Product/RelatedProductDelete/{id}",
                 new { controller = "Product", action = "RelatedProductDelete", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);




            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.CrossSellProductDelete",
                 "Admin/Product/CrossSellProductDelete/{id}",
                 new { controller = "Product", action = "CrossSellProductDelete", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Admin.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);


            //-------------------------------------------------------------------------------------------------------------------------------------------

            //Override primary Product list route - You need this promary route definition for the Master view override for some reason
            route = routes.MapRoute("Plugin.Misc.AUConsignor.Product.List",
                 "Admin/Product/List",
                 new { controller = "Product", action = "List", area = "Admin" }, //notice 'area="Admin"' is added
                 new[] { "Nop.Admin.Controllers" }
            );

            routes.Remove(route);
            routes.Insert(0, route);


            //this overrides the catalog/products list to go to the lot lister
            route = routes.MapRoute("Plugin.Misc.AUConsignor.ProductList",
                 "Admin/Product/List",
                 new { controller = "AUConsignor", action = "ListLots", area = "Admin" }, //notice 'area="Admin"' is added

                 new[] { "Nop.Plugin.Misc.AUConsignor.Controllers" }
            );


            routes.Remove(route);
            routes.Insert(0, route);



            route = routes.MapRoute("Plugin.Misc.AUConsignor.AUFile.ASyncUpload",
                "Admin/AUFile/ASyncUpload",
                new { controller = "AUFile", action = "ASyncUpload", area = "Admin" }, //notice 'area="Admin"' is added
                //new { id = @"\d+" },
                new[] { "Nop.Admin.Controllers" }
           );


            routes.Remove(route);
            routes.Insert(0, route);


            route = routes.MapRoute("Plugin.Misc.AUConsignor.AUFile.ConsignmentFileAdd",
                "Admin/AUFile/ConsignmentFileAdd",
                new { controller = "AUFile", action = "ConsignmentFileAdd", area = "Admin" }, //notice 'area="Admin"' is added
                //new { id = @"\d+" },
                new[] { "Nop.Admin.Controllers" }
           );


            routes.Remove(route);
            routes.Insert(0, route);




            //------------------------------- FRONT END ---------------------------------------------

            //NJM: this is for categorynavigation.cshtml: <a href="@Url.RouteUrl("AUSaleCategory", new { categoryId = category.CategoryId, saleId = insaleId })">@category.Name
            routes.MapLocalizedRoute("AUSaleCategory",
                "{categoryId}/{saleId}",       //these names must match the names passed in @Url.RouteUrl
                new { controller = "AUPublic", action = "Category" },
                 new { categoryId = @"\d+" },       //NJM: !!!Make sure you put this constraint in or else it starts picking up everything in /AUConsignor/XXX
                //new { seoName = @"."},
                 new[] { "Nop.Web.Controllers" });

            //////add bid to lot - used on the product details pages.
            ////routes.MapLocalizedRoute("AddBidToLot-Details",
            ////                "addbidtolot",
            ////                new { controller = "AUPublic", action = "AddBidToLot_Details" },
            ////    // new { productId = @"\d+", bidAmt = @"\d+", bidUid = @"\d+" },
            ////    //new { productId = @"\d+", bidAmt = @"\d+" },
            ////                new[] { "Nop.Web.Controllers" });

            //add bid to lot - used on the product details pages.
            routes.MapLocalizedRoute("AddBidToLot-Details",
                            "addbidtolot/{productId}",
                            new { controller = "AUPublic", action = "AddBidToLot_Details" },
                             new { productId = @"\d+"},
                            new[] { "Nop.Web.Controllers" });

            ////////////add product to cart (with attributes and options). used on the product details pages.
            //////////routes.MapLocalizedRoute("AddProductToCart-Details",
            //////////                "addproducttocart/details/{productId}/{shoppingCartTypeId}",
            //////////                new { controller = "ShoppingCart", action = "AddProductToCart_Details" },
            //////////                new { productId = @"\d+", shoppingCartTypeId = @"\d+" },
            //////////                new[] { "Nop.Web.Controllers" });
       




            routes.MapLocalizedRoute("AUConsignorProductEmailInquiry",
                "productemailinquiry/{productId}",
                new { controller = "AUPublic", action = "AUConsignorProductEmailInquiry" },
                new { productId = @"\d+" },
                new[] { "Nop.Web.Controllers" });


            routes.MapLocalizedRoute("RefreshLot_Details",
                            "RefreshLot_Details",
                            new { controller = "AUPublic", action = "RefreshLot_Details" },
                // new { productId = @"\d+", bidAmt = @"\d+", bidUid = @"\d+" },
                //new { productId = @"\d+", bidAmt = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("RefreshLot_Redirect",
                            "RefreshLot_Redirect",
                            new { controller = "AUPublic", action = "RefreshLot_Redirect" },
                // new { productId = @"\d+", bidAmt = @"\d+", bidUid = @"\d+" },
                //new { productId = @"\d+", bidAmt = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("CompareLastLotBidChange",
                            "CompareLastLotBidChange",
                            new { controller = "AUPublic", action = "CompareLastLotBidChange" },
                            new[] { "Nop.Web.Controllers" });


            routes.MapLocalizedRoute("AUProductSearch",
                            "search/",
                            new { controller = "AUPublic", action = "Search" },
                            new[] { "Nop.Web.Controllers" });

            //overrides Wishlist
            routes.MapLocalizedRoute("AUWishlist",
                            "wishlist/{customerGuid}",
                            new { controller = "AUPublic", action = "Wishlist", customerGuid = UrlParameter.Optional },
                            new[] { "Nop.Web.Controllers" });

            //copied from Wishlist
            routes.MapLocalizedRoute("AUMybids",
                            "mybids/{customerGuid}",
                            new { controller = "AUPublic", action = "Mybids", customerGuid = UrlParameter.Optional },
                            new[] { "Nop.Web.Controllers" });




            //routes.MapLocalizedRoute("HomepageProducts",
            //                "AUConsignor/HomepageProducts",
            //                new { controller = "AUConsignor", action = "HomepageProducts" },
            //                new[] { "Nop.Web.Controllers" });

             //routes.MapLocalizedRoute("AUHomePage",
             //               "",
             //               new { controller = "AUConsignor", action = "Index" },
             //               new[] { "Nop.Web.Controllers" });


            //routes.Remove(route);
            //routes.Insert(0, route);

            //Override primary Customer edit routes - You need the promary route definition for the Master view override for some reason
           // route = routes.MapRoute("Plugin.Misc.AUConsignor.Customer.Edit",            //this name can be anything but must be unique in the routetable
           //     "Admin/Customer/Edit/{id}",
           //     new { controller = "Customer", action = "Edit", area = "Admin" }, //notice 'area="Admin"' is added
           //     new { id = @"\d+" },
           //     new[] { "Nop.Admin.Controllers" }
           //);

           // routes.Remove(route);
           // routes.Insert(0, route);


              //route = routes.MapRoute("Plugin.Misc.AUConsignor.ProductDetails",

            //This had no effect on the sename route below
            //generic URLs
            //routes.MapGenericPathRoute("GenericUrl2",
            //                           "{generic_se_name}",
            //                           new { controller = "Common", action = "GenericUrl" },
            //                           new[] { "Nop.Web.Controllers" });


            //*****OK this works but gets to an action with no signature, and applies to all seo names
            //////route = routes.MapRoute("Product",
            //////     "{SeName}",
            //////     new { controller = "AUConsignor", action = "ProductDetails" }, //notice 'area="Admin"' is not added
            //////     new[] { "Nop.Plugin.Misc.AUConsignor.Controllers" }
            //////);

            ////////                 "Product/ProductDetails/{productid}/{SeName}",

            //////routes.Remove(route);
            //////routes.Insert(0, route);


            
            //new { controller = "Product", action = "ProductList", area = "Admin" }, //notice 'area="Admin"' is added
            //new[] { "Nop.Admin.Controllers" }

            
                
            //http://localhost:15536/Product/RelatedProductAddPopup?productId=4&btnId=btnRefreshRelatedProducts&formId=product-form
            //--> RelatedProductAddPopupList
            //http://localhost:15536/Product/CrossSellProductAddPopup?productId=4&btnId=btnRefreshCrossSellProducts&formId=product-form
            //--> CrossSellProductAddPopupList






            // new { controller = "AUConsignorAdmin", action = "Edit", area = "Admin" }, //What controller and action to use -->notice 'area="Admin"' is added
            // new[] { "Nop.Admin.Controllers" }

            //this worked but took another approach so as not to copy entire customer controller into your controller
            //                                //Route Name                                 URL
            //var route = routes.MapRoute("Plugin.Misc.AUConsignor.EditCustomer", "Admin/Customer/Edit/{id}",
            //     new { controller = "AUConsignor", action = "EditCustomer", area = "Admin" }, //notice 'area="Admin"' is added
            //     new { id = @"\d+" },
            //     new[] { "Nop.Plugin.Misc.AUConsignor.Controllers" }
            //);
            //routes.Remove(route);
            //routes.Insert(0, route); 

           

        }
Example #14
0
 /// <summary> Based on pattern of odd-even ('L' and 'G') patterns used to encoded the explicitly-encoded
 /// digits in a barcode, determines the implicitly encoded first digit and adds it to the
 /// result string.
 /// 
 /// </summary>
 /// <param name="resultString">string to insert decoded first digit into
 /// </param>
 /// <param name="lgPatternFound">int whose bits indicates the pattern of odd/even L/G patterns used to
 /// encode digits
 /// </param>
 /// <throws>  ReaderException if first digit cannot be determined </throws>
 private static void determineFirstDigit(System.Text.StringBuilder resultString, int lgPatternFound)
 {
     for (int d = 0; d < 10; d++)
     {
         if (lgPatternFound == FIRST_DIGIT_ENCODINGS[d])
         {
             // resultString.Insert(0, (char) ('0' + d)); // commented by .net follower (http://dotnetfollower.com)
             resultString.Insert(0, new char[] { (char)('0' + d) } ); // added by .net follower (http://dotnetfollower.com)
             return ;
         }
     }
     throw ReaderException.Instance;
 }
Example #15
0
        /// <summary>
        /// Writes generic function based on Instructions.
        /// 
        /// The other WriteFunction() can figure out the return type automatically, so
        /// it is preferred over this more verbose version.
        /// </summary>
        /// <param name="S">Specification of algebra.</param>
        /// <param name="cgd">Results go into cgd.m_defSB, and so on</param>
        /// <param name="F">Function specification.</param>
        /// <param name="inline">When true, the code is inlined.</param>
        /// <param name="staticFunc">Static function?</param>
        /// <param name="returnType">The type to return (String, can also be e.g. <c>"code"</c>.</param>
        /// <param name="functionName">Name of generated function.</param>
        /// <param name="returnArgument">For use with the 'C' language, an extra argument can be used to return results.</param>
        /// <param name="arguments">Arguments of function (any `return argument' used for the C language is automatically generated).</param>
        /// <param name="instructions">List of GA-instructions which make up the function.</param>
        /// <param name="comment">Comment to go into generated code (used for decl only).</param>
        /// <param name="writeDecl">When false, no declaration is written</param>
        public static void WriteFunction(
            Specification S, G25.CG.Shared.CGdata cgd, G25.fgs F,
            bool inline, bool staticFunc, string returnType, string functionName,
            FuncArgInfo returnArgument, FuncArgInfo[] arguments,
            System.Collections.Generic.List<Instruction> instructions, Comment comment, bool writeDecl)
        {
            // where the definition goes:
            StringBuilder defSB = (inline) ? cgd.m_inlineDefSB : cgd.m_defSB;

            // declaration:
            if (writeDecl)
            {
                if (comment != null) comment.Write(cgd.m_declSB, S, 0);
                bool inlineDecl = false; // never put inline keywords in declaration
                WriteDeclaration(cgd.m_declSB, S, cgd, inlineDecl, staticFunc, returnType, functionName, returnArgument, arguments);
                cgd.m_declSB.AppendLine(";");
            }

            if (S.OutputCSharpOrJava()) comment.Write(defSB, S, 0);

            WriteDeclaration(defSB, S, cgd, inline, staticFunc, returnType, functionName, returnArgument, arguments);

            // open function
            defSB.AppendLine("");
            defSB.AppendLine("{");

            // add extra instruction for reporting usage of SMVs
            if (S.m_reportUsage)
                instructions.Insert(0, ReportUsage.GetReportInstruction(S, F, arguments));

            if (returnArgument != null)
            {
                int nbTabs = 1;
                instructions.Add(new VerbatimCodeInstruction(nbTabs, "return " + returnArgument.Name + ";"));
            }

            // write all instructions
            foreach (Instruction I in instructions)
            {
                I.Write(defSB, S, cgd);
            }

            // close function
            defSB.AppendLine("}");
        }
 private static void determineNumSysAndCheckDigit(System.Text.StringBuilder resultString, int lgPatternFound)
 {
     for (int numSys = 0; numSys <= 1; numSys++)
     {
         for (int d = 0; d < 10; d++)
         {
             if (lgPatternFound == NUMSYS_AND_CHECK_DIGIT_PATTERNS[numSys][d])
             {
                 // resultString.Insert(0, (char) ('0' + numSys)); // commented by .net follower (http://dotnetfollower.com)
                 resultString.Insert(0, new char[] { (char)('0' + numSys) } );  // added by .net follower (http://dotnetfollower.com)
                 resultString.Append((char) ('0' + d));
                 return ;
             }
         }
     }
     throw ReaderException.Instance;
 }
       public override void ModifyWizardPages(object source, GXPropertyPageType type, System.Collections.Generic.List<Control> pages)
	{
           if (type == GXPropertyPageType.Property)
           {
               pages.Insert(1, new ModBusWizardPage1Dlg());
           }
	}        
Example #18
0
	/// <summary> Do some substitutions for the term to reduce overstemming:
	/// 
	/// - Substitute Umlauts with their corresponding vowel: äöü -> aou,
	/// "ß" is substituted by "ss"
	/// - Substitute a second char of a pair of equal characters with
	/// an asterisk: ?? -> ?*
	/// - Substitute some common character combinations with a token:
	/// sch/ch/ei/ie/ig/st -> $/§/%/&/#/!
	/// </summary>
	private void  Substitute(System.Text.StringBuilder buffer)
	{
		substCount = 0;
		for (int c = 0; c < buffer.Length; c++)
		{
			// Replace the second char of a pair of the equal characters with an asterisk
			if (c > 0 && buffer[c] == buffer[c - 1])
			{
				buffer[c] = '*';
			}
			// Substitute Umlauts.
			else if (buffer[c] == 'A') //// 'ä')
			{
				//'ä' ) {
				buffer[c] = 'a';
			}
			else if (buffer[c] == 'A') //// 'ö')
			{
				//'ö' ) {
				buffer[c] = 'o';
			}
			else if (buffer[c] == 'A') //// 'ü')
			{
				// 'ü' ) {
				buffer[c] = 'u';
			}
			// Take care that at least one character is left left side from the current one
			if (c < buffer.Length - 1)
			{
				if (buffer[c] == 'A') //// 'ß')
				{
					//'ß' ) {
					buffer[c] = 's';
					buffer.Insert(c + 1, 's');
					substCount++;
				}
				// Masking several common character combinations with an token
				else if ((c < buffer.Length - 2) && buffer[c] == 's' && buffer[c + 1] == 'c' && buffer[c + 2] == 'h')
				{
					buffer[c] = '$';
					buffer.Remove(c + 1, c + 3 - (c + 1));
					substCount = + 2;
				}
				else if (buffer[c] == 'c' && buffer[c + 1] == 'h')
				{
					buffer[c] = 'A'; //// '§';
					buffer.Remove(c + 1, 1);
					substCount++;
				}
				else if (buffer[c] == 'e' && buffer[c + 1] == 'i')
				{
					buffer[c] = '%';
					buffer.Remove(c + 1, 1);
					substCount++;
				}
				else if (buffer[c] == 'i' && buffer[c + 1] == 'e')
				{
					buffer[c] = '&';
					buffer.Remove(c + 1, 1);
					substCount++;
				}
				else if (buffer[c] == 'i' && buffer[c + 1] == 'g')
				{
					buffer[c] = '#';
					buffer.Remove(c + 1, 1);
					substCount++;
				}
				else if (buffer[c] == 's' && buffer[c + 1] == 't')
				{
					buffer[c] = '!';
					buffer.Remove(c + 1, 1);
					substCount++;
				}
			}
		}
	}
	/// <summary> See ISO 16022:2006, 5.2.3 and Annex C, Table C.2</summary>
	private static int decodeAsciiSegment(BitSource bits, System.Text.StringBuilder result, System.Text.StringBuilder resultTrailer)
	{
		bool upperShift = false;
		do 
		{
			int oneByte = bits.readBits(8);
			if (oneByte == 0)
			{
				throw ReaderException.Instance;
			}
			else if (oneByte <= 128)
			{
				// ASCII data (ASCII value + 1)
				oneByte = upperShift?(oneByte + 128):oneByte;
				upperShift = false;
				result.Append((char) (oneByte - 1));
				return ASCII_ENCODE;
			}
			else if (oneByte == 129)
			{
				// Pad
				return PAD_ENCODE;
			}
			else if (oneByte <= 229)
			{
				// 2-digit data 00-99 (Numeric Value + 130)
				int value_Renamed = oneByte - 130;
				if (value_Renamed < 10)
				{
					// padd with '0' for single digit values
					result.Append('0');
				}
				result.Append(value_Renamed);
			}
			else if (oneByte == 230)
			{
				// Latch to C40 encodation
				return C40_ENCODE;
			}
			else if (oneByte == 231)
			{
				// Latch to Base 256 encodation
				return BASE256_ENCODE;
			}
			else if (oneByte == 232)
			{
				// FNC1
				//throw ReaderException.getInstance();
				// Ignore this symbol for now
			}
			else if (oneByte == 233)
			{
				// Structured Append
				//throw ReaderException.getInstance();
				// Ignore this symbol for now
			}
			else if (oneByte == 234)
			{
				// Reader Programming
				//throw ReaderException.getInstance();
				// Ignore this symbol for now
			}
			else if (oneByte == 235)
			{
				// Upper Shift (shift to Extended ASCII)
				upperShift = true;
			}
			else if (oneByte == 236)
			{
				// 05 Macro
				result.Append("[)>\u001E05\u001D");
				resultTrailer.Insert(0, "\u001E\u0004");
			}
			else if (oneByte == 237)
			{
				// 06 Macro
				result.Append("[)>\u001E06\u001D");
				resultTrailer.Insert(0, "\u001E\u0004");
			}
			else if (oneByte == 238)
			{
				// Latch to ANSI X12 encodation
				return ANSIX12_ENCODE;
			}
			else if (oneByte == 239)
			{
				// Latch to Text encodation
				return TEXT_ENCODE;
			}
			else if (oneByte == 240)
			{
				// Latch to EDIFACT encodation
				return EDIFACT_ENCODE;
			}
			else if (oneByte == 241)
			{
				// ECI Character
				// TODO(bbrown): I think we need to support ECI
				//throw ReaderException.getInstance();
				// Ignore this symbol for now
			}
			else if (oneByte >= 242)
			{
				// Not to be used in ASCII encodation
				throw ReaderException.Instance;
			}
		}
		while (bits.available() > 0);
		return ASCII_ENCODE;
	}
Example #20
0
	/// <summary> Undoes the changes made by substitute(). That are character pairs and
	/// character combinations. Umlauts will remain as their corresponding vowel,
	/// as "ß" remains as "ss".
	/// </summary>
	private void  Resubstitute(System.Text.StringBuilder buffer)
	{
		for (int c = 0; c < buffer.Length; c++)
		{
			if (buffer[c] == '*')
			{
				char x = buffer[c - 1];
				buffer[c] = x;
			}
			else if (buffer[c] == '$')
			{
				buffer[c] = 's';
				buffer.Insert(c + 1, new char[]{'c', 'h'}, 0, 2);
			}
			else if (buffer[c] == 'A') //// '§')
			{
				// '§' ) {
				buffer[c] = 'c';
				buffer.Insert(c + 1, 'h');
			}
			else if (buffer[c] == '%')
			{
				buffer[c] = 'e';
				buffer.Insert(c + 1, 'i');
			}
			else if (buffer[c] == '&')
			{
				buffer[c] = 'i';
				buffer.Insert(c + 1, 'e');
			}
			else if (buffer[c] == '#')
			{
				buffer[c] = 'i';
				buffer.Insert(c + 1, 'g');
			}
			else if (buffer[c] == '!')
			{
				buffer[c] = 's';
				buffer.Insert(c + 1, 't');
			}
		}
	}
Example #21
0
        public void Matrix_Insert_Test(int index, bool insertAfter, VectorType vectorType, bool isTransposed)
        {
            Vector v = (vectorType == VectorType.Row) ^ isTransposed ?
                            new double[] { 1, 3, 2, 0 } :
                            new double[] { 2, 1, 0 };

            Matrix A = new[,]
            {
                { 4, 1, 3, 2 },
                { 1, 2, 3, 4 },
                { 7, 9, 8, 6 }
            };

            if (isTransposed)
                A = A.T;

            var rows = A.Rows;
            var columns = A.Cols;

            var B = A.Insert(v, index, vectorType, insertAfter);

            Assert.Equal(A.Rows, rows);
            Assert.Equal(A.Cols, columns);

            if (vectorType == VectorType.Row)
            {
                Assert.Equal(B.Rows, rows + 1);
                Assert.Equal(B.Cols, columns);
            }
            else
            {
                Assert.Equal(B.Rows, rows);
                Assert.Equal(B.Cols, columns + 1);
            }

            var dimension = vectorType == VectorType.Row ? rows : columns;

            for (var i = 0; i < dimension + 1; i++)
            {
                if (index == dimension - 1 && insertAfter)
                    Assert.Equal(v, B[dimension, vectorType]);
                else if (i == index)
                    Assert.Equal(v, B[i, vectorType]);
                else if(i < index)
                    Assert.Equal(A[i, vectorType], B[i, vectorType]);
                else
                    Assert.Equal(A[i - 1, vectorType], B[i, vectorType]);
            }
        }
Example #22
0
    System.Collections.Generic.List<Point2D> resample(System.Collections.Generic.List<Point2D> points)
    {
        double interval = pathLength(points) / (numPointsinGesture -1);
        double D = 0;
        System.Collections.Generic.List<Point2D> newPoints = new System.Collections.Generic.List<Point2D>();

        if (points.Count > 0)
        {
            newPoints.Add(points[0]);
        }
        for(int i = 1;i < points.Count;++i)
        {
            Point2D currentPoint = points[i];
            Point2D previousPoint = points[i-1];

            double d = getDistance(previousPoint,currentPoint);

            if((D + d) >= interval)
            {
                double qx = previousPoint.x + ((interval - D) /d)*(currentPoint.x-previousPoint.x);
                double qy = previousPoint.y + ((interval - D) / d) * (currentPoint.y-previousPoint.y);

                Point2D point = new Point2D(qx,qy);
                newPoints.Add(point);
                points.Insert(i,point);
                D = 0.0;
            }
            else
            {
                D+=d;
            }
        }

        if(newPoints.Count == (numPointsinGesture - 1))
        {
            newPoints.Add(points[points.Count-1]);
        }

        return newPoints;
    }
Example #23
0
 private static void determineNumSysAndCheckDigit(System.Text.StringBuilder resultString, int lgPatternFound)
 {
     for (int numSys = 0; numSys <= 1; numSys++)
     {
         for (int d = 0; d < 10; d++)
         {
             if (lgPatternFound == NUMSYS_AND_CHECK_DIGIT_PATTERNS[numSys][d])
             {
                 //resultString.Insert(0, (char)('0' + numSys));
                 //resultString.Append((char) ('0' + d));
                 resultString.Insert(0, numSys.ToString());//GregBray: changed code to use ToString()
                 resultString.Append(d.ToString());
             }
         }
     }
     throw ReaderException.Instance;
 }
Example #24
0
        //private void Detector(object state)
        //{
        //    //System.Diagnostics.Process Processes = System.Diagnostics.Process.GetCurrentProcess();
        //    try
        //    {
        //        System.Windows.Forms.SendKeys.SendWait("{ENTER}");
        //        //foreach (System.ComponentModel.Component con in Processes.Container.Components)
        //        //{
        //        //    System.Windows.Forms.MessageBox.Show(con.ToString());
        //        //}
        //    }
        //    catch (System.NullReferenceException ex)
        //    {
        //        System.Windows.Forms.MessageBox.Show(ex.Message);
        //    }
        //}
        public void GetData(ReportForm.RptHander aReportName, string user, List<string> DevorSys, DateTime starTime, DateTime endTime, ref System.Data.DataTable dtDev, ref System.Data.DataTable dt, ref System.Collections.ArrayList arrListRpt)
        {
            clsDBRpt rpt = new clsDBRpt();
            int MyCol = -1;

            //報表標題陣列初始化
            arrListRpt.Clear();
            string sevorSys = "(";
            foreach (string s in DevorSys)
                sevorSys += "'" + s + "',";
            sevorSys = sevorSys.TrimEnd(',');
            sevorSys += ")";

            switch (aReportName)
            {
                case ReportForm.RptHander.操作記錄報表:
                    {
                        //把資料撈出來放進table
                        dt = rpt.GetctrlRPT_OPR1_01(sevorSys, user, starTime, endTime);

                        dtDev = rpt.GetDeviceList();

                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作時間, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作種類, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作設備, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作/執行狀態內容, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作人員, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,執行結果, ");
                    }
                    break;

                case ReportForm.RptHander.每日定時路況新聞稿:
                    {

                        string N1;
                        string N3;
                        string N4;
                        string N6;
                        //把資料撈出來放進table
                        dt = rpt.GetNewspaper(DateTime.Now.AddMinutes(-1).ToString("yyyy-MM-dd HH:mm"));
                        //dt = rpt.GetNewspaper("2010-11-03 12:00:00");

                        if (dt.Rows.Count > 0)
                        {

                            N1 = "2.路段狀況\n國道一號 新竹系統到大林路段 順暢/\n ";
                            N3 = "國道三號 香山到古坑 順暢/\n";
                            N4 = "國道四號 清水端到豐原端 順暢/\n";
                            N6 = "國道六號 霧峰系統到埔里端 順暢/\n";
                            for (int i = 0; i < dt.Rows.Count; i++)
                            {
                                if (dt.Rows[i]["LINEID"].ToString() == "N1")
                                {
                                    N1 += "\t" + dt.Rows[i]["from_location"] + "路段" + dt.Rows[i]["congested"] + "平均時速" + dt.Rows[i]["average_speed"].ToString().Trim() + "KM/H" + "\n";

                                }
                                else if (dt.Rows[i]["LINEID"].ToString() == "N3")
                                {

                                    N3 += "\t" + dt.Rows[i]["from_location"] + "路段" + dt.Rows[i]["congested"] + "平均時速" + dt.Rows[i]["average_speed"].ToString().Trim() + "KM/H" + "\n";

                                }
                                else if (dt.Rows[i]["LINEID"].ToString() == "N4")
                                {

                                    N4 += "\t" + dt.Rows[i]["from_location"] + "路段" + dt.Rows[i]["congested"] + "平均時速" + dt.Rows[i]["average_speed"].ToString().Trim() + "KM/H" + "\n";

                                }
                                else if (dt.Rows[i]["LINEID"].ToString() == "N6")
                                {

                                    N6 += "\t" + dt.Rows[i]["from_location"] + "路段" + dt.Rows[i]["congested"] + "平均時速" + dt.Rows[i]["average_speed"].ToString().Trim() + "KM/H" + "\n";

                                }
                            }

                            section = N1 + N3 + N4 + N6;
                        }

                        //dtDev = rpt.GetDeviceList();

                    }
                    break;

                case ReportForm.RptHander.路段壅塞狀況一分鐘報表:
                    {
                        starTime = DateTime.Now.AddMinutes(-1);
                        endTime = DateTime.Now;

                        //把資料撈出來放進table
                        dt = rpt.GetTRAFFICDATALOG(starTime, endTime);

                        //dtDev = rpt.GetDeviceList();

                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,路線, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,方向, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,時間, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,路段起點, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,路段起點里程, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,路段迄點, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,路段迄點里程, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總速度, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總流量, ");
                        MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,壅塞程度, ");
                    }
                    break;

            }

            //if (CtrlName == ctrlRPT_OPR1_01.Tag.ToString())//操作記錄報表
            //{

            //    //把資料撈出來放進table
            //    if (ctrlRPT_OPR1_01.GetPeopleList == "")
            //    {
            //        dt = rpt.GetctrlRPT_OPR1_01(ctrlRPT_OPR1_01.sDevSystemList, "", ctrlRPT_OPR1_01.TimeS, ctrlRPT_OPR1_01.TimeE);
            //    }
            //    else
            //    {
            //        dt = rpt.GetctrlRPT_OPR1_01(ctrlRPT_OPR1_01.sDevSystemList, ctrlRPT_OPR1_01.sDevPeopleList, ctrlRPT_OPR1_01.TimeS, ctrlRPT_OPR1_01.TimeE);

            //    }
            //    dtDev = rpt.GetDeviceList();

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作時間, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作種類, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作設備, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作/執行狀態內容, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作人員, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,執行結果, ");
            //}
            //else if (CtrlName == ctrlRPT_HDA_11.Tag.ToString())//匝道平均每日交通量統計報表
            //{
            //    //撈出符合畫面上的資料
            //    dt = rpt.GetCtrlRPT_HDA_11(ctrlRPT_HDA_11.sDevSystemList, ctrlRPT_HDA_11.TimeS, ctrlRPT_HDA_11.TimeE);

            //    dtvd = rpt.GetCtrlRPT_HDA_11vd(ctrlRPT_HDA_11.sDevSystemList, ctrlRPT_HDA_11.TimeS, ctrlRPT_HDA_11.TimeE);
            //    dtDev = rpt.Get_RPT_VD(ctrlRPT_HDA_11.Tag.ToString(), ADDVdstring(dtvd));

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,日期, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,聯結車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,聯結車比率%, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,大型車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,大型車比率%, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小型車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小型車比率%, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,合計總流量, , ");

            //}
            //else if (CtrlName == ctrlRPT_HDA_10.Tag.ToString())//主線平均每日交通量統計報表
            //{
            //    dt = rpt.Get_RPT_LineDayVolume(ctrlRPT_HDA_10.sDevSystemList, ctrlRPT_HDA_10.TimeS, ctrlRPT_HDA_10.TimeE);
            //    //this.dgvReport.DataSource = dt;

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備編號, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,路線, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,方向, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,里程, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,日期, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,聯結車, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,比率%, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,大型車, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,比率%, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小型車, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,比率%, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,合計總流量, ");

            //}
            //else if (CtrlName == ctrlRPT_HDA_12.Tag.ToString())//全區匝道全日交通量統計報表
            //{
            //    dt = rpt.Get_RPT_RAMPFULLDAY(ctrlRPT_HDA_12.sDevSystemList, ctrlRPT_HDA_12.TimeS, ctrlRPT_HDA_12.TimeE);

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,高速公路編號, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,交流道名稱, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,方向, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,流量, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備編號, ");

            //}
            //else if (CtrlName == ctrlRPT_HDA_14.Tag.ToString())//全區主線小時路段平均速度統計報表
            //{
            //    dt = rpt.Get_RPT_SectionCarSpeed(ctrlRPT_HDA_14.sDevSystemList, ctrlRPT_HDA_14.TimeS, ctrlRPT_HDA_14.TimeE);

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,高速公路編號, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,主線路段, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,方向, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,平均速度, ");

            //}
            //else if (CtrlName == ctrlRPT_HDA_13.Tag.ToString())//全區主線全日交通量統計報表
            //{
            //    dt = rpt.Get_RPT_LINEFULLDAY(ctrlRPT_HDA_13.sDevSystemList, ctrlRPT_HDA_13.TimeS, ctrlRPT_HDA_13.TimeE);

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,高速公路編號, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,主線路段, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,方向, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,流量, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,偵測器編號, ");
            //}
            //else if (CtrlName == ctrlRPT_HDA_05.Tag.ToString())//小時交通平均速度統計報表
            //{
            //    dt = rpt.Get_RPT_HourSpeed(ctrlRPT_HDA_05.sDevSystemList, ctrlRPT_HDA_05.TimeS, ctrlRPT_HDA_05.TimeE);

            //    dtvd = rpt.Get_RPT_HourSpeedVd(ctrlRPT_HDA_05.sDevSystemList, ctrlRPT_HDA_05.TimeS, ctrlRPT_HDA_05.TimeE);

            //    dtDev = rpt.Get_RPT_VD(ctrlRPT_HDA_05.Tag.ToString(), ADDVdstring(dtvd));

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,時間, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,設備, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,總平均, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,車道一, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,車道二, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,車道三, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,車道四, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,車道五, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,車道六, , ");

            //}
            //else if (CtrlName == ctrlRPT_DATA_03.Tag.ToString())//一分鐘交通資料記錄報表
            //{
            //    dt = rpt.Get_RPT_VD1MIN(ctrlRPT_DATA_03.sDevSystemList, ctrlRPT_DATA_03.TimeS, ctrlRPT_DATA_03.TimeE);

            //    dtvd = rpt.GetReport(ctrlRPT_DATA_03.sDevSystemList, ctrlRPT_DATA_03.TimeS, ctrlRPT_DATA_03.TimeE, "", "一分鐘交通資料VD");
            //    dtDev = rpt.Get_RPT_VD(ctrlRPT_DATA_03.Tag.ToString(), ADDVdstring(dtvd));

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,時間, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , , , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總流量,平均速度,平均占量");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  一,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  車 ,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  道 ,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  二 ,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  車 ,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  道 ,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  三 ,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  車 ,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  道 ,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  四 ,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  車 ,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  道 ,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  五 ,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  車 ,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  道 ,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  六 ,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");

            //}
            //else if (CtrlName == ctrlRPT_DATA_01.Tag.ToString())//五分鐘交通資料記錄報表
            //{
            //    dt = rpt.Get_RPT_VD5MIN(ctrlRPT_DATA_01.sDevSystemList, ctrlRPT_DATA_01.TimeS, ctrlRPT_DATA_01.TimeE);

            //    dt.Columns.Remove("priority");

            //    dtvd = rpt.GetReport(ctrlRPT_DATA_01.sDevSystemList, ctrlRPT_DATA_01.TimeS, ctrlRPT_DATA_01.TimeE, "", "五分鐘交通資料VD");
            //    dtDev = rpt.Get_RPT_VD(ctrlRPT_DATA_01.Tag.ToString(), ADDVdstring(dtvd));

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , , , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,時間, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,壅塞程度, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總流量,平均速度,平均占量");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "一,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "二,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "三,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "四,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "五,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "六,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //}
            //else if (CtrlName == ctrlRPT_DATA_06.Tag.ToString())//現點速率調查交通資料記錄報表
            //{
            //    dt = rpt.Get_RPT_VDSPOTSPEED(ctrlRPT_DATA_06.sDevSystemList, ctrlRPT_DATA_06.TimeS, ctrlRPT_DATA_06.TimeE);

            //    //撈出符合Gridview上的資料(這裡撈只是要確定這裡撈出的VD設備名稱有資料)
            //    dtvd = rpt.GetReport(ctrlRPT_DATA_06.sDevSystemList, ctrlRPT_DATA_06.TimeS, ctrlRPT_DATA_06.TimeE, "", "現點速率VD");
            //    dtDev = rpt.Get_RPT_VD(ctrlRPT_DATA_06.Tag.ToString(), ADDVdstring(dtvd));

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,時間, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , , , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總流量,平均速度,平均占量");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "一,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "二,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "三,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "四,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "五,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "六,小車, , ");
            //}
            //else if (CtrlName == ctrlRPT_STA_01.Tag.ToString())//現場終端設備狀態記錄報表
            //{
            //    dt = rpt.Get_RPT_DeviceStatus(ctrlRPT_STA_01.sDevSystemList, ctrlRPT_STA_01.TimeS, ctrlRPT_STA_01.TimeE);

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備編號, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,路線, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,位置, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,方向, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,里程, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,故障模組/原因, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,發生時間, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,恢復時間, ");

            //}
            //else if (CtrlName == ctrlRPT_OPR2_07.Tag.ToString())//定時比對記錄報表
            //{
            //    //撈出符合畫面上的資料
            //    dt = rpt.Get_RPT_tblDeviceStatusLog(ctrlRPT_OPR2_07.sDevSystemList, ctrlRPT_OPR2_07.TimeS, ctrlRPT_OPR2_07.TimeE);

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備編號, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,路線, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,位置, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,方向, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,里程, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,時間, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,中心顯示內容, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,現場顯示內容, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,比對結果, ");
            //}
            //else if (CtrlName == ctrlRPT_MON_01.Tag.ToString())//資訊可變標誌即時資料報表
            //{
            //    //撈出符合畫面上的資料
            //    dt = rpt.Get_RPT_tblDeviceStatus(ctrlRPT_MON_01.sDevSystemList);

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備編號, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備位置, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,連線狀態, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作模式, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作狀態, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,顯示資訊, ");

            //}
            //else if (CtrlName == ctrlRPT_DATA_02.Tag.ToString())//五分鐘車道使用率及車間距報表
            //{
            //    dt = rpt.Get_RPT_VD5MIN_INTERVAL(ctrlRPT_DATA_02.sDevSystemList, ctrlRPT_DATA_02.TimeS, ctrlRPT_DATA_02.TimeE);

            //    dtvd = rpt.GetReport(ctrlRPT_DATA_02.sDevSystemList, ctrlRPT_DATA_02.TimeS, ctrlRPT_DATA_02.TimeE, "", "五分鐘車間距資料VD");

            //    dtDev = rpt.Get_RPT_VD(ctrlRPT_DATA_02.Tag.ToString(), ADDVdstring(dtvd));

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , ,時間, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , ,設備, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,一,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,二,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,三,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,四,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,五,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,六,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總平均,車 長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總平均,車間距, ");

            //}
            //else if (CtrlName == ctrlRPT_HDA_01.Tag.ToString())//小時交通資料紀錄報表
            //{
            //    dt = rpt.Get_RPT_VD1HR(ctrlRPT_HDA_01.sDevSystemList, ctrlRPT_HDA_01.TimeS, ctrlRPT_HDA_01.TimeE);

            //    dtvd = rpt.GetReport(ctrlRPT_HDA_01.sDevSystemList, ctrlRPT_HDA_01.TimeS, ctrlRPT_HDA_01.TimeE, "", "一小時交通資料VD");
            //    dtDev = rpt.Get_RPT_VD(ctrlRPT_HDA_01.Tag.ToString(), ADDVdstring(dtvd));

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , , , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,時間, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , , , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總流量,平均速度,平均占量");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "一,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "二,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "三,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "四,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "五,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "六,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");

            //}
            //else if (CtrlName == ctrlRPT_HDA_03.Tag.ToString())//小時交通流量統計報表(依日期時段彙整)
            //{
            //    dt = rpt.Get_RPT_HourVolume(ctrlRPT_HDA_03.sDevSystemList, ctrlRPT_HDA_03.TimeS, ctrlRPT_HDA_03.TimeE);

            //    dtvd = rpt.Get_RPT_HourVolumeVD(ctrlRPT_HDA_03.sDevSystemList, ctrlRPT_HDA_03.TimeS, ctrlRPT_HDA_03.TimeE);
            //    dtDev = rpt.Get_RPT_VD("小時交通流量統計", ADDVdstring(dtvd));

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "時間, , , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "設備, , , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "總流量, , , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "小,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "計,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "一,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "二,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "三,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "四,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "五,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "六,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "  ,小車, , ");
            //}
            //else if (CtrlName == ctrlRPT_DATA_00.Tag.ToString())//一天交通資料
            //{
            //    dt = rpt.Get_RPT_VD1DAY(ctrlRPT_DATA_00.sDevSystemList, ctrlRPT_DATA_00.TimeS, ctrlRPT_DATA_00.TimeE);

            //    dtvd = rpt.GetReport(ctrlRPT_DATA_00.sDevSystemList, ctrlRPT_DATA_00.TimeS, ctrlRPT_DATA_00.TimeE, "", "一天交通資料VD");
            //    dtDev = rpt.Get_RPT_VD(ctrlRPT_DATA_00.Tag.ToString(), ADDVdstring(dtvd));

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , , , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,時間, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , , , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總流量,平均速度,平均占量");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "一,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "二,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "三,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "四,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "五,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "車,小計,平均,平均");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "道,聯結, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "六,大車, , ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,小車, , ");
            //}
            //else if (CtrlName == ctrlRPT_DATA_04.Tag.ToString())//一分鐘車道使用率及車間距報表
            //{

            //    dt = rpt.Get_RPT_VD1MIN_INTERVAL(ctrlRPT_DATA_04.sDevSystemList, ctrlRPT_DATA_04.TimeS, ctrlRPT_DATA_04.TimeE);

            //    dtvd = rpt.GetReport(ctrlRPT_DATA_04.sDevSystemList, ctrlRPT_DATA_04.TimeS, ctrlRPT_DATA_04.TimeE, "", "一分鐘車道使用率及車間距報表VD");

            //    dtDev = rpt.Get_RPT_VD(ctrlRPT_DATA_04.Tag.ToString(), ADDVdstring(dtvd));

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , ,時間, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " , ,設備, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,一,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,二,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,三,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,四,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,五,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,車,使用率, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,道,車長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,六,車間距, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總平均,車 長, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,總平均,車間距, ");
            //}
            //else if (CtrlName == ctrlRPT_MON_07.Tag.ToString())//設備狀態即時監視報表
            //{
            //    dt = rpt.Get_RPT_DeviceMonitor(ctrlRPT_MON_07.sDevSystemList, DateTime.Now, DateTime.Now);

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備種類, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備編號, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,路線名稱, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,連線狀態, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,操作模式, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,硬體狀態, ");
            //}
            //else if (CtrlName == ctrlRPT_OPR2_06.Tag.ToString())//現場終端設備運作記錄報表
            //{
            //    dt = rpt.Get_RPT_DeviceOpStatus(ctrlRPT_OPR2_06.sDevSystemList, ctrlRPT_OPR2_06.TimeS, ctrlRPT_OPR2_06.TimeE);

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,設備編號, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,路線, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,位置, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,方向, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,里程, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,時間, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,通訊狀態, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,運作狀態, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,顯示內容, ");

            //}
            //else if (CtrlName == ctrlRPT_OPR2_14.Tag.ToString())//路段旅行時間記錄報表
            //{
            //    dt = rpt.Get_RPT_TrafficDataLogSection(ctrlRPT_OPR2_14.Lineid, ctrlRPT_OPR2_14.direction, ctrlRPT_OPR2_14.start_D, ctrlRPT_OPR2_14.end_D, ctrlRPT_OPR2_14.TimeS, ctrlRPT_OPR2_14.TimeE);

            //    dtDev = rpt.Get_RPT_lineName(ctrlRPT_OPR2_14.Tag.ToString(), ctrlRPT_OPR2_14.Lineid, ctrlRPT_OPR2_14.direction);

            //    dtDev.Rows[0][1] = "里程:" + ctrlRPT_OPR2_14.start_DC.ToString() + "交流道至" + ctrlRPT_OPR2_14.end_DC.ToString() + "交流道(分鐘)";

            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, " ,時間, ");
            //    MyCol = MyCol + 1; arrListRpt.Insert(MyCol, "," + ctrlRPT_OPR2_14.start_DC.ToString() + "交流道至" + ctrlRPT_OPR2_14.end_DC.ToString() + "交流道(分鐘),");

            //}
            //if (dt != null)
            //{
            //    // 呼叫新執行緒
            //    Thread t = new Thread(CommClass.clsMethod.OpenMsg);
            //    t.Start();

            //    // 開始跑報表
            //    LoadReportViwer(dt);

            //    // 結束新執行緒
            //    t.Abort();
            //}
            //else
            //{
            //    MessageBox.Show(this, "您尚未篩選資料!", "錯誤訊息");
            //}
        }
	public void Insert_FuncNull ()
	{
		IEnumerable<int>    s = new[]{1};
		Func<int, int, int> f = null;
		s.Insert (0, f);
	}
    private static DicomDataset BuildZooDataset()
    {
      var target = new DicomDataset
                           {
                             new DicomPersonName(DicomTag.PatientName, new[] { "Anna^Pelle", null, "Olle^Jöns^Pyjamas" }),
                             { DicomTag.SOPClassUID, DicomUID.RTPlanStorage },
                             { DicomTag.SOPInstanceUID, new DicomUIDGenerator().Generate() },
                             { DicomTag.SeriesInstanceUID, new DicomUID[] { } },
                             { DicomTag.DoseType, new[] { "HEJ", null, "BLA" } },
                           };

      target.Add<DicomSequence>(DicomTag.ControlPointSequence, null);
      var beams = new[] { 1, 2, 3 }.Select(beamNumber =>
      {
        var beam = new DicomDataset();
        beam.Add(DicomTag.BeamNumber, beamNumber);
        beam.Add(DicomTag.BeamName, string.Format("Beam #{0}", beamNumber));
        return beam;
      }).ToList();
      beams.Insert(1, null);
      target.Add(DicomTag.BeamSequence, beams.ToArray());
      return target;
    }
Example #27
0
 public void TrySCIList(System.Collections.IList list)
 {
     // Should be called with a C5.IList<B> which is not a WrappedArray
       Assert.AreEqual(0, list.Count);
       list.CopyTo(new A[0], 0);
       list.CopyTo(new B[0], 0);
       list.CopyTo(new C[0], 0);
       Assert.IsTrue(!list.IsFixedSize);
       Assert.IsFalse(list.IsReadOnly);
       Assert.IsFalse(list.IsSynchronized);
       Assert.AreNotEqual(null, list.SyncRoot);
       Object b1 = new B(), b2 = new B(), c1 = new C(), c2 = new C();
       Assert.AreEqual(0, list.Add(b1));
       Assert.AreEqual(1, list.Add(c1));
       Assert.AreEqual(2, list.Count);
       Assert.IsTrue(list.Contains(c1));
       Assert.IsFalse(list.Contains(b2));
       list[0] = b2;
       Assert.AreEqual(b2, list[0]);
       list[1] = c2;
       Assert.AreEqual(c2, list[1]);
       Assert.IsTrue(list.Contains(b2));
       Assert.IsTrue(list.Contains(c2));
       Array arrA = new A[2], arrB = new B[2];
       list.CopyTo(arrA, 0);
       list.CopyTo(arrB, 0);
       Assert.AreEqual(b2, arrA.GetValue(0));
       Assert.AreEqual(b2, arrB.GetValue(0));
       Assert.AreEqual(c2, arrA.GetValue(1));
       Assert.AreEqual(c2, arrB.GetValue(1));
       Assert.AreEqual(0, list.IndexOf(b2));
       Assert.AreEqual(-1, list.IndexOf(b1));
       list.Remove(b1);
       list.Remove(b2);
       Assert.IsFalse(list.Contains(b2));
       Assert.AreEqual(1, list.Count); // Contains c2 only
       list.Insert(0, b2);
       list.Insert(2, b1);
       Assert.AreEqual(b2, list[0]);
       Assert.AreEqual(c2, list[1]);
       Assert.AreEqual(b1, list[2]);
       list.Remove(c2);
       Assert.AreEqual(b2, list[0]);
       Assert.AreEqual(b1, list[1]);
       list.RemoveAt(1);
       Assert.AreEqual(b2, list[0]);
       list.Clear();
       Assert.AreEqual(0, list.Count);
       list.Remove(b1);
 }
Example #28
0
		protected void AddToComboBox(EcTextBox tb, ComboBox cb, System.Collections.Specialized.StringCollection sc)
		{
			string strText = tb.Text;
			if (!String.IsNullOrEmpty(strText))
			{
				if (cb.Items.Contains(strText))
					cb.Items.Remove(strText);

				cb.Items.Insert(0, strText);

				// also save some in the project config file for later recall
				if (sc.Contains(strText))
					sc.Remove(strText);

				sc.Insert(0, strText);
			}
		}
Example #29
0
 public void IListInsertWorks()
 {
     IList<string> l = new[] { "x", "y", "z" };
     l.Insert(1, "a");
     Assert.AreEqual(l, new[] { "x", "a", "y", "z" });
 }
Example #30
0
        internal static void map(System.Text.StringBuilder s, char[] search, System.String[] replace)
        {
            for (int i = 0; i < search.Length; i++)
            {
                char c = search[i];

                int j = 0;
                while (j < s.Length)
                {
                    if (c == s[j])
                    {
                        //s.deleteCharAt(j);
                        s.Remove(j, 1);
                        if (null != replace[i])
                        {
                            s.Insert(j, replace[i]);
                            j += replace[i].Length - 1;
                        }
                    }
                    else
                    {
                        j++;
                    }
                }
            }
        }