Example #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            //Cursor = Cursors.WaitCursor;
            //this.richTextBox1.Text += "Send 'TimeZone' command.\n";
            //SignInfo sign = ControlService.SignCombo.Current;
            //sign = ControlService.SignCombo.Current;
            TimeZoneSet timeZone = new TimeZoneSet();

            timeZone.Mode     = 0;
            timeZone.Location = "US/Aleutian";

            ////Send set timezone command
            //sign.Controller.SendAsync(
            //    Commands.TimeZone,
            //    p =>
            //    {
            //        Cursor = Cursors.Default;
            //        if (p.IsSuccessed)
            //        {
            //            this.richTextBox1.Text += "Time Zone Successfully Changed.\n";

            //        }
            //        else
            //        {
            //            this.richTextBox1.Text+="Time Zone was not changed.Please try again.";
            //        }
            //    },
            //    timeZone);

            ExecuteCommand(Commands.TimeZone, timeZone);
        }
Example #2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            sign   = ControlService.SignCombo.Current;
            TimeZoneSet timeZone = new TimeZoneSet();

            timeZone.Mode     = 0;
            timeZone.Location = ddlTimeZoneType.Text.ToString();

            //Send set timezone command
            sign.Controller.SendAsync(
                Commands.TimeZone,
                p =>
            {
                Cursor = Cursors.Default;
                if (p.IsSuccessed)
                {
                    MsgBox.Information(Resources.Resource.GetString(Resources.Resource.Strings.SetTimeZoneSuccessed));    //"Time Zone Successfully Changed.");
                    Close();
                }
                else
                {
                    MsgBox.Error(Resources.Resource.GetString(Resources.Resource.Strings.SetTimeZoneFailed));    //"Time Zone was not changed.Please try again.");
                }
            },
                timeZone);
        }
Example #3
0
        /// <summary>
        ///     Returns a date-time using time-zone via TimeZoneSet
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="timeZone">Timezone set</param>
        /// <param name="dt"></param>
        /// <param name="formatType">
        ///     switch (type) {
        ///     case DateTimeFormatType.Date:
        ///     format = "dd-MMM-yyyy";
        ///     break;
        ///     case DateTimeFormatType.DateTimeSimple:
        ///     format = "dd-MMM-yyyy hh:mm:ss tt";
        ///     break;
        ///     case DateTimeFormatType.DateTimeFull:
        ///     format = "MMMM dd, yyyy hh:mm:ss tt";
        ///     break;
        ///     case DateTimeFormatType.DateTimeShort:
        ///     format = "d-MMM-yy hh:mm:ss tt";
        ///     break;
        ///     case DateTimeFormatType.Time:
        ///     format = "hh:mm:ss tt";
        ///     break;
        ///     default:
        ///     format = "dd-MMM-yyyy";
        ///     break;
        ///     }
        /// </param>
        /// <param name="customFormat">If anything passed then this format will be used.</param>
        /// <param name="addTimeZoneString">Add timezone string with Date. Eg. 26-Aug-2015 (GMT -07:00)</param>
        /// <returns>Returns a data-time using given format and timezone</returns>
        public static string DisplayDateTime(
            this HtmlHelper helper,
            TimeZoneSet timeZone,
            DateTime?dt = null,
            DateTimeFormatType formatType = DateTimeFormatType.Date,
            string customFormat           = null,
            bool addTimeZoneString        = false)
        {
            var format = GetDefaultTimeZoneFormat(formatType, customFormat);

            return(Zone.GetDateTime(timeZone, dt, format, addTimeZoneString));
        }
Example #4
0
        private void Init()
        {
            sign = ControlService.SignCombo.Current;
            TimeZoneSet timeZone = new TimeZoneSet();

            timeZone.Mode     = 1;
            timeZone.Location = "";
            //Send get timezone state command form UFE
            sign.Controller.SendAsync(
                Commands.TimeZone,
                p =>
            {
                Cursor = Cursors.Default;
                if (p.IsSuccessed)
                {
                    ddlTimeZoneType.Text = p.Packet.Content.GetProperty <string>("Location");
                }
            },
                timeZone);
        }