Beispiel #1
0
        /// <summary>
        ///     Draws a <see cref="MenuSlider" />
        /// </summary>
        public override void Draw()
        {
            var position  = this.Component.Position;
            var centeredY =
                (int)
                BlueUtilities.GetContainerRectangle(this.Component)
                .GetCenteredText(null, MenuSettings.Font, this.Component.DisplayName, CenteredFlags.VerticalCenter)
                .Y;
            var percent = (this.Component.Value - this.Component.MinValue)
                          / (float)(this.Component.MaxValue - this.Component.MinValue);
            var x = position.X + Offset + (percent * (this.Component.MenuWidth - Offset * 2));

            Line.Width = 3;
            Line.Begin();
            Line.Draw(
                new[] { new Vector2(x, position.Y + 1), new Vector2(x, position.Y + MenuSettings.ContainerHeight) },
                this.Component.Interacting ? new ColorBGRA(90, 129, 144, 255) : new ColorBGRA(0, 74, 103, 255));
            Line.End();

            MenuSettings.Font.DrawText(
                MenuManager.Instance.Sprite,
                MultiLanguage.Translation(this.Component.DisplayName),
                (int)(position.X + MenuSettings.ContainerTextOffset),
                centeredY,
                MenuSettings.TextColor);

            var measureText = MenuSettings.Font.MeasureText(
                null,
                this.Component.Value.ToString(CultureInfo.InvariantCulture),
                0);

            MenuSettings.Font.DrawText(
                MenuManager.Instance.Sprite,
                MultiLanguage.Translation(this.Component.Value.ToString(CultureInfo.InvariantCulture)),
                (int)(position.X + this.Component.MenuWidth - 5 - measureText.Width),
                centeredY,
                MenuSettings.TextColor);

            Line.Width = MenuSettings.ContainerHeight;
            Line.Begin();
            Line.Draw(
                new[]
            {
                new Vector2(position.X + Offset, position.Y + MenuSettings.ContainerHeight / 2f),
                new Vector2(x, position.Y + MenuSettings.ContainerHeight / 2f)
            },
                new ColorBGRA(0, 37, 53, 255));
            Line.End();
        }
Beispiel #2
0
 private void OnChangePassword(dynamic result)
 {
     if (result["Result"].ToObject <bool>())
     {
         SkinHelper.ShowMessage(MultiLanguage.GetString("strPasswordChanged"), @"Project Celeste -- Change Password",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         var str = result["Message"].ToObject <string>();
         SkinHelper.ShowMessage($@"Error: {str}", @"Project Celeste -- Change Password",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     _changePasswordDone = true;
 }
        private void Frm_Paradigital2_Load(object sender, EventArgs e)
        {
            xml_load();

            foreach (Control ctrl in this.Controls)
            {
                if (ctrl is Parashownew)
                {
                    Parashownew ctr2 = ctrl as Parashownew;
                    ctr2.timer1.Enabled = true;
                }
            }
            //语言切换
            MultiLanguage.LoadLanguage(Application.OpenForms["Frm_Paradigital2"], Form_Main.lan);
        }
Beispiel #4
0
        private void Validar(Framework.Models.Rol rol)
        {
            var mensaje = "";

            if (rol.Descripcion == "")
            {
                mensaje += MultiLanguage.GetTranslate(_seccion, "lblDescripcion") + ": ";
                mensaje += MultiLanguage.GetTranslate("errorVacioString");
            }

            if (mensaje != "")
            {
                throw new Exception(mensaje);
            }
        }
Beispiel #5
0
 void Message()
 {
     if (MultiLanguage.GetCurrentLanguage() == "EN" && Constants.IsVoiceEnabled)
     {
         TVMUtility.PlayVoice(3, null, null, "EN");
     }
     if (MultiLanguage.GetCurrentLanguage() == "ML" && Constants.IsVoiceEnabled)
     {
         TVMUtility.PlayVoice(3, null, null, "ML");
     }
     if (MultiLanguage.GetCurrentLanguage() == "IN" && Constants.IsVoiceEnabled)
     {
         TVMUtility.PlayVoice(3, null, null, "IN");
     }
 }
        //修改的内容
        public string ChackMenu(bool isRootMenu, string displayName)
        {
            if (isRootMenu)
            {
                displayName = "【FrozenGJ】" + MultiLanguage.Translation(displayName);
            }
            else
            {
                displayName = MultiLanguage.Translation(displayName);
            }

            displayName = displayName.Replace("娛樂漢化:", "")
                          .Replace("[Chaos|VIP系列]:", "");
            return(displayName);
        }
Beispiel #7
0
        private void SetLanguage()
        {
            tituloPrincipal.InnerHtml = MultiLanguage.GetTranslate(_seccion, "tituloPrincipal");

            btnCancelar.InnerHtml    = MultiLanguage.GetTranslate("btnCancelar");
            btnGuardar.InnerHtml     = MultiLanguage.GetTranslate("btnGuardar");
            lblGuardarName.InnerHtml = MultiLanguage.GetTranslate("btnGuardar");
            lblFiltrar.InnerHtml     = MultiLanguage.GetTranslate("lblFiltrar");
            lblCliente.InnerHtml     = MultiLanguage.GetTranslate(_seccion, "lblCliente");
            lblChatbotName.InnerHtml = MultiLanguage.GetTranslate(_seccion, "lblChatbotName");
            lblAyuda.InnerHtml       = MultiLanguage.GetTranslate(_seccion, "lblAyuda").Replace("{0}", "<kbd><kbd>ctrl</kbd> + <kbd>C</kbd></kbd>").Replace("{1}", "<kbd><kbd>ctrl</kbd> + <kbd>V</kbd></kbd>");

            lblRespuesta.InnerHtml = MultiLanguage.GetTranslate(_seccion, "lblRespuesta");
            lblFrase.InnerHtml     = MultiLanguage.GetTranslate(_seccion, "lblFrase");
        }
Beispiel #8
0
 void Message()
 {
     if (MultiLanguage.GetCurrentLanguage() == "EN" && Constants.IsVoiceEnabled)
     {
         TVMUtility.PlayVoice(6, null, Convert.ToString(Convert.ToInt16(Ticket.totalPrice)), "EN");
     }
     if (MultiLanguage.GetCurrentLanguage() == "ML" && Constants.IsVoiceEnabled)
     {
         TVMUtility.PlayVoice(6, null, Convert.ToString(Convert.ToInt16(Ticket.totalPrice)), "ML");
     }
     if (MultiLanguage.GetCurrentLanguage() == "IN" && Constants.IsVoiceEnabled)
     {
         TVMUtility.PlayVoice(6, null, Convert.ToString(Convert.ToInt16(Ticket.totalPrice)), "IN");
     }
 }
Beispiel #9
0
        public void InitLang()
        {
            //语言设置
            //设置提醒字符串
            Constant.InitStr(this);

            evokWork.ShiftDgvParamLang(dgvParam, MultiLanguage.getLangId(), Constant.ParamPage);
            evokWork.ShiftDgvParamLang(dgvIO, MultiLanguage.getLangId(), Constant.IOPage);

            evokWork.updateColName(dgvParam);

            evokWork.
            shiftDtScHyShow(MultiLanguage.getLangId());
            evokWork.updateColName(dgvIO);
            string[] s = Constant.knifeLst.Split('/');

            int selId = comboBox4.SelectedIndex;

            comboBox4.Items.Clear();

            comboBox4.Items.AddRange(s);

            if (comboBox4.Items.Count > 0)
            {
                if (selId >= 0)
                {
                    comboBox4.SelectedIndex = selId;
                }
                else
                {
                    comboBox4.SelectedIndex = 0;
                }
            }


            /**
             * evokWork.updateColName(dgvIO);
             * //一些控件的库需要更换
             * string[] s = Constant.cutMode.Split('/');
             * comboBox1.Items.Clear();
             * comboBox1.Items.AddRange(s);
             * comboBox1.SelectedIndex = evokWork.CutSelMode;
             * s = Constant.printMode.Split('/');
             * printcb.Items.Clear();
             * printcb.Items.AddRange(s);
             * printcb.SelectedIndex = evokWork.PrintBarCodeMode;
             ****/
        }
Beispiel #10
0
        public void ImportImage(string FilePath, float DitherSteps)
        {
            if (axScSamlightClientCtrl1.ScIsRunning() == 0)
            {
                MessageBox.Show(MultiLanguage.GeSamlightNotFoundString(), MultiLanguage.GeSamlightWarningString(), MessageBoxButtons.OK);
                //MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK);
                return;
            }

            //flags = ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlImportFlagKeepOrder |
            //        ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlImportFlagReadPenInfo |
            //        ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlImportFlagCenterToField |
            //        ( int )ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlImportFlagCreateOneGroup;
            long flags = 0;

            axScSamlightClientCtrl1.ScImport("", FilePath, "jpg", 1, (int)flags);

            ScaleSize("", Para.SWImgToSamlightXScale, Para.SWImgToSamlightYScale);

            axScSamlightClientCtrl1.ScSetEntityDoubleData("", (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlDoubleDataIdBitmapDitherstep, Math.Round(DitherSteps, 3));
            //axScSamlightClientCtrl1.ScSetEntityLongData("", (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdBitmapMode, 49);


            if (Para.SMBitmapInverted)
            {
                flags = (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdBitmapModeInvert |
                        (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdBitmapModeShowScanner |
                        (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdBitmapModeShowBitmap;
            }
            else
            {
                flags = //(int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdBitmapModeInvert |
                        (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdBitmapModeShowScanner |
                        (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdBitmapModeShowBitmap;
            }

            if (Para.SamlightGreyScale)
            {
                //if (true)
                flags = flags | (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdBitmapModeGreyscale;
            }

            axScSamlightClientCtrl1.ScSetEntityLongData("", (int)ScComSAMLightClientCtrlFlags.scComSAMLightClientCtrlLongDataIdBitmapMode, (int)flags);

            AbsMoveTo("", 0 + Para.SMCenterToActualCenterX, 0 + Para.SMCenterToActualCenterY);

            //Rotate("",45);
        }
Beispiel #11
0
        /// <summary>
        ///     Draw a <see cref="MenuSeparator" />
        /// </summary>
        public override void Draw()
        {
            var centerY = ColoredUtilities.GetContainerRectangle(this.Component)
                          .GetCenteredText(
                null,
                ColoredMenuSettings.FontCaption,
                MultiLanguage.Translation(this.Component.DisplayName),
                CenteredFlags.VerticalCenter | CenteredFlags.HorizontalCenter);

            ColoredMenuSettings.FontCaption.DrawText(
                MenuManager.Instance.Sprite,
                MultiLanguage.Translation(this.Component.DisplayName),
                (int)centerY.X,
                (int)centerY.Y,
                ColoredMenuSettings.TextCaptionColor);

            Line.Width = 2;
            Line.Begin();
            Line.Draw(
                new[]
            {
                new Vector2(
                    this.Component.Position.X + Offset,
                    ColoredUtilities.GetContainerRectangle(this.Component).Center.Y),
                new Vector2(
                    Math.Max(this.Component.Position.X + Offset, centerY.X - 5),
                    ColoredUtilities.GetContainerRectangle(this.Component).Center.Y)
            },
                MenuSettings.ContainerSelectedColor);
            var newX =
                ColoredMenuSettings.FontCaption.MeasureText(
                    MenuManager.Instance.Sprite,
                    this.Component.DisplayName.ToUpper(),
                    0).Width;

            Line.Draw(
                new[]
            {
                new Vector2(centerY.X + newX + 5, ColoredUtilities.GetContainerRectangle(this.Component).Center.Y),
                new Vector2(
                    Math.Max(
                        centerY.X + newX + 5,
                        ColoredUtilities.GetContainerRectangle(this.Component).Right - Offset),
                    ColoredUtilities.GetContainerRectangle(this.Component).Center.Y)
            },
                MenuSettings.ContainerSelectedColor);
            Line.End();
        }
Beispiel #12
0
        private void SetLanguage()
        {
            tituloPrincipal.InnerHtml = MultiLanguage.GetTranslate(_seccion, "tituloPrincipal");
            tituloSeccion.InnerHtml   = MultiLanguage.GetTranslate(_seccion, "tituloSeccion");

            lblSeccionFiltrar.InnerHtml = MultiLanguage.GetTranslate(_seccion, "lblSeccion") + ":";
            lblSeccion.InnerHtml        = MultiLanguage.GetTranslate(_seccion, "lblSeccion") + ":";
            lblDescripcion.InnerHtml    = MultiLanguage.GetTranslate(_seccion, "lblDescripcion") + ":";

            btnCancelar.InnerHtml = MultiLanguage.GetTranslate("btnCancelar");
            btnGuardar.InnerHtml  = MultiLanguage.GetTranslate("btnGuardar");

            lblFiltrar.InnerHtml        = MultiLanguage.GetTranslate(_seccion, "lblFiltrar");
            lblNuevo.InnerHtml          = MultiLanguage.GetTranslate(_seccion, "lblNuevo");
            lblRefrescarCache.InnerHtml = MultiLanguage.GetTranslate(_seccion, "lblRefrescarCache");
        }
Beispiel #13
0
        public void ShowRedPointer()
        {
            if (axScSamlightClientCtrl1.ScIsRunning() == 0)
            {
                MessageBox.Show(MultiLanguage.GeSamlightNotFoundString(), MultiLanguage.GeSamlightWarningString(), MessageBoxButtons.OK);
                //MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK);
                return;
            }
            axScSamlightClientCtrl1.ScSetLongValue((int)65, 2);

            axScSamlightClientCtrl1.ScExecCommand(( int )SAMLIGHT_CLIENT_CTRL_OCXLib.ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandRedPointerStart);            
            //axScSamlightClientCtrl1.ScExecCommand( ( int )SAMLIGHT_CLIENT_CTRL_OCXLib.ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandRedPointerStop ); 
            //axScSamlightClientCtrl1.ScExecCommand( ( int )SAMLIGHT_CLIENT_CTRL_OCXLib.ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandCloseMarkDialog );
            ////scComSAMLightClientCtrlLongValueTypeRedpointerMode
                isRedPointerShown = true;
        }
Beispiel #14
0
        /// <summary>
        ///     Draw a <see cref="MenuSeparator" />
        /// </summary>
        public override void Draw()
        {
            var centerY = LightUtilities.GetContainerRectangle(this.Component)
                          .GetCenteredText(
                null,
                LightMenuSettings.FontCaption,
                MultiLanguage.Translation(this.Component.DisplayName),
                CenteredFlags.VerticalCenter | CenteredFlags.HorizontalCenter);

            LightMenuSettings.FontCaption.DrawText(
                MenuManager.Instance.Sprite,
                MultiLanguage.Translation(this.Component.DisplayName),
                (int)centerY.X,
                (int)centerY.Y,
                LightMenuSettings.TextCaptionColor);
        }
Beispiel #15
0
        public void UpdateUILanguage()
        {
            SamLOnlineCB.Content = MultiLanguage.GetSamLightOnlineCBString();
            SamLGSCB.Content     = MultiLanguage.GetSamlightGreyScaleCBString();

            SMBitInvertedCB.Content   = MultiLanguage.GetSamLighInvertCBString();
            LangaugeLB.Content        = MultiLanguage.GetLanguageLblString();
            SamLightXScaleLbl.Content = MultiLanguage.GetSLXScaleLblString();
            SamLightYScaleLbl.Content = MultiLanguage.GetSLYScaleLblString();
            SLDetherStepLbl.Content   = MultiLanguage.GetSLDetherLblString();
            SLOffsetXLbl.Content      = MultiLanguage.GetSLoffsetXLblString();
            SLOffsetYLbl.Content      = MultiLanguage.GetSLoffsetYLblString();
            PhonePwLbl.Content        = MultiLanguage.GetLaserPwLblString();
            PhoneSpeedLbl.Content     = MultiLanguage.GetLaserSpeedLblString();
            PhoneFreqLbl.Content      = MultiLanguage.GetLaserFreqLblString();
        }
Beispiel #16
0
        private void SetLanguage()
        {
            tituloPrincipal.InnerHtml = MultiLanguage.GetTranslate(_seccion, "tituloPrincipal");

            btnCancelar.InnerHtml           = MultiLanguage.GetTranslate(_seccion, "btnCancelar");
            btnGuardar.InnerHtml            = MultiLanguage.GetTranslate(_seccion, "btnGuardar");
            lblNuevo.InnerHtml              = MultiLanguage.GetTranslate(_seccion, "lblNuevo");
            lblFiltrar.InnerHtml            = MultiLanguage.GetTranslate(_seccion, "lblFiltrar");
            lblRazonSocialFiltrar.InnerHtml = MultiLanguage.GetTranslate(_seccion, "lblRazonSocial");
            lblRazonSocial.InnerHtml        = MultiLanguage.GetTranslate(_seccion, "lblRazonSocial");
            lblDireccion.InnerHtml          = MultiLanguage.GetTranslate(_seccion, "lblDireccion");
            lblCodigoPostal.InnerHtml       = MultiLanguage.GetTranslate(_seccion, "lblCodigoPostal");
            lblTelefono.InnerHtml           = MultiLanguage.GetTranslate(_seccion, "lblTelefono");
            lblChatbotName.InnerHtml        = MultiLanguage.GetTranslate(_seccion, "lblChatbotName");
            lblHostName.InnerHtml           = MultiLanguage.GetTranslate(_seccion, "lblHostName");
            lblHashKey.InnerHtml            = MultiLanguage.GetTranslate(_seccion, "lblHashKey");
        }
Beispiel #17
0
        private void DoChangePassword(string oldPwd, string newPwd)
        {
            _changePasswordDone = false;

            if (Program.WebSocketClient.State != WebSocketClientState.Logged)
            {
                throw new Exception(MultiLanguage.GetString("strNotLoggedIn"));
            }

            dynamic changePwdInfo = new ExpandoObject();

            changePwdInfo.Old = oldPwd;
            changePwdInfo.New = newPwd;

            Program.WebSocketClient?.AgentWebSocket?.Query <dynamic>("CHANGEPWD", (object)changePwdInfo,
                                                                     OnChangePassword);
        }
Beispiel #18
0
 public void InitLang()
 {
     //设置提醒字符串
     Constant.InitStr(this);
     evokWork.ShiftDgvParamLang(dgvParam, MultiLanguage.getLangId());
     evokWork.updateColName(dgvParam);
     evokWork.updateColName(dgvIO);
     //一些控件的库需要更换
     string[] s = Constant.cutMode.Split('/');
     // comboBox1.Items.Clear();
     // comboBox1.Items.AddRange(s);
     // comboBox1.SelectedIndex = evokWork.CutSelMode;
     s = Constant.printMode.Split('/');
     printcb.Items.Clear();
     printcb.Items.AddRange(s);
     printcb.SelectedIndex = evokWork.PrintBarCodeMode;
 }
Beispiel #19
0
        public MessageDlg(string Title, string Message, bool isError)
        {
            InitializeComponent();
            this.Title          = Title;
            MsgBox.Text         = Message;
            CancelBtn.IsEnabled = false;

            OKBtn.Content     = MultiLanguage.GetOKBtnString();
            CancelBtn.Content = MultiLanguage.GetCancelBtnString();

            if (!isError)
            {
                Img.Visibility            = System.Windows.Visibility.Hidden;
                InformationImg.Visibility = System.Windows.Visibility.Visible;
                CancelBtn.IsEnabled       = true;
            }
        }
        private void btn_Register_Click(object sender, EventArgs e)
        {
            if (!Celeste_User.Helpers.IsValideEmailAdress(tb_Mail.Text))
            {
                SkinHelper.ShowMessage(MultiLanguage.GetString("strInvalidEmail"), @"Project Celeste -- Register",
                                       MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            if (!Celeste_User.Helpers.IsValideUserName(tb_UserName.Text))
            {
                SkinHelper.ShowMessage(
                    MultiLanguage.GetString("strInvalidUserName"),
                    @"Project Celeste -- Register",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (tb_ConfirmPassword.Text != tb_Password.Text)
            {
                SkinHelper.ShowMessage(MultiLanguage.GetString("srtPasswordConfirmNotMatch"),
                                       @"Project Celeste -- Register",
                                       MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (tb_Password.Text.Length < 8 || tb_Password.Text.Length > 32)
            {
                SkinHelper.ShowMessage(MultiLanguage.GetString("strInvalidPassordLength"),
                                       @"Project Celeste -- Register",
                                       MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (tb_InviteCode.Text.Length != 128)
            {
                SkinHelper.ShowMessage(MultiLanguage.GetString("strInvalidInviteCode"),
                                       @"Project Celeste -- Register",
                                       MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            DoRegisterUser(tb_Mail.Text, tb_Password.Text, tb_UserName.Text, tb_InviteCode.Text);
        }
    private MultilingualLocationInfo MergeLocationInfo(List <string> suppliersPriority,
                                                       Dictionary <string, MultilingualAccommodation> supplierAccommodationDetails,
                                                       MultilingualAccommodation accommodationWithManualCorrection,
                                                       MultiLanguage <string> country,
                                                       MultiLanguage <string> locality,
                                                       MultiLanguage <string>?localityZone)
    {
        var address = MergeMultilingualData(suppliersPriority,
                                            supplierAccommodationDetails.ToDictionary(d => d.Key,
                                                                                      d => d.Value.Location.Address) !,
                                            accommodationWithManualCorrection.Location.Address, string.IsNullOrEmpty);

        var coordinates = MergeData(suppliersPriority,
                                    supplierAccommodationDetails.ToDictionary(d => d.Key,
                                                                              d => d.Value.Location.Coordinates),
                                    accommodationWithManualCorrection.Location.Coordinates, point => point == default);

        var pointOfInterests = MergeData(suppliersPriority, supplierAccommodationDetails.ToDictionary(d => d.Key,
                                                                                                      d => d.Value.Location.PointsOfInterests),
                                         accommodationWithManualCorrection.Location.PointsOfInterests,
                                         poi => poi == null ! || !poi.Any());

        var locationDescriptionCode = MergeData(suppliersPriority, supplierAccommodationDetails.ToDictionary(
                                                    d => d.Key,
                                                    d => d.Value.Location.LocationDescriptionCode),
                                                accommodationWithManualCorrection.Location.LocationDescriptionCode,
                                                c => c == EdoContracts.Accommodations.Enums.LocationDescriptionCodes.Unspecified);

        // CountryCode must be the same, but for understandability merging too
        var countryCode = MergeData(suppliersPriority, supplierAccommodationDetails.ToDictionary(d => d.Key,
                                                                                                 d => d.Value.Location.CountryCode), accommodationWithManualCorrection.Location.CountryCode,
                                    string.IsNullOrEmpty);

        return(new MultilingualLocationInfo(
                   address: address,
                   country: country !,
                   locality: locality,
                   localityZone: localityZone,
                   coordinates: coordinates,
                   locationDescriptionCode: locationDescriptionCode,
                   pointsOfInterests: pointOfInterests,
                   countryCode: countryCode,
                   supplierLocalityCode: string.Empty,
                   supplierLocalityZoneCode: string.Empty));
    }
Beispiel #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Controlo si puede ingresar a la pantalla.
            if (!Security.IsAuthorized((int)Constantes.Roles.Frases))
            {
                Response.Redirect(Page.ResolveClientUrl("~/Default.aspx"));
            }

            grdFrase.AddColumn(MultiLanguage.GetTranslate(_seccion, "grdId"), ColumnType.Data, "IdFrase", "", true, false);
            grdFrase.AddColumn(MultiLanguage.GetTranslate(_seccion, "lblDescripcion"), ColumnType.Data, "Descripcion", "", false, true);
            grdFrase.AddColumn(MultiLanguage.GetTranslate(_seccion, "lblRespuesta"), ColumnType.Data, "Respuesta", "", false, true);
            grdFrase.AddContextMenu("cmnuNuevo", MultiLanguage.GetTranslate("cmnuNuevo"), "@New", "glyphicon glyphicon-file", "#5cb85c", "exampleModal");
            grdFrase.AddContextMenu("cmnuModificar", MultiLanguage.GetTranslate("cmnuModificar"), "@Upd", "glyphicon glyphicon-pencil", "#337AB7", "exampleModal");
            grdFrase.AddContextMenu("cmnuEliminar", MultiLanguage.GetTranslate("cmnuEliminar"), "@Del", "glyphicon glyphicon-remove", "#d9534f", "exampleModal");
            grdFrase.DataSource = new Rules.Frase().ObtenerListadoPorCliente();

            SetLanguage();
        }
Beispiel #23
0
        private void Validar(Models.Cliente cliente)
        {
            var mensaje = "";

            if (cliente.RazonSocial == "")
            {
                mensaje += (mensaje != "" ? Environment.NewLine : "");
                mensaje += MultiLanguage.GetTranslate(_seccion, "lblRazonSocial") + ": ";
                mensaje += MultiLanguage.GetTranslate("errorVacioString");
            }

            if (cliente.Direccion == "")
            {
                mensaje += (mensaje != "" ? Environment.NewLine : "");
                mensaje += MultiLanguage.GetTranslate(_seccion, "lblDireccion") + ": ";
                mensaje += MultiLanguage.GetTranslate("errorVacioString");
            }

            if (cliente.Telefono == "")
            {
                mensaje += (mensaje != "" ? Environment.NewLine : "");
                mensaje += MultiLanguage.GetTranslate(_seccion, "lblTelefono") + ": ";
                mensaje += MultiLanguage.GetTranslate("errorVacioString");
            }

            if (cliente.CodigoPostal == "")
            {
                mensaje += (mensaje != "" ? Environment.NewLine : "");
                mensaje += MultiLanguage.GetTranslate(_seccion, "lblCodigoPostal") + ": ";
                mensaje += MultiLanguage.GetTranslate("errorVacioString");
            }

            if (cliente.HostName == "")
            {
                mensaje += (mensaje != "" ? Environment.NewLine : "");
                mensaje += MultiLanguage.GetTranslate(_seccion, "lblHostName") + ": ";
                mensaje += MultiLanguage.GetTranslate("errorVacioString");
            }

            if (mensaje != "")
            {
                throw new Exception(mensaje);
            }
        }
Beispiel #24
0
        private void btn_Login_Click(object sender, EventArgs e)
        {
            if (!Celeste_User.Helpers.IsValideEmailAdress(tb_Mail.Text))
            {
                SkinHelper.ShowMessage(MultiLanguage.GetString("strInvalidEmail"), @"Project Celeste -- Login",
                                       MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (tb_Password.Text.Length < 8 || tb_Password.Text.Length > 32)
            {
                SkinHelper.ShowMessage(MultiLanguage.GetString("strInvalidPassordLength"),
                                       @"Project Celeste -- Login",
                                       MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            DoLoggedIn(tb_Mail.Text, tb_Password.Text);
        }
Beispiel #25
0
        private void btnSmall1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != textBox2.Text)
            {
                SkinHelper.ShowMessage(MultiLanguage.GetString("strPasswordsNotMatch"),
                                       @"Project Celeste -- Change Password",
                                       MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            if (textBox1.Text.Length < 8)
            {
                SkinHelper.ShowMessage(MultiLanguage.GetString("strPasswordMinimunLength"), @"Project Celeste -- Change Password",
                                       MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (textBox1.Text.Length > 32)
            {
                SkinHelper.ShowMessage(MultiLanguage.GetString("strPasswordMaxLength"), @"Project Celeste -- Change Password",
                                       MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            Enabled = false;
            DoChangePassword(tb_Password.Text, textBox2.Text);

            var starttime = DateTime.UtcNow;

            while (!_changePasswordDone && DateTime.UtcNow.Subtract(starttime).TotalSeconds < 20) //Timeout 20sec
            {
                Application.DoEvents();
            }

            Enabled = true;

            if (!_changePasswordDone)
            {
                SkinHelper.ShowMessage(MultiLanguage.GetString("strErrorTimeout"), @"Project Celeste -- Change Password",
                                       MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #26
0
 private void Frm_Realtrend_Load(object sender, EventArgs e)
 {
     xml_load();      //读取偏好设置文件
     chart_initial(); //初始化图表控件
     //语言切换
     MultiLanguage.LoadLanguage(Application.OpenForms["Frm_Realtrend"], Form_Main.lan);
     if (Form_Main.lan == "Chinese")
     {
         ((Frm_Realtrend)Application.OpenForms["Frm_Realtrend"]).zedGraphControl1.GraphPane.XAxis.Title.Text = "时间(分钟)";
         ((Frm_Realtrend)Application.OpenForms["Frm_Realtrend"]).zedGraphControl1.AxisChange();
         ((Frm_Realtrend)Application.OpenForms["Frm_Realtrend"]).zedGraphControl1.Invalidate();
     }
     else if (Form_Main.lan == "English")
     {
         ((Frm_Realtrend)Application.OpenForms["Frm_Realtrend"]).zedGraphControl1.GraphPane.XAxis.Title.Text = "Time(min)";
         ((Frm_Realtrend)Application.OpenForms["Frm_Realtrend"]).zedGraphControl1.AxisChange();
         ((Frm_Realtrend)Application.OpenForms["Frm_Realtrend"]).zedGraphControl1.Invalidate();
     }
 }
Beispiel #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Controlo si puede ingresar a la pantalla.
            if (!Security.IsAuthorized((int)Constantes.Roles.Backup))
            {
                Response.Redirect(Page.ResolveClientUrl("~/Default.aspx"));
            }

            grdBackup.AddColumn(MultiLanguage.GetTranslate(_seccion, "grdDirectorio"), ColumnType.Data, "Directorio", "", true, true);
            grdBackup.AddColumn(MultiLanguage.GetTranslate(_seccion, "grdNombre"), ColumnType.Data, "Nombre", "", true, true);
            grdBackup.AddColumn(MultiLanguage.GetTranslate(_seccion, "grdFechaCreacion"), ColumnType.Datetime, "FechaCreacion", "", true, true);
            grdBackup.AddColumn(MultiLanguage.GetTranslate(_seccion, "grdFechaModificacion"), ColumnType.Datetime, "FechaModificacion", "", true, true);

            grdBackup.AddContextMenu("cmnuRestore", MultiLanguage.GetTranslate("cmnuRestore"), "@Restore", "glyphicon glyphicon-import", "#5cb85c", "exampleModal");
            grdBackup.AddContextMenu("cmnuEliminar", MultiLanguage.GetTranslate("cmnuEliminar"), "@Restore", "glyphicon glyphicon-remove", "#d9534f", "exampleModal");
            grdBackup.DataSource = new Rules.Backup().ObtenerBackup();

            SetLanguage();
        }
        public MultiLanguage <List <string> > Normalize(MultiLanguage <List <string> > amenities)
        {
            var allAmenities        = amenities.GetAll();
            var normalizedAmenities = new MultiLanguage <List <string> >();

            foreach (var amenity in allAmenities.Where(amenity => !string.IsNullOrEmpty(amenity.languageCode)))
            {
                if (amenity.languageCode != Languages.GetLanguageCode(DcLanguages.Arabic))
                {
                    normalizedAmenities.TrySetValue(amenity.languageCode, NormalizeAndSplitAmenities(amenity));
                }
                else
                {
                    normalizedAmenities.TrySetValue(amenity.languageCode, amenity.value);
                }
            }

            return(normalizedAmenities);
        }
        protected void OnAddLibrary(Object sender, EventArgs e)
        {
            ((PageBase)Page).CheckRight(NSurveyRights.ManageLibrary, true);

            if (txtLibName.Text.Length == 0)
            {
                ((PageBase)Page).ShowErrorMessage(MessageLabel, ((PageBase)Page).GetPageResource("MissingLibraryNameMessage"));
                MessageLabel.Visible = true;
                return;
            }
            LibraryData libraryData = new LibraryData();

            LibraryData.LibrariesRow library = libraryData.Libraries.NewLibrariesRow();
            library.LibraryId   = _libraryId;
            library.LibraryName = txtLibName.Text;
            library.Description = txtLibDescr.Text;
            //  library.DefaultLanguageCode = ddlDefaultLang.SelectedValue;
            //    new MultiLanguage().UpdateSurveyLanguage(LibraryId, ddlDefaultLang.SelectedValue, true, Constants.Constants.EntityLibrary);
            libraryData.Libraries.Rows.Add(library);

            if (LibraryEditMode)
            {
                LibraryFactory.Create().UpdateLibrary(libraryData);

                var ml = new MultiLanguage();
                // Reset all other default items
                foreach (ListItem item in this.ddlDefaultLang.Items)
                {
                    new MultiLanguage().UpdateSurveyLanguage(LibraryId, item.Value, item.Selected, Constants.Constants.EntityLibrary);
                }
            }
            else
            {
                LibraryFactory.Create().AddLibrary(libraryData);
                new MultiLanguage().UpdateSurveyLanguage(libraryData.Libraries[0].LibraryId, System.Globalization.CultureInfo.CurrentCulture.Name, true, Constants.Constants.EntityLibrary);
                txtLibName.Text  = string.Empty;
                txtLibDescr.Text = string.Empty;
            }
            ((PageBase)Page).ShowNormalMessage(MessageLabel, ((PageBase)Page).GetPageResource("UpdatedLibraryNameMessage"));
            MessageLabel.Visible = true;
            UINavigator.NavigateToLibraryDirectory(0, 0, 0);
            FillData();
        }
        private void ListStationsInGrid()
        {
            var a = 0;
            var b = 0;

            try
            {
                var style = Application.Current.FindResource("styleStationSelectionBtn") as Style;
                for (var i = 1; i <= Stations.stationList.Count; i++)
                {
                    if (Stations.stationList[i].id == Convert.ToInt32(Parameters.TVMDynamic.GetParameter("stationId")) /*|| Stations.stationList[i].id == 22*/)
                    {
                        continue;
                    }
                    var buttonTo = new Button
                    {
                        Content             = MultiLanguage.GetText(Stations.stationList[i].name),
                        Name                = "btnStation" + i,
                        Tag                 = Stations.stationList[i].id,
                        Style               = style,
                        FontSize            = Ticket.language == Languages.English || Ticket.language == Languages.Hint ? 20 : 13,
                        VerticalAlignment   = VerticalAlignment.Stretch,
                        HorizontalAlignment = HorizontalAlignment.Stretch
                    };
                    buttonTo.Click += btnStation_Click;
                    Grid.SetRow(buttonTo, b);
                    Grid.SetColumn(buttonTo, a);
                    GridStations.Children.Add(buttonTo);
                    a = a + 2;
                    if (a != 8)
                    {
                        continue;
                    }
                    b = b + 2;
                    a = 0;
                }
            }
            catch (Exception ex)
            {
                log.Error("Error StationPage -> ListStationsInGrid() : " + ex.ToString());
            }
        }