Exemple #1
0
 private void RELIGIONBOX_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         DATE.Focus();
     }
 }
Exemple #2
0
 public override void Dispose()
 {
     if (!base._isDisposed)
     {
         _value = null;
         GC.SuppressFinalize(this);
         base._isDisposed = !base._isDisposed;
     }
 }
Exemple #3
0
        public override bool Equals(object obj)
        {
            var hIVTEST = obj as HIVTEST;

            return(hIVTEST != null &&
                   DATE.IsSameAs(hIVTEST.DATE) &&
                   RESULT.IsSameAs(hIVTEST.RESULT) &&
                   TYPE.IsSameAs(hIVTEST.TYPE) &&
                   FACILITY.IsSameAs(hIVTEST.FACILITY) &&
                   STRATEGY.IsSameAs(hIVTEST.STRATEGY));
        }
Exemple #4
0
        private void InsertData(object sender, EventArgs e)
        {
            if (ScheduleFix)
            {
                if ("".Equals(cboUser.ValueList))
                {
                    ViewMessage.Info("담당자와 내용을 선택해 주시기 바랍니다.");
                }
                else
                {
                    ClearSearchData();
                    SetSearchData("DOC_ID", DOC_ID);
                    SetSearchData("ACCEPT_TM", DATE.ToString("yyyy-MM-dd HH:mm:ss"));
                    SetSearchData("PROC_TM", dtCreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                    SetSearchData("USER_ID_LST", cboUser.ValueList);
                    SetSearchData("CRT_USER_ID", DTOFactory.UserId);
                    SetServiceId("SetScheduleManager");

                    DTOFactory.Transaction(new ReportDTO());

                    ViewMessage.Info("일정 수정을 완료 하였습니다.");

                    DialogResult = DialogResult.OK;
                    Close();
                }
            }
            else
            {
                if ("".Equals(cboUser.ValueList) || "".Equals(cboPlan.ValueList))
                {
                    ViewMessage.Info("담당자와 내용을 선택해 주시기 바랍니다.");
                }
                else
                {
                    ClearSearchData();
                    SetSearchData("DOC_ID", DOC_ID);
                    SetSearchData("ACCEPT_TM", dtCreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                    SetSearchData("USER_ID_LST", cboUser.ValueList);
                    SetSearchData("DESC", cboPlan.ValueList);
                    SetSearchData("CRT_USER_ID", DTOFactory.UserId);
                    SetServiceId("SetScheduleManager");

                    DTOFactory.Transaction(new ReportDTO());

                    ViewMessage.Info("일정 등록을 완료 하였습니다.");

                    DialogResult = DialogResult.OK;
                    Close();
                }
            }
        }
Exemple #5
0
        public void T1()
        {
            #region T1
            var name        = "2018 Summer Promotion";
            var discount    = 0.15M;
            var startDate   = "20180601";
            var expiredDate = "20180901";

            var rows = DbContext.Database.Execute((Promotions promo) => {
                var set = promo.@using((promo.PromotionName, promo.Discount, promo.StartDate, promo.ExpiredDate));
                INSERT().INTO(set);
                VALUES(set.Row((name, discount, DataTypes.DATE.Raw(startDate), DataTypes.DATE.Raw(expiredDate))));
            });

            Console.WriteLine($"{rows} rows affected");
            #endregion
        }
        /// <summary>
        /// record answers from survey filled by guest by incrementing the count of each option selected.
        /// by default, if no option is chosen, the first choice will be recorded.
        /// </summary>
        /// <param name="_surv"></param>
        /// <returns></returns>
        //public bool InsertAnswers(Survey _surv)
        //{
        //    bool Date = Rec_Date(_surv);
        //    bool FirstTimeVisit = Rec_FirstTime(_surv);
        //    bool FoodImpression = Rec_Food(_surv);
        //    bool FutureAttendence = Rec_FutureAttendence(_surv);
        //    bool LocationImpression = Rec_Location(_surv);
        //    bool LongQuiz = Rec_Long_Quiz(_surv);
        //    bool Overall = Rec_Overall_Satisfaction(_surv);
        //    bool recomment = Rec_Recommendation(_surv);
        //    bool isSession = Rec_Session(_surv);

        //    if(Date == true && FirstTimeVisit == true && FoodImpression == true
        //        && FutureAttendence == true && LocationImpression == true
        //        && LongQuiz == true && Overall == true && recomment == true && isSession == true)
        //    {
        //        return true;
        //    }else
        //    {
        //        return false;
        //    }
        //}

        public bool Rec_Date(Survey _surv)
        {
            int surveyID = Convert.ToInt32(_surv.S_ID);

            // int Q_ID = Convert.ToInt32(_surv.ID);
            using (EventrixDBDataContext db = new EventrixDBDataContext())
            {
                try
                {
                    int _query = (from res in db.DATEs
                                  where res.S_Id.Equals(surveyID)
                                  select res).Count();
                    if (_query == 0) //Create New Answer
                    {
                        DATE toinsert = new DATE();
                        toinsert.S_Id = _surv.S_ID;
                        toinsert.Very_Dissatisfied = _surv.veryDissatisfied;
                        toinsert.Dissatisfied      = _surv.Dissatisfied;
                        toinsert.Neutral           = _surv.Neutral;
                        toinsert.Very_Satisfied    = _surv.VerySatisfied;
                        toinsert.Satisfied         = _surv.Satisfied;
                        db.DATEs.InsertOnSubmit(toinsert);
                        db.SubmitChanges();
                        return(true);
                    }
                    else  //Update Record
                    {
                        DATE query = (from res in db.DATEs
                                      where res.S_Id.Equals(surveyID)
                                      select res).First();
                        query.Very_Dissatisfied += _surv.veryDissatisfied;
                        query.Dissatisfied      += _surv.Dissatisfied;
                        query.Neutral           += _surv.Neutral;
                        query.Satisfied         += _surv.Neutral;
                        query.Very_Satisfied    += _surv.VerySatisfied;
                        db.SubmitChanges();
                        return(true);
                    }
                }
                catch (Exception)
                {
                    return(false);
                }
            };
        }
Exemple #7
0
        public static DateTime OleDateDecode(DATE dtSrc)
        {
            tm tmDest = new tm();

            if (!OleDateDecode(dtSrc, ref tmDest, false))
            {
                return(new DateTime(1899, 12, 30));//0
            }
            else if (dtSrc > 0.000001)
            {
                DateTime dtDest = new DateTime(tmDest.tm_year, tmDest.tm_mon, tmDest.tm_mday, tmDest.tm_hour, tmDest.tm_min, tmDest.tm_sec, tmDest.tm_msec);
                return(dtDest);
            }
            else
            {
                DateTime dtDest = DateTime.Now;
                return(dtDest);
            }
        }
Exemple #8
0
        public IHttpActionResult PostDate(DATE data)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                db.DATEs.Add(data);
                db.SaveChanges();
            }
            catch (Exception)
            {
                dynamic User = new ExpandoObject();
                User.Message = "Something went wrong !";
                return(null);
            }

            return(Ok(data));
        }
Exemple #9
0
        public void GetPropertyError(string propertyName, ErrorInfo info)
        {
            //throw new NotImplementedException();
            if (propertyName == "DATE")
            {
                if (string.IsNullOrWhiteSpace(DATE.ToString()))
                {
                    info.ErrorText = string.Format("The {0} field cannot be empty", propertyName);
                }
                else if (!FrmImport.IsDateTime(DATE.ToString()))
                {
                    info.ErrorText = "Invalid Date";
                }
                else if (!FrmImport.CheckDateRange(startDate, endtDate, Convert.ToDateTime(DATE)))
                {
                    info.ErrorText = "Date not within the specified date range";
                }
            }

            if (propertyName == "CREDIT")
            {
                if (!FrmImport.IsNumeric(CREDIT))
                {
                    info.ErrorText = "Credit is not in the right format";
                }
                else if (CREDIT < 0)
                {
                    info.ErrorText = "Credit is negative ";
                }
            }

            //if (propertyName == "DEBIT")
            //{
            //    info.ErrorText = "Debit is not in the right format";
            //}

            //if (propertyName == "BALANCE")
            //{
            //    info.ErrorText = "Balance is not in the right format";
            //}
        }
Exemple #10
0
        public async Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
        {
            oprot.IncrementRecursionDepth();
            try
            {
                var struc = new TStruct("LogicalType");
                await oprot.WriteStructBeginAsync(struc, cancellationToken);

                var field = new TField();
                if (STRING != null && __isset.@STRING)
                {
                    field.Name = "STRING";
                    field.Type = TType.Struct;
                    field.ID   = 1;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await STRING.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (MAP != null && __isset.MAP)
                {
                    field.Name = "MAP";
                    field.Type = TType.Struct;
                    field.ID   = 2;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await MAP.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (LIST != null && __isset.LIST)
                {
                    field.Name = "LIST";
                    field.Type = TType.Struct;
                    field.ID   = 3;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await LIST.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (ENUM != null && __isset.@ENUM)
                {
                    field.Name = "ENUM";
                    field.Type = TType.Struct;
                    field.ID   = 4;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await ENUM.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (DECIMAL != null && __isset.@DECIMAL)
                {
                    field.Name = "DECIMAL";
                    field.Type = TType.Struct;
                    field.ID   = 5;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await DECIMAL.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (DATE != null && __isset.DATE)
                {
                    field.Name = "DATE";
                    field.Type = TType.Struct;
                    field.ID   = 6;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await DATE.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (TIME != null && __isset.TIME)
                {
                    field.Name = "TIME";
                    field.Type = TType.Struct;
                    field.ID   = 7;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await TIME.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (TIMESTAMP != null && __isset.TIMESTAMP)
                {
                    field.Name = "TIMESTAMP";
                    field.Type = TType.Struct;
                    field.ID   = 8;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await TIMESTAMP.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (INTEGER != null && __isset.INTEGER)
                {
                    field.Name = "INTEGER";
                    field.Type = TType.Struct;
                    field.ID   = 10;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await INTEGER.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (UNKNOWN != null && __isset.UNKNOWN)
                {
                    field.Name = "UNKNOWN";
                    field.Type = TType.Struct;
                    field.ID   = 11;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await UNKNOWN.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (JSON != null && __isset.JSON)
                {
                    field.Name = "JSON";
                    field.Type = TType.Struct;
                    field.ID   = 12;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await JSON.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if (BSON != null && __isset.BSON)
                {
                    field.Name = "BSON";
                    field.Type = TType.Struct;
                    field.ID   = 13;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await BSON.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                await oprot.WriteFieldStopAsync(cancellationToken);

                await oprot.WriteStructEndAsync(cancellationToken);
            }
            finally
            {
                oprot.DecrementRecursionDepth();
            }
        }
Exemple #11
0
        public IDATEBuilder Clear()
        {
            _value = base.ResetValue <DATE>();

            return(this);
        }
Exemple #12
0
        static bool OleDateDecode(DATE dtSrc, ref tm tmDest, bool bRoundSecond = true)
        {
            const int    MIN_DATE = -657434, MAX_DATE = 2958465;
            const double HALF_SECOND = 1.0 / 172800.0;

            // The legal range does not actually span year 0 to 9999.
            if (dtSrc > MAX_DATE || dtSrc < MIN_DATE) // about year 100 to about 9999
            {
                return(false);
            }
            int[] _afxMonthDays = new int[13] {
                0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365
            };
            int nDays;              // Number of days since Dec. 30, 1899
            int nDaysAbsolute;      // Number of days since 1/1/0
            int nSecsInDay;         // Time in seconds since midnight
            int nMinutesInDay;      // Minutes in day

            int n400Years;          // Number of 400 year increments since 1/1/0
            int n400Century;        // Century within 400 year block (0,1,2 or 3)
            int n4Years;            // Number of 4 year increments since 1/1/0
            int n4Day;              // Day within 4 year block
            //  (0 is 1/1/yr1, 1460 is 12/31/yr4)
            int  n4Yr;              // Year within 4 year block (0,1,2 or 3)
            bool bLeap4 = true;     // TRUE if 4 year block includes leap year

            double dblDate = dtSrc; // tempory serial date

            // If a valid date, then this conversion should not overflow
            nDays = (int)dblDate;

            // Round to the second
            if (bRoundSecond)
            {
                dblDate += ((dtSrc > 0.0) ? HALF_SECOND : -HALF_SECOND);
            }

            nDaysAbsolute = (int)dblDate + 693959; // Add days from 1/1/0 to 12/30/1899

            dblDate = Math.Abs(dblDate);
            int nMSecsInDay = (int)((dblDate - Math.Floor(dblDate)) * 86400000);

            nSecsInDay     = nMSecsInDay / 1000;
            nMSecsInDay    = nMSecsInDay % 1000;
            tmDest.tm_msec = nMSecsInDay;

            // Calculate the day of week (sun=1, mon=2...)
            //   -1 because 1/1/0 is Sat.  +1 because we want 1-based
            tmDest.tm_wday = (int)((nDaysAbsolute - 1) % 7L) + 1;

            // Leap years every 4 yrs except centuries not multiples of 400.
            n400Years = (int)(nDaysAbsolute / 146097L);

            // Set nDaysAbsolute to day within 400-year block
            nDaysAbsolute %= 146097;

            // -1 because first century has extra day
            n400Century = (int)((nDaysAbsolute - 1) / 36524);

            // Non-leap century
            if (n400Century != 0)
            {
                // Set nDaysAbsolute to day within century
                nDaysAbsolute = (nDaysAbsolute - 1) % 36524;

                // +1 because 1st 4 year increment has 1460 days
                n4Years = (int)((nDaysAbsolute + 1) / 1461);

                if (n4Years != 0)
                {
                    n4Day = (int)((nDaysAbsolute + 1) % 1461);
                }
                else
                {
                    bLeap4 = false;
                    n4Day  = (int)nDaysAbsolute;
                }
            }
            else
            {
                // Leap century - not special case!
                n4Years = (int)(nDaysAbsolute / 1461L);
                n4Day   = (int)(nDaysAbsolute % 1461L);
            }

            if (bLeap4)
            {
                // -1 because first year has 366 days
                n4Yr = (n4Day - 1) / 365;

                if (n4Yr != 0)
                {
                    n4Day = (n4Day - 1) % 365;
                }
            }
            else
            {
                n4Yr   = n4Day / 365;
                n4Day %= 365;
            }

            // n4Day is now 0-based day of year. Save 1-based day of year, year number
            tmDest.tm_yday = (int)n4Day + 1;
            tmDest.tm_year = n400Years * 400 + n400Century * 100 + n4Years * 4 + n4Yr;

            // Handle leap year: before, on, and after Feb. 29.
            if (n4Yr == 0 && bLeap4)
            {
                // Leap Year
                if (n4Day == 59)
                {
                    /* Feb. 29 */
                    tmDest.tm_mon  = 2;
                    tmDest.tm_mday = 29;
                    goto DoTime;
                }

                // Pretend it's not a leap year for month/day comp.
                if (n4Day >= 60)
                {
                    --n4Day;
                }
            }

            // Make n4DaY a 1-based day of non-leap year and compute
            //  month/day for everything but Feb. 29.
            ++n4Day;

            // Month number always >= n/32, so save some loop time */
            for (tmDest.tm_mon = (n4Day >> 5) + 1;
                 n4Day > _afxMonthDays[tmDest.tm_mon]; tmDest.tm_mon++)
            {
                ;
            }

            tmDest.tm_mday = (int)(n4Day - _afxMonthDays[tmDest.tm_mon - 1]);

DoTime:
            if (nSecsInDay == 0)
            {
                tmDest.tm_hour = tmDest.tm_min = tmDest.tm_sec = 0;
            }
            else
            {
                tmDest.tm_sec  = (int)nSecsInDay % 60;
                nMinutesInDay  = nSecsInDay / 60;
                tmDest.tm_min  = (int)nMinutesInDay % 60;
                tmDest.tm_hour = (int)nMinutesInDay / 60;
            }
            return(true);
        }
Exemple #13
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome To The Console");
            Console.WriteLine("Please use the options below");

            Console.WriteLine("Enter 1 for GetAverage");
            Console.WriteLine("Enter 2 for GetFibonacciSeries");
            Console.WriteLine("Enter 3 for Currency Converter");
            Console.WriteLine("Enter 4 for The Chase Assessment Solution Problem");
            Console.WriteLine("Enter 5 for Character Counter");

            string action = Console.ReadLine();

            if (action == "1")
            {
                Console.WriteLine("How many numbers will you be providing ?");
                string numberOfItems = Console.ReadLine();
                int.TryParse(numberOfItems, out int numItems);
                List <float> averageList = new List <float>();

                for (int i = 1; i <= numItems; i++)
                {
                    Console.WriteLine("Please enter number " + i);
                    string currentNumber = Console.ReadLine();
                    float.TryParse(currentNumber, out float currentNum);
                    averageList.Add(currentNum);
                }

                try
                {
                    DATE   timer   = new DATE();
                    string average = Numbers.GetAverage(averageList);
                    Console.WriteLine("Calculated Average is " + average);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    //Console.WriteLine("Enter 3 Numbers");
                }
            }

            if (action == "2")
            {
                Console.WriteLine("Please enter the number of elements in the sequence");
                string numberOfItems = Console.ReadLine();
                int.TryParse(numberOfItems, out int numItems);
                if (numItems <= 0)
                {
                    Console.WriteLine("Please enter a number greater than 0");
                }

                if (numItems > 0)
                {
                    List <int> series       = Numbers.GetFibonacciSeries(numItems);
                    string     seriesString = "";

                    //Build String from List
                    for (int i = 0; i < series.Count; i++)
                    {
                        seriesString += series[i];

                        if (i <= (series.Count - 2))
                        {
                            seriesString += ", ";
                        }

                        if (i == (series.Count - 1))
                        {
                            seriesString += ".";
                        }
                    }

                    Console.WriteLine("================== RESULT =======================");
                    Console.WriteLine();
                    Console.WriteLine(seriesString);
                    Console.WriteLine();
                    Console.WriteLine("==================== END ========================");
                }
            }

            if (action == "3")
            {
                Console.WriteLine("Press 1 to enter Dollar amount");
                Console.WriteLine("Press 2 to enter Naira amount");
                string currencyOption = Console.ReadLine();
                string currency       = "Naira";
                string nairaSign      = "N";
                string dollarSign     = "$";

                if (currencyOption == "1")
                {
                    currency = "Dollar";
                }

                Console.WriteLine("Enter " + currency + " amount");
                string amountSupplied = Console.ReadLine();
                float.TryParse(amountSupplied, out float amount);
                float result = Numbers.CurrencyConverter(currency, amount);

                Console.WriteLine();
                Console.WriteLine("================== RESULT =======================");
                Console.WriteLine();
                Console.WriteLine("Rate used N460 to $1");
                if (currencyOption == "1")
                {
                    Console.WriteLine(dollarSign + amount.ToString("#,##0") + " is " + nairaSign + result.ToString("#,##0.00") + " in Naira");
                }
                else
                {
                    Console.WriteLine(nairaSign + amount.ToString("#,##0") + " is " + dollarSign + result.ToString("#,##0.00") + " in Dollars");
                }
                Console.WriteLine();
                Console.WriteLine("==================== END ========================");
            }

            if (action == "4")
            {
                //Assessment Problem
                Console.WriteLine("Welcome To The AlgoSection.");
                Console.WriteLine("I Accept a list of numbers in this format { 2,3,4,5,6 ; 7,8,9,3,2 }");
                Console.WriteLine("Returns a sorted array with odd numbers first");
                Console.WriteLine("Please enter the numbers");
                string   inputString      = Console.ReadLine();
                string[] inputStringArray = inputString.Split(";");

                List <int> outputArrayEven = new List <int>();
                List <int> outputArrayOdd  = new List <int>();
                string[]   oneArray        = inputStringArray[0].Split(",");
                string[]   twoArray        = inputStringArray[1].Split(",");

                foreach (var item in oneArray)
                {
                    int.TryParse(item.ToString(), out int itemInt);
                    if (itemInt % 2 == 0)
                    {
                        outputArrayEven.Add(itemInt);
                    }
                    else
                    {
                        outputArrayOdd.Add(itemInt);
                    }
                }

                foreach (var item in twoArray)
                {
                    int.TryParse(item.ToString(), out int itemInt);
                    if (itemInt % 2 == 0)
                    {
                        outputArrayEven.Add(itemInt);
                    }
                    else
                    {
                        outputArrayOdd.Add(itemInt);
                    }
                }
                outputArrayEven.Sort();
                outputArrayOdd.Sort();

                outputArrayOdd.AddRange(outputArrayEven);
                Console.WriteLine(string.Join(",", outputArrayOdd));
            }

            if (action == "5")
            {
                Console.WriteLine("Welcome To Character Count.");
                Console.WriteLine("Please Enter a String");
                string inputString = Console.ReadLine();
                Dictionary <char, int> characterCount = new Dictionary <char, int>();
                foreach (var character in inputString)
                {
                    if (character != ' ')
                    {
                        if (!characterCount.ContainsKey(character))
                        {
                            characterCount.Add(character, 1);
                        }
                        else
                        {
                            characterCount[character]++;
                        }
                    }
                }

                characterCount.ToList().ForEach(x => Console.WriteLine(x.Key));
            }
        }
Exemple #14
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("LogicalType");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (STRING != null && __isset.@STRING)
         {
             field.Name = "STRING";
             field.Type = TType.Struct;
             field.ID   = 1;
             oprot.WriteFieldBegin(field);
             STRING.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (MAP != null && __isset.MAP)
         {
             field.Name = "MAP";
             field.Type = TType.Struct;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             MAP.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (LIST != null && __isset.LIST)
         {
             field.Name = "LIST";
             field.Type = TType.Struct;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             LIST.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (ENUM != null && __isset.@ENUM)
         {
             field.Name = "ENUM";
             field.Type = TType.Struct;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             ENUM.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (DECIMAL != null && __isset.@DECIMAL)
         {
             field.Name = "DECIMAL";
             field.Type = TType.Struct;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             DECIMAL.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (DATE != null && __isset.DATE)
         {
             field.Name = "DATE";
             field.Type = TType.Struct;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             DATE.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (TIME != null && __isset.TIME)
         {
             field.Name = "TIME";
             field.Type = TType.Struct;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             TIME.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (TIMESTAMP != null && __isset.TIMESTAMP)
         {
             field.Name = "TIMESTAMP";
             field.Type = TType.Struct;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             TIMESTAMP.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (INTEGER != null && __isset.INTEGER)
         {
             field.Name = "INTEGER";
             field.Type = TType.Struct;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             INTEGER.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (UNKNOWN != null && __isset.UNKNOWN)
         {
             field.Name = "UNKNOWN";
             field.Type = TType.Struct;
             field.ID   = 11;
             oprot.WriteFieldBegin(field);
             UNKNOWN.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (JSON != null && __isset.JSON)
         {
             field.Name = "JSON";
             field.Type = TType.Struct;
             field.ID   = 12;
             oprot.WriteFieldBegin(field);
             JSON.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (BSON != null && __isset.BSON)
         {
             field.Name = "BSON";
             field.Type = TType.Struct;
             field.ID   = 13;
             oprot.WriteFieldBegin(field);
             BSON.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (UUID != null && __isset.UUID)
         {
             field.Name = "UUID";
             field.Type = TType.Struct;
             field.ID   = 14;
             oprot.WriteFieldBegin(field);
             UUID.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
Exemple #15
0
        public override string ToString()
        {
            StringBuilder __sb    = new StringBuilder("LogicalType(");
            bool          __first = true;

            if (STRING != null && __isset.@STRING)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("STRING: ");
                __sb.Append(STRING == null ? "<null>" : STRING.ToString());
            }
            if (MAP != null && __isset.MAP)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("MAP: ");
                __sb.Append(MAP == null ? "<null>" : MAP.ToString());
            }
            if (LIST != null && __isset.LIST)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("LIST: ");
                __sb.Append(LIST == null ? "<null>" : LIST.ToString());
            }
            if (ENUM != null && __isset.@ENUM)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("ENUM: ");
                __sb.Append(ENUM == null ? "<null>" : ENUM.ToString());
            }
            if (DECIMAL != null && __isset.@DECIMAL)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("DECIMAL: ");
                __sb.Append(DECIMAL == null ? "<null>" : DECIMAL.ToString());
            }
            if (DATE != null && __isset.DATE)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("DATE: ");
                __sb.Append(DATE == null ? "<null>" : DATE.ToString());
            }
            if (TIME != null && __isset.TIME)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("TIME: ");
                __sb.Append(TIME == null ? "<null>" : TIME.ToString());
            }
            if (TIMESTAMP != null && __isset.TIMESTAMP)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("TIMESTAMP: ");
                __sb.Append(TIMESTAMP == null ? "<null>" : TIMESTAMP.ToString());
            }
            if (INTEGER != null && __isset.INTEGER)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("INTEGER: ");
                __sb.Append(INTEGER == null ? "<null>" : INTEGER.ToString());
            }
            if (UNKNOWN != null && __isset.UNKNOWN)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("UNKNOWN: ");
                __sb.Append(UNKNOWN == null ? "<null>" : UNKNOWN.ToString());
            }
            if (JSON != null && __isset.JSON)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("JSON: ");
                __sb.Append(JSON == null ? "<null>" : JSON.ToString());
            }
            if (BSON != null && __isset.BSON)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("BSON: ");
                __sb.Append(BSON == null ? "<null>" : BSON.ToString());
            }
            if (UUID != null && __isset.UUID)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("UUID: ");
                __sb.Append(UUID == null ? "<null>" : UUID.ToString());
            }
            __sb.Append(")");
            return(__sb.ToString());
        }
Exemple #16
0
        public static Record FromDatarow(DataRow dr)
        {
            var rec = new Record();
            var i   = -1;

            rec.Id = (int)dr[++i];

            var date = new DATE((DateTime)dr[++i]);

            rec.Date = date;

            var frame = new double[6];
            var axis  = new double[6];

            frame[0] = (double)dr[++i];
            frame[1] = (double)dr[++i];
            frame[2] = (double)dr[++i];
            frame[3] = (double)dr[++i];
            frame[4] = (double)dr[++i];
            frame[5] = (double)dr[++i];

            axis[0] = (double)dr[++i];
            axis[1] = (double)dr[++i];
            axis[2] = (double)dr[++i];
            axis[3] = (double)dr[++i];
            axis[4] = (double)dr[++i];
            axis[5] = (double)dr[++i];

            var s = (int)dr[++i];
            var t = (int)dr[++i];

            rec.POS_ACT = new E6POS(frame, axis, s, t);

            frame[0] = (double)dr[++i];
            frame[1] = (double)dr[++i];
            frame[2] = (double)dr[++i];
            frame[3] = (double)dr[++i];
            frame[4] = (double)dr[++i];
            frame[5] = (double)dr[++i];

            axis[0] = (double)dr[++i];
            axis[1] = (double)dr[++i];
            axis[2] = (double)dr[++i];
            axis[3] = (double)dr[++i];
            axis[4] = (double)dr[++i];
            axis[5] = (double)dr[++i];

            rec.AXIS_ACT = new E6AXIS(frame, axis);

            frame[0] = (double)dr[++i];
            frame[1] = (double)dr[++i];
            frame[2] = (double)dr[++i];
            frame[3] = (double)dr[++i];
            frame[4] = (double)dr[++i];
            frame[5] = (double)dr[++i];

            rec.BASE = new FRAME(frame);

            frame[0] = (double)dr[++i];
            frame[1] = (double)dr[++i];
            frame[2] = (double)dr[++i];
            frame[3] = (double)dr[++i];
            frame[4] = (double)dr[++i];
            frame[5] = (double)dr[++i];

            rec.TOOL = new FRAME(frame);

            return(rec);
        }
Exemple #17
0
 public static extern bool EnumDateFormats(DATEFMT_ENUMPROC lpDateFmtEnumProc, uint Locale, DATE dwFlags);
Exemple #18
0
        public dynamic GetDate()
        {
            db.Configuration.ProxyCreationEnabled = false;
            try
            {
                DateTime startOfWeek = DateTime.Today.AddDays(
                    (int)CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek -
                    (int)DateTime.Today.DayOfWeek);

                string result = string.Join(",",Enumerable
                                            .Range(7,7)
                                            .Select(i => startOfWeek
                                                    .AddDays(i)
                                                    .ToString("d MMMM")));


                var dates    = db.DATEs.ToList();
                var selected = (from pd in dates
                                join od in result.Split(',').ToList() on pd.DATEDESCRIPTION equals od.ToString()

                                select new
                {
                    DATEDESCRIPTION = pd.DATEDESCRIPTION,
                    DATEID = pd.DATEID,
                }).ToList();

                List <DATE> date = new List <DATE>();
                foreach (var xx in selected)
                {
                    var fulldate = Convert.ToDateTime(xx.DATEDESCRIPTION + " " + DateTime.Today.Year).ToString("yyyy-MM-dd");
                    if (Convert.ToDateTime(fulldate) > DateTime.Today)
                    {
                        DATE day = new DATE();
                        day.DATEDESCRIPTION = xx.DATEDESCRIPTION;
                        day.DATEID          = xx.DATEID;
                        date.Add(day);
                    }
                }


                //List<DATE> dates = new List<DATE>();
                //List<DATE> da = result.Split(',').ToList();
                //foreach (var x in result.ToList())

                //{
                //    DATE date = new DATE();

                //    date.DATEDESCRIPTION=db.DATEs.Where(jj=>jj.DATEDESCRIPTION==x)
                //    dates.Add(date);

                //}


                //            var query = db.DATEs
                //.Where(item => item.DATEDESCRIPTION.Any(j => dates.Contains(j.ToString())));

                return(date);
            }
            catch (Exception)
            {
                dynamic User = new ExpandoObject();
                User.Message = "Something went wrong !";
                return(null);
            }
        }
Exemple #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TIMESTAMP"/> structure with an <see
 /// cref="IDATE"/> instance.
 /// </summary>
 /// <param name="other">The <see cref="IDATE"/> instance that initializes this instance.</param>
 public TIMESTAMP(DATE other) : this(other.FULLYEAR, other.MONTH, other.MDAY, 0, 0, 0)
 {
 }
Exemple #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DATE_TIME"/> structure with an <see
 /// cref="IDATE"/> instance.
 /// </summary>
 /// <param name="other">The <see cref="IDATE"/> instance that initializes this instance.</param>
 public DATE_TIME(DATE other) : this(other.FULLYEAR, other.MONTH, other.MDAY, 0, 0, 0)
 {
 }
Exemple #21
0
 public Stack(string name, string organization) : this()
 {
     owner = new Owner(name, organization);
     date  = new DATE();
 }
Exemple #22
0
        public AdsErrorCode ReadAny(uint indexGroup, uint indexOffset, Type type, bool throwAdsException, out object value)
        {
            AdsErrorCode code;

            if (!type.IsPrimitive)
            {
                if (type == typeof(string))
                {
                    throw new ArgumentException("Use overload ReadAnyString(uint indexGroup, uint indexOffset,  Type type, int characters) for strings.", "type");
                }
                if (type.IsArray)
                {
                    throw new ArgumentException("Use overload ReadAny(uint indexGroup, uint indexOffset,  Type type, int[] args) for arrays.", "type");
                }
                if (type == typeof(TimeSpan))
                {
                    uint milliseconds = base.ReadUInt32(indexGroup, indexOffset, throwAdsException, out code);
                    value = PlcOpenTimeConverter.MillisecondsToTimeSpan(milliseconds);
                }
                else if (type == typeof(DateTime))
                {
                    uint dateValue = base.ReadUInt32(indexGroup, indexOffset, throwAdsException, out code);
                    value = PlcOpenDateConverterBase.ToDateTime(dateValue);
                }
                else if (type == typeof(TIME))
                {
                    uint timeValue = base.ReadUInt32(indexGroup, indexOffset, throwAdsException, out code);
                    value = new TIME(timeValue);
                }
                else if (type == typeof(LTIME))
                {
                    ulong timeValue = base.ReadUInt64(indexGroup, indexOffset, throwAdsException, out code);
                    value = new LTIME(timeValue);
                }
                else if (type == typeof(TOD))
                {
                    uint time = base.ReadUInt32(indexGroup, indexOffset, throwAdsException, out code);
                    value = new TOD(time);
                }
                else if (type == typeof(DATE))
                {
                    uint dateValue = base.ReadUInt32(indexGroup, indexOffset, throwAdsException, out code);
                    value = new DATE(dateValue);
                }
                else if (type != typeof(DT))
                {
                    value = base.ReadStruct(indexGroup, indexOffset, type, throwAdsException, out code);
                }
                else
                {
                    uint dateValue = base.ReadUInt32(indexGroup, indexOffset, throwAdsException, out code);
                    value = new DT(dateValue);
                }
            }
            else if (type == typeof(bool))
            {
                value = base.ReadBoolean(indexGroup, indexOffset, throwAdsException, out code);
            }
            else if (type == typeof(int))
            {
                value = base.ReadInt32(indexGroup, indexOffset, throwAdsException, out code);
            }
            else if (type == typeof(short))
            {
                value = base.ReadInt16(indexGroup, indexOffset, throwAdsException, out code);
            }
            else if (type == typeof(byte))
            {
                value = base.ReadUInt8(indexGroup, indexOffset, throwAdsException, out code);
            }
            else if (type == typeof(float))
            {
                value = base.ReadReal32(indexGroup, indexOffset, throwAdsException, out code);
            }
            else if (type == typeof(double))
            {
                value = base.ReadReal64(indexGroup, indexOffset, throwAdsException, out code);
            }
            else if (type == typeof(long))
            {
                value = base.ReadInt64(indexGroup, indexOffset, throwAdsException, out code);
            }
            else if (type == typeof(uint))
            {
                value = base.ReadUInt32(indexGroup, indexOffset, throwAdsException, out code);
            }
            else if (type == typeof(ushort))
            {
                value = base.ReadUInt16(indexGroup, indexOffset, throwAdsException, out code);
            }
            else if (type == typeof(ulong))
            {
                value = base.ReadUInt64(indexGroup, indexOffset, throwAdsException, out code);
            }
            else
            {
                if (type != typeof(sbyte))
                {
                    throw new ArgumentException("Unable to marshal type.", "type");
                }
                value = base.ReadInt8(indexGroup, indexOffset, throwAdsException, out code);
            }
            return(code);
        }
Exemple #23
0
 public static extern int GetDateFormat(
     uint Locale, DATE dwFlags, [In] IntPtr lpDate, [In] [MarshalAs(UnmanagedType.LPTStr)] string lpFormat,
     [Out] [MarshalAs(UnmanagedType.LPTStr)] StringBuilder lpDateStr, int cchDate);
Exemple #24
0
 public string OutString(Doct_shedule ds)
 {
     return(ds.DCODE + ";" + ds.CHAIR + ";" + DATE.ToString("yyyy-MM-dd HH:mm:ss.fff") + ";" + ST_HOUR + ";" + ST_MIN + ";" + END_HOUR + ";" + END_MIN + ";" + INTERVAL + ";" + ds.FILID);
 }