public KinectFieldImageTextureFloat(DS.Simulation.CompositeFieldImage.KinectFieldImage source, Color3 color, KinectFieldImageType type)
		{
			m_Source = source;
			m_Color = color; 
			m_ImageType = type;

			m_Image = new ImageBoxFloat(null);

			m_Image.OverlayType = RugTech1.Framework.Effects.ImposterOverlayType.Add; 
		}
        public void ToExpando_OneObject2PropertiesDefinedAsString()
        {
            var o = DS.Expando(
                "ID", 1,
                "Name", "Fred"
                );

            Assert.AreEqual(1, o.ID);
            Assert.AreEqual("Fred", o.Name);
        }
        public int OpenDialog(vScreen.lib.ScreenManager screenManager)
        {
            this._pictureBoxes = DS.List(pictureBox1, pictureBox2, pictureBox3, pictureBox4);
            this._pictureBoxes.ForEach(pp => pp.BorderStyle = BorderStyle.None);
            this._screenManager = screenManager;
            int margin        = 4;
            var foundOneImage = false;

            for (var i = 0; i < this._screenManager.Count; i++)
            {
                var s = this._screenManager[i];
                this._pictureBoxes[i].Visible = false;

                if (s.HasDesktopBitmap)
                {
                    foundOneImage = true;
                    var p = this._pictureBoxes[i];
                    p.Tag     = i;
                    p.Visible = true;
                    p.Image   = Image.FromFile(s.PngFile);
                    p.Width   = p.Image.Width;
                    p.Height  = p.Image.Height;
                    switch (i)
                    {
                    case 0: p.Left = margin; p.Top = margin;                              break;

                    case 1: p.Left = p.Width + (2 * margin); p.Top = margin;                break;

                    case 2: p.Left = margin; p.Top = p.Height + (2 * margin);               break;

                    case 3: p.Left = p.Width + (2 * margin); p.Top = p.Height + (2 * margin); break;
                    }
                    this.Width  = p.Width * 2 + margin * 4;
                    this.Height = p.Height * 2 + margin * 8;
                }
            }

            if (!foundOneImage)
            {
                return(-1);
            }

            this.butCancel.Left = this.Width + 100; // Hide button

            var r = this.ShowDialog();

            if (r == System.Windows.Forms.DialogResult.OK)
            {
                return(_selected);
            }
            else
            {
                return(-1);
            }
        }
        public async Task <IActionResult> OnPostChannelAsync()
        {
            StreamSeries SC      = new StreamSeries();
            bool         SaveNew = false;


            try
            {
                SC.StreamSeriesID = int.Parse(Request.Form["StreamSeriesID"]);
                ID = SC.StreamSeriesID;
            }
            catch (Exception ex)
            {
                SaveNew = true;
            }
            SC.StreamChannelID = int.Parse(Request.Form["Channel"]);
            SC.Title           = Request.Form["Title"];
            SC.Description     = Request.Form["Description"];

            SC.FacebookURL = Request.Form["Facebook"].ToString().Trim();
            SC.ImageURL    = Request.Form["imgURLtextbox"];

            if (Request.Form["Enabled"] == "on")
            {
                SC.Enabled = true;
            }
            else
            {
                SC.Enabled = false;
            }
            string sd = Request.Form["StartDate"];

            SC.StartDate  = DateTime.Parse(Request.Form["StartDate"]);
            SC.EndDate    = DateTime.Parse(Request.Form["EndDate"]);
            SC.TwitchURL  = Request.Form["Twitch"].ToString().Trim();
            SC.YoutubeURL = Request.Form["Youtube"].ToString().Trim();

            SC.Enabled = true;
            if (SaveNew)
            {
                ReturnSR = await DS.PostAsyncSR(SC, "Streaming/AddStreamSeries");

                ID = int.Parse(ReturnSR.Response);
            }
            else
            {
                ReturnSR = await DS.PutAsyncSR(SC, "Streaming/UpdateStreamSeries");
            }
            string ChannelResponse = await DS.GetAsync("streaming/GetChannelsForUser");

            Channels = JsonConvert.DeserializeObject <List <StreamChannel> >(ChannelResponse);
            await GetChannel();

            return(Page());
        }
Exemple #5
0
        public void In()
        {
            var l = DS.Range(5);
            int i = 1;

            Assert.IsTrue(i.In(l));
            Assert.IsTrue(i.In(1, 2, 3, 4, 5));
            i = 11;
            Assert.IsFalse(i.In(l));
            Assert.IsFalse(i.In(1, 2, 3, 4, 5));
        }
Exemple #6
0
        public void Identical_String()
        {
            Assert.IsTrue(DS.ListHelper.Identical(DS.List("1"), DS.List("1")));
            Assert.IsTrue(DS.ListHelper.Identical(DS.List("1", "2", "3"), DS.List("1", "2", "3")));
            Assert.IsTrue(DS.ListHelper.Identical(DS.List("1", "2", "3", null), DS.List("1", "2", "3", null)));

            Assert.IsFalse(DS.ListHelper.Identical(DS.List("1", "2", "3"), DS.List("1", "2", "4")));
            Assert.IsFalse(DS.ListHelper.Identical(DS.List("1", "2", "3"), DS.List("1", "2", "3", "4")));

            Assert.IsTrue(DS.List("1", "2", "3").Identical(DS.List("1", "2", "3")));
        }
        public void PrimeFactorsKata_UnitTests()
        {
            DS.Assert.AreEqual(DS.List(3, 3), generate(9));
            DS.Assert.AreEqual(DS.List(2, 7), generate(14));
            DS.Assert.AreEqual(DS.List(13), generate(13));
            DS.Assert.AreEqual(DS.List(2, 3), generate(6));
            DS.Assert.AreEqual(DS.List(2, 2, 2, 11), generate(88));
            DS.Assert.AreEqual(DS.List(2, 2, 2, 2, 2, 3), generate(96));

            //foreach(var i in DSSharp.Range(30000)) { var z = generate(i); }
        }
Exemple #8
0
        public async Task <IActionResult> OnGetAsync()
        {
            Series = await SeriesService.GetSeriesList(false);

            IMTS.setParams("https://www.allportsopen.com/Podcasts", "article", "Our Shows", "The All Ports Open Network Podcasts", "https://media.allportsopen.org/Images/LogoSmWText.png");

            string response = await DS.GetAsync("Streaming/GetChannels");

            Channels = JsonConvert.DeserializeObject <List <StreamChannel> >(response);
            return(Page());
        }
Exemple #9
0
 // At least one of GetDV or the relevant GetD? must be implemented ( or an infinite recursion will happen ).
 public virtual DV GetDV()
 { 
   switch( DTI.Base( Type ) )
   {
     case DataType.Bool   : DB db = GetDB(); return ( ee ) => Value.New( db( ee ) );
     case DataType.Double : DD dd = GetDD(); return ( ee ) => Value.New( dd( ee ) );
     case DataType.String : DS ds = GetDS(); return ( ee ) => Value.New( ds( ee ) );
     case DataType.Binary : DX dx = GetDX(); return ( ee ) => Value.New( dx( ee ) );
     default:               DL dl = GetDL(); return ( ee ) => Value.New( dl( ee ) );
   }
 }
Exemple #10
0
        static void In()
        {
            int i = 1;

            if (i.In(1, 2, 3))
            {
            }

            List <int> l = DS.List(1, 2, 3);

            if (i.In(l))
            {
            }

            var state = "good";

            if (state.In("good", "bad", "soso"))
            {
            }

            var customerType = CustomerType.Good;

            if (customerType.In(CustomerType.Good, CustomerType.SoSo))
            {
            }

            var people = DS.List(
                new Person()
            {
                LastName = "Descartes", FirstName = "Rene", BirthDay = new DateTime(1596, 3, 31)
            },
                new Person()
            {
                LastName = "Montesquieu", FirstName = "Charles-Louis", BirthDay = new DateTime(1689, 1, 18)
            },
                new Person()
            {
                LastName = "Rousseau", FirstName = "JJ", BirthDay = new DateTime(1712, 3, 31)
            }
                );
            var Descartes = new Person()
            {
                LastName = "Descartes", FirstName = "Rene", BirthDay = new DateTime(1596, 3, 31)
            };

            if (Descartes.In(people))
            {
                Console.WriteLine("In the list people");
            }
            else
            {
                Console.WriteLine("Not in the list people");
            }
        }
Exemple #11
0
        public async Task <IActionResult> OnGetAsync()
        {
            string Response = await DS.GetAsync("News/GetQuickNews/" + id);

            NewsInfo = JsonConvert.DeserializeObject <QuickNewsInfo>(Response);

            IMTS.setParams("https://www.allportsopen.com/News/" + NewsInfo.QuickNews.QuickNewsID, "article", NewsInfo.QuickNews.Headline, NewsInfo.QuickNews.ShortDescription, NewsInfo.QuickNews.ImageURL);


            return(Page());
        }
        public void GetListOfWordsWithHammingDistanceOf()
        {
            var result = HammingStringDistance.GetListOfWordsWithHammingDistanceOf(threeLettersWordDic, "pat");

            Assert.AreEqual(1, result.Count);
            CollectionAssert.AreEqual(DS.List("cat"), result);

            result = HammingStringDistance.GetListOfWordsWithHammingDistanceOf(threeLettersWordDic, "coo");
            Assert.AreEqual(4, result.Count);
            CollectionAssert.AreEqual(result, result);
        }
Exemple #13
0
        private static void First_Last_Rest()
        {
            var l1 = DS.Range(10);

            while (!l1.IsEmpty())
            {
                var first = l1.First();
                var last  = l1.Last();
                l1 = l1.Rest();
            }
        }
        public async Task <IActionResult> OnPostAddSubseriesAsync()
        {
            string title = Request.Form["addSSTitle"];
            HttpResponseMessage message = await DS.PostAsync(title, "Series/AddSubseries");

            string response = await DS.GetAsync("Series/GetAllSubseries");

            subseriesList = Newtonsoft.Json.JsonConvert.DeserializeObject <List <SubseriesPageInfo> >(response);

            return(Page());
        }
Exemple #15
0
        private void btnListino_Click(object sender, EventArgs e)
        {
            string   filter   = QHS.DoPar(QHS.AppOr(QHS.IsNull("validitystop"), QHS.CmpGe("validitystop", Meta.GetSys("datacontabile"))));
            MetaData Mlistino = MetaData.GetMetaData(this, "listview");

            Mlistino.FilterLocked = true;
            Mlistino.DS           = DS.Clone();

            if (chkListDescription.Checked)
            {
                FrmAskDescr  FR = new FrmAskDescr(Meta.Dispatcher);
                DialogResult D  = FR.ShowDialog(this);
                if (D != DialogResult.OK)
                {
                    return;
                }
                if (FR.Selected != null)
                {
                    object idlistclass = FR.Selected["idlistclass"];
                    filter = QHS.AppAnd(filter, QHS.CmpEq("idlistclass", FR.Selected["idlistclass"]));
                }
                if (FR.txtDescrizione.Text != "")
                {
                    string Description = FR.txtDescrizione.Text;
                    if (!Description.EndsWith("%"))
                    {
                        Description += "%";
                    }
                    if (!Description.StartsWith("%"))
                    {
                        Description = "%" + Description;
                    }
                    filter = QHS.AppAnd(filter, QHS.Like("description", Description));
                }
            }

            DataRow Choosen = Mlistino.SelectOne("default", filter, "listview", null);

            if (Choosen == null)
            {
                return;
            }

            riempiOggetti(Choosen);

            if (Meta.IsEmpty)
            {
                return;
            }

            DataRow Curr = DS.stock.Rows[0];

            Curr["idlist"] = Choosen["idlist"];
        }
Exemple #16
0
        public async Task <IActionResult> OnPostDelSplashNewsAsync()
        {
            if (ID == 0)
            {
                return(new JsonResult(null));
            }

            HttpResponseMessage result = await DS.DeleteAsync("SplashNews/DeleteSplashNews/" + ID);

            return(new JsonResult(result.StatusCode.ToString()));
        }
Exemple #17
0
        public async Task <IActionResult> OnPostResetPassword()
        {
            ResetPW resetPW = new ResetPW();

            resetPW.ResetLink = Request.Form["LinkInfo"];
            resetPW.Password  = Request.Form["firstPassword"];

            HttpResponseMessage Result = await DS.PostAsync(resetPW, "user/ResetPassword");

            return(new JsonResult(Result.StatusCode.ToString()));
        }
Exemple #18
0
        public async Task <IActionResult> OnPostChannelAsync()
        {
            StreamSeriesEntry SSE = new StreamSeriesEntry();
            bool SaveNew          = false;


            try
            {
                SSE.StreamSeriesEntryID = int.Parse(Request.Form["StreamSeriesEntryID"]);
                ID = SSE.StreamSeriesEntryID;
            }
            catch (Exception ex)
            {
                SaveNew = true;
            }
            SSE.StreamSeriesID = int.Parse(Request.Form["StreamSeriesID"]);
            SSE.Title          = Request.Form["Title"];
            SSE.Description    = Request.Form["Description"];

            SSE.Link = Request.Form["Link"].ToString().Trim();


            if (Request.Form["Enabled"] == "on")
            {
                SSE.Enabled = true;
            }
            else
            {
                SSE.Enabled = false;
            }

            SSE.RecordDate = DateTime.Parse(Request.Form["RecordDate"]);
            SSE.PostDate   = DateTime.Parse(Request.Form["PostDate"]);


            SSE.Enabled = true;
            if (SaveNew)
            {
                ReturnSR = await DS.PostAsyncSR(SSE, "Streaming/AddStreamSeriesEntry");

                ID = int.Parse(ReturnSR.Response);
            }
            else
            {
                ReturnSR = await DS.PutAsyncSR(SSE, "Streaming/UpdateStreamSeriesEntry");
            }

            await GetStreamSeriesEntry();

            string ChannelResponse = await DS.GetAsync("streaming/GetStreamSeriesForUser");

            Series = JsonConvert.DeserializeObject <List <StreamSeries> >(ChannelResponse);
            return(Page());
        }
        void Sample4()
        {
            MyFunction(new Dictionary <string, bool>() // Regular C#
            {
                { "Debug", true },
                { "Verbose", false }
            });

            // Dynamic Sugar Syntax
            MyFunction(DS.Dictionary <bool>(new { Debug = true, Verbose = false }));
        }
Exemple #20
0
        public void CutWordHelloWithMap()
        {
            var s      = "Hello";
            var splits = DS.Range((int)s.Length + 1).Map <int, string>(i => s.Slice(0, i) + "," + s.Slice(i, -1));

            Assert.AreEqual(",Hello", splits[0]);
            Assert.AreEqual("H,ello", splits[1]);
            Assert.AreEqual("He,llo", splits[2]);
            Assert.AreEqual("Hel,lo", splits[3]);
            Assert.AreEqual("Hell,o", splits[4]);
            Assert.AreEqual("Hello,", splits[5]);
        }
 public void AcceptChanges()
 {
     try
     {
         DS.AcceptChanges();
         XmlManager.SetDataSet(config, DS);
     }
     catch (Exception Ex)
     {
         ErrorContext.Add("Pages-Save", "Could not save pages.config.<BR>" + Ex.Message);
     }
 }
        private bool LoadPowerShellIntellisense()
        {
            try {
                var powerShellCommandDefs = DS.Resources.GetTextResource(new System.Text.RegularExpressions.Regex("PS1.GenerateIntellisense.Txt..*gzip$", RegexOptions.IgnoreCase), Assembly.GetExecutingAssembly(), true, DS.TextResourceEncoding.Unicode);

                foreach (var e in powerShellCommandDefs)
                {
                    var parts       = e.Key.Split('.');
                    var commandName = parts[parts.Length - 3].ToLower();
                    var helpLines   = powerShellCommandDefs[e.Key].Split(DS.Array(Environment.NewLine), StringSplitOptions.None).ToList();

                    for (var i = 0; i < helpLines.Count; i++)
                    {
                        var line = helpLines[i];
                        if (line == "PARAMETERS")
                        {
                            i++;
                            var parametersDefIndex = i;
                            PowerShellDefinitions.Add(commandName, new IntellisenseDefinitionItems());

                            while (i < helpLines.Count)
                            {
                                var line2 = helpLines[i];
                                if (line2.Contains(POWERSHELL_HELP_END_OF_PARAMETER_SECTION))
                                {
                                    break;
                                }
                                else if (line2.StartsWith(POWERSHELL_HELP_DETECT_NEW_DASH_PARAMETER_DEFINITION))
                                {
                                    var intellisenseKeyWord = line2.Trim().Split(' ')[0];
                                    if (intellisenseKeyWord.StartsWith("-"))
                                    {
                                        intellisenseKeyWord = intellisenseKeyWord.Substring(1);
                                    }

                                    var helpDescription = this.ExtractDashParameterHelp(intellisenseKeyWord, helpLines, parametersDefIndex);
                                    PowerShellDefinitions[commandName].Add(new IntellisenseDefinitionItem(intellisenseKeyWord.ToLower(), intellisenseKeyWord, helpDescription));
                                }
                                i++;
                            }
                            break;
                        }
                    }
                }
                return(true);
            }
            catch (System.Exception ex) {
                #if DEBUG
                System.Diagnostics.Debugger.Break();
                #endif
                return(false);
            }
        }
Exemple #23
0
 public void DS_Dictionary()
 {
     Assert.AreEqual("RRabbit",
                     InitializeSettings(DS.Dictionary(
                                            new {
         UserName = "******",
         Domain   = "ToonTown",
         UserID   = 234873
     }
                                            ))
                     );
 }
Exemple #24
0
        public async Task <IActionResult> OnPostLoginAsync()
        {
            LoginUser.UserName = Request.Form["loginUsername"];
            LoginUser.Password = Request.Form["loginPassword"];

            UserReturnToken URT = new UserReturnToken();

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

            string result = await DS.GetAsync("User/InitiateLogin/" + LoginUser.UserName);

            URT.UserID = -1;
            if (result.Contains("200"))
            {
                HttpResponseMessage LoginResult = await DS.PostAsync(LoginUser, "user/authenticate");


                if (LoginResult.StatusCode == System.Net.HttpStatusCode.OK)
                {
                    var responseJSON = await LoginResult.Content.ReadAsStringAsync();

                    URT = Newtonsoft.Json.JsonConvert.DeserializeObject <UserReturnToken>(responseJSON);
                    if (string.IsNullOrEmpty(URT.Message))
                    {
                        myAuthService.SaveUserSessionData(URT);
                    }
                }
            }
            else
            {
                URT.Message = "No user with that name found";
            }


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

            if (string.IsNullOrEmpty(URT.Message))
            {
                //User was logged in
                SavedURT        = URT;
                LogInSuccessful = true;
                TokenExpDate    = DateTime.Now.AddMilliseconds(URT.Expiration);
            }
            else
            {
                //User was not logged in, display message
                LoginMessage = URT.Message;
            }



            return(Page());
        }
Exemple #25
0
        public async Task <IActionResult> OnGetAsync()
        {
            int    ForumID = 1112;
            string result  = await DS.GetAsync("Forum/GetForumAndPostsByID/" + ForumID);

            FWP = Newtonsoft.Json.JsonConvert.DeserializeObject <ForumWithPosts>(result);

            FWP.CurrentUserID = myAuthService.getUserID();


            return(Page());
        }
        void Sample8()
        {
            for (int i = 0; i < 10; i++) // Regular C#
            {
                Console.WriteLine(i);
            }

            foreach (var i in DS.Range(10)) // Dynamic Sugar Syntax
            {
                Console.WriteLine(i);
            }
        }
Exemple #27
0
        private static void ToFile_FromFile()
        {
            var l1 = DS.Range(10);
            //var fileName  = String.Format(@"{0}\DSSharpLibrary_UnitTests.txt", Environment.GetEnvironmentVariable("TEMP"));
            var fileName = String.Format(@"{0}\DSSharpLibrary_UnitTests.txt", System.IO.Path.GetTempPath());

            l1.ToFile(fileName, true);

            var l2 = DS.ListHelper.FromFile <int>(fileName);

            DS.Assert.AreEqual(l1, l2);
        }
        public static void Sample6_2()
        {
            var v1 = DS.List(1, 2, 3).Format();                     // 1, 2, 3
            var v2 = DS.List(1, 2, 3).Format(@"""{0}""", "; ");     // "1"; "2"; "3"

            var v3 = DS.List("a", "b", "c").Format();               // "a", "b", "c"
            var v4 = DS.List("a", "b", "c").Format(@"({0})", "; "); // ("a"); ("b"); ("c")

            var beatles = DS.Dictionary <int>(new { Paul = 1942, John = 1940, Richard = 1940, George = 1943 });
            var v5      = beatles.Format();                         // { Paul:1942, John:1940, Richard:1940, George:1943 }
            var v6      = beatles.Format(@"""{0}""=""{1}""", "; "); // { "Paul"="1942"; "John"="1940"; "Richard"="1940"; "George"="1943" }
        }
        public void Array_IntLoad()
        {
            var script = @" $IntArray = 0,1,2,3,4,5 ";
            var dpsc   = DynamicPowerShellContext.Create().Run(script);

            Assert.AreEqual(6, dpsc.IntArray.Length);

            foreach (var i in DS.Range(5))
            {
                Assert.AreEqual(i, dpsc.IntArray[i]);
            }
        }
Exemple #30
0
 public static void DropDownList_Load(Page p)
 {
     if (p.IsPostBack)
     {
         DS data = (DS)p.FindControl("Data");
         if (data == null)
         {
             Assert.Fail("Data soource control not created#1");
         }
         data.DoRaiseDataSourceChangedEvent(new EventArgs());
     }
 }
Exemple #31
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            DS ds = new DS();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Exemple #32
0
//----------------------------------------------------------------
/// Insert record: Activity
//----------------------------------------------------------------
public override IDataReader Insert(DS ds )
{
_dbCommand = _db.GetStoredProcCommand( "InsertActivity");
	_db.AddInParameter(_dbCommand, ds.Activity.Visit_IDColumn.ToString(), DbType.Int32,ds.Activity.Rows[0][ds.Activity.Visit_IDColumn.ToString()]);
	_db.AddInParameter(_dbCommand, ds.Activity.Activity_SequenceColumn.ToString(), DbType.Int32,ds.Activity.Rows[0][ds.Activity.Activity_SequenceColumn.ToString()]);
	_db.AddInParameter(_dbCommand, ds.Activity.Activity_Type_IDColumn.ToString(), DbType.Int32,ds.Activity.Rows[0][ds.Activity.Activity_Type_IDColumn.ToString()]);
	_db.AddInParameter(_dbCommand, ds.Activity.TimeColumn.ToString(), DbType.DateTime,ds.Activity.Rows[0][ds.Activity.TimeColumn.ToString()]);
	_db.AddInParameter(_dbCommand, ds.Activity.TextColumn.ToString(), DbType.String,ds.Activity.Rows[0][ds.Activity.TextColumn.ToString()]);
	_db.AddInParameter(_dbCommand, ds.Activity.IDColumn.ToString(), DbType.Int32,ds.Activity.Rows[0][ds.Activity.IDColumn.ToString()]);
	IDataReader dr = _db.ExecuteReader( _dbCommand,_transaction);
dr.Close();
return dr;
}
 List<Business.LogType> MapLogType(DS.LogTypeDataTable tb)
 {
     if (tb == null || tb.Rows.Count == 0)
     {
         return null;
     }
     List<Business.LogType> logTypeList = new List<Business.LogType>();
     int count = tb.Rows.Count;
     for (int i = 0; i < count; i++)
     {
         Business.LogType logType = new Business.LogType();
         logType.ID = tb[i].LogTypeID;
         logType.Name = tb[i].Name;
         logTypeList.Add(logType);
     }
     return logTypeList;
 }
        private List<Business.News> MapNews(DS.NewsDataTable tbNews)
        {
            List<Business.News> result = new List<Business.News>();
            if (tbNews != null)
            {
                int count = tbNews.Count;
                for (int i = 0; i < count; i++)
                {
                    Business.News newNews = new Business.News();
                    newNews.Body = tbNews[i].Body;
                    newNews.Catetory = tbNews[i].Category;
                    newNews.DateCreated = tbNews[i].DateCreated;
                    newNews.ID = tbNews[i].ID;
                    newNews.Title = tbNews[i].Title;
                    result.Add(newNews);
                }
            }

            return result;
        }
        /*public USlotSync():base(DS.SyncType.HARD, DateTime.Now)
        {
        }
        */
        public USlotSync(DS.SyncType syncType, DateTime dateTime, long logid)
        {
            // TODO: Complete member initialization
            this.syncType = syncType;
            this.syncTime = dateTime;

            timer = new DispatcherTimer();
            this.logid = logid;

            InitializeComponent();
            this.UTIME.Text = syncTime.ToLongDateString() + " " + syncTime.ToLongTimeString();
            this.USYNCTEXT.Text = syncType.ToString();


            
            
            timer.Interval = TimeSpan.FromSeconds(10);

            evtTick = new EventHandler(timer_Tick);
            timer.Tick += evtTick;
        }
 public virtual int Fill(DS.CombinaisonPrDataTable dataTable, string DesignF) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if ((DesignF == null)) {
         this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
     }
     else {
         this.Adapter.SelectCommand.Parameters[1].Value = ((string)(DesignF));
     }
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     DS ds = new DS();
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
 public virtual int Update(DS dataSet) {
     return this.Adapter.Update(dataSet, "Combinaison");
 }
 public virtual int Fill(DS.DesignActDataTable dataTable, string design) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if ((design == null)) {
         throw new global::System.ArgumentNullException("design");
     }
     else {
         this.Adapter.SelectCommand.Parameters[0].Value = ((string)(design));
     }
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }
 public abstract IDataReader Insert(DS ds);
 public virtual int Update(DS.CombinaisonDataTable dataTable) {
     return this.Adapter.Update(dataTable);
 }
Exemple #42
0
        internal static void TPTraceExit(string message, DS dps) {
#if _LOGGING
            if (!_tracingEnabled)
                return;
            BCLDebug.Trace("DATETIME", "[DATETIME] TryParse return {0}, DS.{1}", message, dps);
#endif // _LOGGING
        }
Exemple #43
0
 public override DS.Web.UCenter.Api.ApiReturn UpdateBadWords(DS.Web.UCenter.UcBadWords badWords)
 {
     throw new NotImplementedException();
 }
        [System.Security.SecuritySafeCritical]  // auto-generated
        private static Boolean Lex(
#if !FEATURE_CORECLR
            DS dps, ref __DTString str, ref DateTimeToken dtok, ref DateTimeRawInfo raw, ref DateTimeResult result, ref DateTimeFormatInfo dtfi, DateTimeStyles styles)
Exemple #45
0
        //
        // A terminal state has been reached, call the appropriate function to fill in the parsing result.
        // Return true if the state is a terminal state.
        //
        internal static Boolean ProcessTerminaltState(DS dps, ref DateTimeResult result, ref DateTimeStyles styles, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi)
        {

            bool passed = true;
            switch (dps)
            {
                case DS.DX_NN:
                    passed = GetDayOfNN(ref result, ref styles, ref raw, dtfi);
                    break;
                case DS.DX_NNN:
                    passed = GetDayOfNNN(ref result, ref raw, dtfi);
                    break;
                case DS.DX_MN:
                    passed = GetDayOfMN(ref result, ref styles, ref raw, dtfi);
                    break;
                case DS.DX_NM:
                    passed = GetDayOfNM(ref result, ref styles, ref raw, dtfi);
                    break;
                case DS.DX_MNN:
                    passed = GetDayOfMNN(ref result, ref raw, dtfi);
                    break;
                case DS.DX_DS:
                    // The result has got the correct value. No need to process.
                    passed = true;
                    break;
                case DS.DX_YNN:
                    passed = GetDayOfYNN(ref result, ref raw, dtfi);
                    break;
                case DS.DX_NNY:
                    passed = GetDayOfNNY(ref result, ref raw, dtfi);
                    break;
                case DS.DX_YMN:
                    passed = GetDayOfYMN(ref result, ref raw, dtfi);
                    break;
                case DS.DX_YN:
                    passed = GetDayOfYN(ref result, ref raw, dtfi);
                    break;
                case DS.DX_YM:
                    passed = GetDayOfYM(ref result, ref raw, dtfi);
                    break;
                case DS.TX_N:
                    passed = GetTimeOfN(dtfi, ref result, ref raw);
                    break;
                case DS.TX_NN:
                    passed = GetTimeOfNN(dtfi, ref result, ref raw);
                    break;
                case DS.TX_NNN:
                    passed = GetTimeOfNNN(dtfi, ref result, ref raw);
                    break;
                case DS.TX_TS:
                    // The result has got the correct value. Nothing to do.
                    passed = true;
                    break;
                case DS.DX_DSN:
                    passed = GetDateOfDSN(ref result, ref raw);
                    break;
                case DS.DX_NDS:
                    passed = GetDateOfNDS(ref result, ref raw);
                    break;
                case DS.DX_NNDS:
                    passed = GetDateOfNNDS(ref result, ref raw, dtfi);
                    break;
            }

            PTSTraceExit(dps, passed);
            if (!passed) {
                return false;
            }

            if (dps > DS.ERROR)
            {
                //
                // We have reached a terminal state. Reset the raw num count.
                //
                raw.numCount = 0;
            }
            return true;
        }
Exemple #46
0
 public override DS.Web.UCenter.Api.ApiReturn UpdateHosts(DS.Web.UCenter.UcHosts hosts)
 {
     throw new NotImplementedException();
 }
Exemple #47
0
 public override DS.Web.UCenter.Api.ApiReturn UpdateCreditSettings(DS.Web.UCenter.UcCreditSettings creditSettings)
 {
     throw new NotImplementedException();
 }
Exemple #48
0
 public override DS.Web.UCenter.Api.ApiReturn UpdateClient(DS.Web.UCenter.UcClientSetting client)
 {
     throw new NotImplementedException();
 }
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     DS ds = new DS();
     global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
     any1.Namespace = "http://www.w3.org/2001/XMLSchema";
     any1.MinOccurs = new decimal(0);
     any1.MaxOccurs = decimal.MaxValue;
     any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any1);
     global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
     any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
     any2.MinOccurs = new decimal(1);
     any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
     sequence.Items.Add(any2);
     global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute1.Name = "namespace";
     attribute1.FixedValue = ds.Namespace;
     type.Attributes.Add(attribute1);
     global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
     attribute2.Name = "tableTypeName";
     attribute2.FixedValue = "ActionDataTable";
     type.Attributes.Add(attribute2);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
 public abstract IDataReader Update(DS ds);
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private List<Business.LastBalance> MapLastBalance(DS.LastAccountDataTable tbLastAccount)
        {
            List<Business.LastBalance> result = new List<Business.LastBalance>();

            if (tbLastAccount != null)
            {
                int count = tbLastAccount.Count;
                for (int i = 0; i < count; i++)
                {
                    Business.LastBalance newLastBalance = new Business.LastBalance();
                    newLastBalance.Balance = tbLastAccount[i].Balance;
                    newLastBalance.ClosePL = tbLastAccount[i].ClosePL;
                    newLastBalance.Credit = tbLastAccount[i].Credit;
                    newLastBalance.Deposit = tbLastAccount[i].Deposit;
                    newLastBalance.FloatingPL = tbLastAccount[i].FloatingPL;
                    newLastBalance.FreeMargin = tbLastAccount[i].FreeMargin;
                    newLastBalance.InvestorID = tbLastAccount[i].InvestorID;
                    newLastBalance.LastAccountID = tbLastAccount[i].LastAccountID;
                    newLastBalance.LastEquity = tbLastAccount[i].Equity;
                    newLastBalance.LastMargin = tbLastAccount[i].Margin;
                    newLastBalance.LogDate = tbLastAccount[i].LogDate;
                    newLastBalance.LoginCode = tbLastAccount[i].LoginCode;
                    newLastBalance.PLBalance = tbLastAccount[i].PLBalance;
                    newLastBalance.CreditOut = tbLastAccount[i].CreditOut;
                    newLastBalance.Withdrawal = tbLastAccount[i].Withdrawal;
                    newLastBalance.CreditAccount = tbLastAccount[i].CreditAccount;

                    result.Add(newLastBalance);
                }
            }

            return result;
        }
Exemple #52
0
 public override DS.Web.UCenter.Api.ApiReturn UpdateApps(DS.Web.UCenter.UcApps apps)
 {
     throw new NotImplementedException();
 }
Exemple #53
0
        ////////////////////////////////////////////////////////////////////////
        //
        // Actions:
        // This is used by DateTime.Parse().
        // Process the terminal state for the Hebrew calendar parsing.
        //
        ////////////////////////////////////////////////////////////////////////

        internal static Boolean ProcessHebrewTerminalState(DS dps, ref DateTimeResult result, ref DateTimeStyles styles, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) {
            // The following are accepted terminal state for Hebrew date.
            switch (dps) {
                case DS.DX_MNN:
                    // Deal with the default long/short date format when the year number is ambigous (i.e. year < 100).
                    raw.year = raw.GetNumber(1);
                    if (!dtfi.YearMonthAdjustment(ref raw.year, ref raw.month, true)) {
                        result.SetFailure(ParseFailureKind.FormatBadDateTimeCalendar, "Format_BadDateTimeCalendar", null);
                        return false;
                    }
                    if (!GetDayOfMNN(ref result, ref raw, dtfi)) {
                        return false;
                    }
                    break;
                case DS.DX_YMN:
                    // Deal with the default long/short date format when the year number is NOT ambigous (i.e. year >= 100).
                    if (!dtfi.YearMonthAdjustment(ref raw.year, ref raw.month, true)) {
                        result.SetFailure(ParseFailureKind.FormatBadDateTimeCalendar, "Format_BadDateTimeCalendar", null);
                        return false;
                    }
                    if (!GetDayOfYMN(ref result, ref raw, dtfi)) {
                        return false;
                    }
                    break;
                case DS.DX_NM:
                case DS.DX_MN:
                    // Deal with Month/Day pattern.
                    GetDefaultYear(ref result, ref styles);
                    if (!dtfi.YearMonthAdjustment(ref result.Year, ref raw.month, true)) {
                        result.SetFailure(ParseFailureKind.FormatBadDateTimeCalendar, "Format_BadDateTimeCalendar", null);
                        return false;
                    }
                    if (!GetHebrewDayOfNM(ref result, ref raw, dtfi)) {
                        return false;
                    }
                    break;
                case DS.DX_YM:
                    // Deal with Year/Month pattern.
                    if (!dtfi.YearMonthAdjustment(ref raw.year, ref raw.month, true)) {
                        result.SetFailure(ParseFailureKind.FormatBadDateTimeCalendar, "Format_BadDateTimeCalendar", null);
                        return false;
                    }
                    if (!GetDayOfYM(ref result, ref raw, dtfi)) {
                        return false;
                    }
                    break;
                case DS.TX_N:
                    // Deal hour + AM/PM
                    if (!GetTimeOfN(dtfi, ref result, ref raw)) {
                        return false;
                    }
                    break;
                case DS.TX_NN:
                    if (!GetTimeOfNN(dtfi, ref result, ref raw)) {
                        return false;
                    }
                    break;
                case DS.TX_NNN:
                    if (!GetTimeOfNNN(dtfi, ref result, ref raw)) {
                        return false;
                    }
                    break;
                default:
                    result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                    return false;

            }
            if (dps > DS.ERROR)
            {
                //
                // We have reached a terminal state. Reset the raw num count.
                //
                raw.numCount = 0;
            }
            return true;
        }
 public virtual int Fill(DS.FaitDataTable dataTable) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }
Exemple #55
0
        internal static void PTSTraceExit(DS dps, bool passed) {
#if _LOGGING
            if (!_tracingEnabled)
                return;
            BCLDebug.Trace("DATETIME", "[DATETIME] ProcessTerminalState {0} @ DS.{1}", passed ? "passed" : "failed", dps);
#endif // _LOGGING
        }
 public virtual int Update(DS.ActionDataTable dataTable) {
     return this.Adapter.Update(dataTable);
 }
Exemple #57
0
        [System.Security.SecuritySafeCritical]  // auto-generated
        private static Boolean Lex(DS dps, ref __DTString str, ref DateTimeToken dtok, ref DateTimeRawInfo raw, ref DateTimeResult result, ref DateTimeFormatInfo dtfi, DateTimeStyles styles)
        {

            TokenType tokenType;
            int tokenValue;
            int indexBeforeSeparator;
            char charBeforeSeparator;

            TokenType sep;
            dtok.dtt = DTT.Unk;     // Assume the token is unkown.

            str.GetRegularToken(out tokenType, out tokenValue, dtfi);

#if _LOGGING
            // Builds with _LOGGING defined (x86dbg, amd64chk, etc) support tracing
            // Set the following internal-only/unsupported environment variables to enable DateTime tracing to the console:
            //
            // COMPlus_LogEnable=1
            // COMPlus_LogToConsole=1
            // COMPlus_LogLevel=9
            // COMPlus_ManagedLogFacility=0x00001000
            if (_tracingEnabled) {
                BCLDebug.Trace("DATETIME", "[DATETIME] Lex({0})\tpos:{1}({2}), {3}, DS.{4}", Hex(str.Value),
                               str.Index, Hex(str.m_current), tokenType, dps);
            }
#endif // _LOGGING

            // Look at the regular token.
            switch (tokenType) {
                case TokenType.NumberToken:
                case TokenType.YearNumberToken:
                    if (raw.numCount == 3 || tokenValue == -1) {
                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                        LexTraceExit("0010", dps);
                        return false;
                    }
                    //
                    // This is a digit.
                    //
                    // If the previous parsing state is DS.T_NNt (like 12:01), and we got another number,
                    // so we will have a terminal state DS.TX_NNN (like 12:01:02).
                    // If the previous parsing state is DS.T_Nt (like 12:), and we got another number,
                    // so we will have a terminal state DS.TX_NN (like 12:01).
                    //
                    // Look ahead to see if the following character is a decimal point or timezone offset.
                    // This enables us to parse time in the forms of:
                    //  "11:22:33.1234" or "11:22:33-08".
                    if (dps == DS.T_NNt) {
                        if ((str.Index < str.len - 1)) {
                            char nextCh = str.Value[str.Index];
                            if (nextCh == '.') {
                                // While ParseFraction can fail, it just means that there were no digits after
                                // the dot. In this case ParseFraction just removes the dot. This is actually
                                // valid for cultures like Albanian, that join the time marker to the time with
                                // with a dot: e.g. "9:03.MD"
                                ParseFraction(ref str, out raw.fraction);
                            }
                        }
                    }
                    if (dps == DS.T_NNt || dps == DS.T_Nt) {
                        if ((str.Index < str.len - 1)) {
                            if (false == HandleTimeZone(ref str, ref result))
                            {
                                LexTraceExit("0020 (value like \"12:01\" or \"12:\" followed by a non-TZ number", dps);
                                return false;
                            }
                        }                        
                    }

                    dtok.num = tokenValue;
                    if (tokenType == TokenType.YearNumberToken)
                    {
                        if (raw.year == -1)
                        {
                            raw.year = tokenValue;
                            //
                            // If we have number which has 3 or more digits (like "001" or "0001"),
                            // we assume this number is a year. Save the currnet raw.numCount in
                            // raw.year.
                            //
                            switch (sep = str.GetSeparatorToken(dtfi, out indexBeforeSeparator, out charBeforeSeparator)) {
                                case TokenType.SEP_End:
                                    dtok.dtt     = DTT.YearEnd;
                                    break;
                                case TokenType.SEP_Am:
                                case TokenType.SEP_Pm:
                                    if (raw.timeMark == TM.NotSet) {
                                        raw.timeMark = (sep == TokenType.SEP_Am ? TM.AM : TM.PM);
                                        dtok.dtt    = DTT.YearSpace;
                                    } else {
                                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                                        LexTraceExit("0030 (TM.AM/TM.PM Happened more than 1x)", dps);
                                    }
                                    break;
                                case TokenType.SEP_Space:
                                    dtok.dtt    = DTT.YearSpace;
                                    break;
                                case TokenType.SEP_Date:
                                    dtok.dtt     = DTT.YearDateSep;
                                    break;
                                case TokenType.SEP_Time:
                                    if (!raw.hasSameDateAndTimeSeparators)
                                    {
                                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                                        LexTraceExit("0040 (Invalid separator after number)", dps);
                                        return false;
                                    }

                                    // we have the date and time separators are same and getting a year number, then change the token to YearDateSep as 
                                    // we are sure we are not parsing time.
                                    dtok.dtt = DTT.YearDateSep;
                                    break;
                                case TokenType.SEP_DateOrOffset:
                                    // The separator is either a date separator or the start of a time zone offset. If the token will complete the date then
                                    // process just the number and roll back the index so that the outer loop can attempt to parse the time zone offset.
                                    if ((dateParsingStates[(int)dps][(int) DTT.YearDateSep] == DS.ERROR) 
                                        && (dateParsingStates[(int)dps][(int) DTT.YearSpace] > DS.ERROR)) {
                                        str.Index = indexBeforeSeparator;
                                        str.m_current = charBeforeSeparator;
                                        dtok.dtt = DTT.YearSpace;
                                    }
                                    else {
                                        dtok.dtt = DTT.YearDateSep;
                                    }
                                    break;                                    
                                case TokenType.SEP_YearSuff:
                                case TokenType.SEP_MonthSuff:
                                case TokenType.SEP_DaySuff:
                                    dtok.dtt    = DTT.NumDatesuff;
                                    dtok.suffix = sep;
                                    break;
                                case TokenType.SEP_HourSuff:
                                case TokenType.SEP_MinuteSuff:
                                case TokenType.SEP_SecondSuff:
                                    dtok.dtt    = DTT.NumTimesuff;
                                    dtok.suffix = sep;
                                    break;
                                default:
                                    // Invalid separator after number number.
                                    result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                                    LexTraceExit("0040 (Invalid separator after number)", dps);
                                    return false;
                            }
                            //
                            // Found the token already. Return now.
                            //
                            LexTraceExit("0050 (success)", dps);
                            return true;
                        }
                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                        LexTraceExit("0060", dps);
                        return false;
                    }
                    switch (sep = str.GetSeparatorToken(dtfi, out indexBeforeSeparator, out charBeforeSeparator))
                    {
                        //
                        // Note here we check if the numCount is less than three.
                        // When we have more than three numbers, it will be caught as error in the state machine.
                        //
                        case TokenType.SEP_End:
                            dtok.dtt = DTT.NumEnd;
                            raw.AddNumber(dtok.num);
                            break;
                        case TokenType.SEP_Am:
                        case TokenType.SEP_Pm:
                            if (raw.timeMark == TM.NotSet) {
                                raw.timeMark = (sep == TokenType.SEP_Am ? TM.AM : TM.PM);
                                dtok.dtt = DTT.NumAmpm;
                                // Fix AM/PM parsing case, e.g. "1/10 5 AM"
                                if (dps == DS.D_NN 
#if !FEATURE_CORECLR
                                    && enableAmPmParseAdjustment
#endif
                                )
                                {
                                    if (!ProcessTerminaltState(DS.DX_NN, ref result, ref styles, ref raw, dtfi))
                                    {
                                        return false;
                                    }
                                }

                                raw.AddNumber(dtok.num);
                            } else {
                                result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                                break;
                            }
                            if (dps == DS.T_NNt || dps == DS.T_Nt) {
                                if (false == HandleTimeZone(ref str, ref result))
                                {
                                    LexTraceExit("0070 (HandleTimeZone returned false)", dps);
                                    return false;
                                }
                            }
                            break;
                        case TokenType.SEP_Space:
                            dtok.dtt = DTT.NumSpace;
                            raw.AddNumber(dtok.num);
                            break;
                        case TokenType.SEP_Date:
                            dtok.dtt = DTT.NumDatesep;
                            raw.AddNumber(dtok.num);
                            break;
                        case TokenType.SEP_DateOrOffset:
                            // The separator is either a date separator or the start of a time zone offset. If the token will complete the date then
                            // process just the number and roll back the index so that the outer loop can attempt to parse the time zone offset.
                            if ((dateParsingStates[(int)dps][(int) DTT.NumDatesep] == DS.ERROR) 
                                && (dateParsingStates[(int)dps][(int) DTT.NumSpace] > DS.ERROR)) {
                                str.Index = indexBeforeSeparator;
                                str.m_current = charBeforeSeparator;
                                dtok.dtt = DTT.NumSpace;
                            }
                            else {                                
                                dtok.dtt = DTT.NumDatesep;
                            }
                            raw.AddNumber(dtok.num);
                            break;                            
                        case TokenType.SEP_Time:
                            if (raw.hasSameDateAndTimeSeparators &&
                                (dps == DS.D_Y || dps == DS.D_YN || dps == DS.D_YNd || dps == DS.D_YM || dps == DS.D_YMd))
                            {
                                // we are parsing a date and we have the time separator same as date separator, so we mark the token as date separator
                                dtok.dtt = DTT.NumDatesep;
                                raw.AddNumber(dtok.num);
                                break;
                            }
                            dtok.dtt = DTT.NumTimesep;
                            raw.AddNumber(dtok.num);
                            break;
                        case TokenType.SEP_YearSuff:
                            try {
                                dtok.num = dtfi.Calendar.ToFourDigitYear(tokenValue);
                            }
                            catch (ArgumentOutOfRangeException e) {
                                result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", e);
                                LexTraceExit("0075 (Calendar.ToFourDigitYear failed)", dps);
                                return false;
                            }   
                            dtok.dtt    = DTT.NumDatesuff;
                            dtok.suffix = sep;
                            break;
                        case TokenType.SEP_MonthSuff:
                        case TokenType.SEP_DaySuff:
                            dtok.dtt    = DTT.NumDatesuff;
                            dtok.suffix = sep;
                            break;
                        case TokenType.SEP_HourSuff:
                        case TokenType.SEP_MinuteSuff:
                        case TokenType.SEP_SecondSuff:
                            dtok.dtt    = DTT.NumTimesuff;
                            dtok.suffix = sep;
                            break;
                        case TokenType.SEP_LocalTimeMark:
                            dtok.dtt = DTT.NumLocalTimeMark;
                            raw.AddNumber(dtok.num);
                            break;
                        default:
                            // Invalid separator after number number.
                            result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                            LexTraceExit("0080", dps);
                            return false;
                    }
                    break;
                case TokenType.HebrewNumber:
                    if (tokenValue >= 100) {
                        // This is a year number
                        if (raw.year == -1) {
                            raw.year = tokenValue;
                            //
                            // If we have number which has 3 or more digits (like "001" or "0001"),
                            // we assume this number is a year. Save the currnet raw.numCount in
                            // raw.year.
                            //
                            switch (sep = str.GetSeparatorToken(dtfi, out indexBeforeSeparator, out charBeforeSeparator)) {
                                case TokenType.SEP_End:
                                    dtok.dtt = DTT.YearEnd;
                                    break;
                                case TokenType.SEP_Space:
                                    dtok.dtt = DTT.YearSpace;
                                    break;
                                case TokenType.SEP_DateOrOffset:
                                    // The separator is either a date separator or the start of a time zone offset. If the token will complete the date then
                                    // process just the number and roll back the index so that the outer loop can attempt to parse the time zone offset.
                                    if (dateParsingStates[(int)dps][(int) DTT.YearSpace] > DS.ERROR) {
                                        str.Index = indexBeforeSeparator;
                                        str.m_current = charBeforeSeparator;
                                        dtok.dtt = DTT.YearSpace;
                                        break;
                                    }
                                    goto default;
                                default:
                                    // Invalid separator after number number.
                                    result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                                    LexTraceExit("0090", dps);
                                    return false;
                            }
                        } else {
                            // Invalid separator after number number.
                            result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                            LexTraceExit("0100", dps);
                            return false;
                        }
                    } else {
                        // This is a day number
                        dtok.num = tokenValue;
                        raw.AddNumber(dtok.num);

                        switch (sep = str.GetSeparatorToken(dtfi, out indexBeforeSeparator, out charBeforeSeparator)) {
                            //
                            // Note here we check if the numCount is less than three.
                            // When we have more than three numbers, it will be caught as error in the state machine.
                            //
                            case TokenType.SEP_End:
                                dtok.dtt = DTT.NumEnd;
                                break;
                            case TokenType.SEP_Space:
                            case TokenType.SEP_Date:
                                dtok.dtt = DTT.NumDatesep;
                                break;
                            case TokenType.SEP_DateOrOffset:
                                // The separator is either a date separator or the start of a time zone offset. If the token will complete the date then
                                // process just the number and roll back the index so that the outer loop can attempt to parse the time zone offset.
                                if ((dateParsingStates[(int)dps][(int) DTT.NumDatesep] == DS.ERROR) 
                                    && (dateParsingStates[(int)dps][(int) DTT.NumSpace] > DS.ERROR)) {
                                    str.Index = indexBeforeSeparator;
                                    str.m_current = charBeforeSeparator;
                                    dtok.dtt = DTT.NumSpace;
                                }
                                else {                                
                                    dtok.dtt = DTT.NumDatesep;
                                }
                                break;
                            default:
                                // Invalid separator after number number.
                                result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                                LexTraceExit("0110", dps);
                                return false;
                        }
                    }
                    break;
                case TokenType.DayOfWeekToken:
                    if (raw.dayOfWeek == -1)
                    {
                        //
                        // This is a day of week name.
                        //
                        raw.dayOfWeek = tokenValue;
                        dtok.dtt = DTT.DayOfWeek;
                    } else {
                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                        LexTraceExit("0120 (DayOfWeek seen more than 1x)", dps);
                        return false;
                    }
                    break;
                case TokenType.MonthToken:
                    if (raw.month == -1)
                    {
                        //
                        // This is a month name
                        //
                        switch(sep=str.GetSeparatorToken(dtfi, out indexBeforeSeparator, out charBeforeSeparator))
                        {
                            case TokenType.SEP_End:
                                dtok.dtt = DTT.MonthEnd;
                                break;
                            case TokenType.SEP_Space:
                                dtok.dtt = DTT.MonthSpace;
                                break;
                            case TokenType.SEP_Date:
                                dtok.dtt = DTT.MonthDatesep;
                                break;
                            case TokenType.SEP_Time:
                                if (!raw.hasSameDateAndTimeSeparators)
                                {
                                    result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                                    LexTraceExit("0130 (Invalid separator after month name)", dps);
                                    return false;
                                }

                                // we have the date and time separators are same and getting a Month name, then change the token to MonthDatesep as 
                                // we are sure we are not parsing time.
                                dtok.dtt = DTT.MonthDatesep;
                                break;
                            case TokenType.SEP_DateOrOffset:
                                // The separator is either a date separator or the start of a time zone offset. If the token will complete the date then
                                // process just the number and roll back the index so that the outer loop can attempt to parse the time zone offset.
                                if ((dateParsingStates[(int)dps][(int) DTT.MonthDatesep] == DS.ERROR) 
                                    && (dateParsingStates[(int)dps][(int) DTT.MonthSpace] > DS.ERROR)) {
                                    str.Index = indexBeforeSeparator;
                                    str.m_current = charBeforeSeparator;
                                    dtok.dtt = DTT.MonthSpace;
                                }
                                else {                                
                                    dtok.dtt = DTT.MonthDatesep;
                                }
                                break;
                            default:
                                //Invalid separator after month name
                                result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                                LexTraceExit("0130 (Invalid separator after month name)", dps);
                                return false;
                        }
                        raw.month = tokenValue;
                    }  else {
                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                        LexTraceExit("0140 (MonthToken seen more than 1x)", dps);
                        return false;
                    }
                    break;
                case TokenType.EraToken:
                    if (result.era != -1) {
                        result.era = tokenValue;
                        dtok.dtt = DTT.Era;
                    } else {
                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                        LexTraceExit("0150 (EraToken seen when result.era already set)", dps);
                        return false;
                    }
                    break;
                case TokenType.JapaneseEraToken:
                    // Special case for Japanese.  We allow Japanese era name to be used even if the calendar is not Japanese Calendar.
                    result.calendar = JapaneseCalendar.GetDefaultInstance();
                    dtfi = DateTimeFormatInfo.GetJapaneseCalendarDTFI();
                    if (result.era != -1) {
                        result.era = tokenValue;
                        dtok.dtt = DTT.Era;
                    } else {
                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                        LexTraceExit("0160 (JapaneseEraToken seen when result.era already set)", dps);
                        return false;
                    }
                    break;
                case TokenType.TEraToken:
                    result.calendar = TaiwanCalendar.GetDefaultInstance();
                    dtfi = DateTimeFormatInfo.GetTaiwanCalendarDTFI();
                    if (result.era != -1) {
                        result.era = tokenValue;
                        dtok.dtt = DTT.Era;
                    } else {
                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                        LexTraceExit("0170 (TEraToken seen when result.era already set)", dps);
                        return false;
                    }
                    break;
                case TokenType.TimeZoneToken:
                    //
                    // This is a timezone designator
                    //
                    // NOTENOTE : for now, we only support "GMT" and "Z" (for Zulu time).
                    //
                    if ((result.flags & ParseFlags.TimeZoneUsed) != 0) {
                        // Should not have two timezone offsets.
                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                        LexTraceExit("0180 (seen GMT or Z more than 1x)", dps);
                        return false;
                    }
                    dtok.dtt = DTT.TimeZone;
                    result.flags |= ParseFlags.TimeZoneUsed;
                    result.timeZoneOffset = new TimeSpan(0);
                    result.flags |= ParseFlags.TimeZoneUtc;
                    break;
                case TokenType.EndOfString:
                    dtok.dtt = DTT.End;
                    break;
                case TokenType.DateWordToken:
                case TokenType.IgnorableSymbol:
                    // Date words and ignorable symbols can just be skipped over
                    break;
                case TokenType.Am:
                case TokenType.Pm:
                    if (raw.timeMark == TM.NotSet) {
                        raw.timeMark = (TM)tokenValue;
                    } else {
                        result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                        LexTraceExit("0190 (AM/PM timeMark already set)", dps);
                        return false;
                    }
                    break;
                case TokenType.UnknownToken:
                    if (Char.IsLetter(str.m_current)) {
                        result.SetFailure(ParseFailureKind.FormatWithParameter, "Format_UnknowDateTimeWord",  str.Index);
                        LexTraceExit("0200", dps);
                        return (false);
                    }

#if !FEATURE_CORECLR                    
                    // If DateTimeParseIgnorePunctuation is defined, we want to have the V1.1 behavior of just
                    // ignoring any unrecognized punctuation and moving on to the next character
                    if (Environment.GetCompatibilityFlag(CompatibilityFlag.DateTimeParseIgnorePunctuation) && ((result.flags & ParseFlags.CaptureOffset) == 0)) {
                        str.GetNext();
                        LexTraceExit("0210 (success)", dps);
                        return true;
                    }
#endif // FEATURE_CORECLR
                    
                    if ((str.m_current == '-' || str.m_current == '+') && ((result.flags & ParseFlags.TimeZoneUsed) == 0)) {
                        Int32 originalIndex = str.Index;
                        if (ParseTimeZone(ref str, ref result.timeZoneOffset)) {
                            result.flags |= ParseFlags.TimeZoneUsed;
                            LexTraceExit("0220 (success)", dps);
                            return true;
                        }
                        else {
                            // Time zone parse attempt failed. Fall through to punctuation handling.
                            str.Index = originalIndex;
                        }                                                
                    }
                    
                    // Visual Basic implements string to date conversions on top of DateTime.Parse:
                    //   CDate("#10/10/95#")
                    //
                    if (VerifyValidPunctuation(ref str)) {
                        LexTraceExit("0230 (success)", dps);
                        return true;                                
                    }

                    result.SetFailure(ParseFailureKind.Format, "Format_BadDateTime", null);
                    LexTraceExit("0240", dps);
                    return false;
            }

            LexTraceExit("0250 (success)", dps);
            return true;
        }
 public virtual int Update(DS dataSet) {
     return this.Adapter.Update(dataSet, "Action");
 }
		public static void FormView_Init(Page p)
		{
			Poker fv = new Poker ();
			DS data = new DS ();
			p.Controls.Add (fv);
			p.Controls.Add (data);
			data.TypeName = typeof (DS).AssemblyQualifiedName;
			data.SelectMethod = "GetList";
			data.ID = "Data";
			fv.DataBinding += new EventHandler (data_DataBinding);
			fv.DataSourceID = "Data";
		}
 public virtual int Fill(DS.CombinaisonDataTable dataTable, global::System.Nullable<int> codefait) {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if ((codefait.HasValue == true)) {
         this.Adapter.SelectCommand.Parameters[0].Value = ((int)(codefait.Value));
     }
     else {
         this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     }
     if ((this.ClearBeforeFill == true)) {
         dataTable.Clear();
     }
     int returnValue = this.Adapter.Fill(dataTable);
     return returnValue;
 }