Example #1
0
        public ActionResult MessagesScript(string version)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("var EIDSS = { BvMessages: {");
            g_ResKeys.ForEach(key =>
            {
                string val = BvMessages.Get(key);
                if (val == null || val == key)
                {
                    val = EidssMessages.Get(key);
                }
                if (val == null || val == key)
                {
                    val = EidssFields.Get(key);
                }
                if (val == null || val == key)
                {
                    val = EidssMenu.Get(key, null);
                }
                if (val == null || val == key)
                {
                    val = key;
                }
                val = val.Replace("'", "\\'");
                sb.AppendFormat("'{0}': '{1}',", key, val);
                sb.AppendLine();
            });
            sb.AppendLine("} }");
            return(JavaScript(sb.ToString()));
        }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 void GridPanelItem_DeleteValidation(object sender, ValidationEventArgs args)
 {
     // todo: show warning according to object type
     if (!String.IsNullOrEmpty(args.MessageId))
     {
         ErrorForm.ShowWarning(args.MessageId, "Can't delete object");
     }
     else
     {
         if (args.FieldName == "_on_delete")
         {
             if (args.ShouldAsk)
             {
                 if (ErrorForm.ShowConfirmationDialog(null, BvMessages.Get("msgConfirmReferenceDeleting", "You are going to delete the reference value which is used in the system already. Do you want to delete reference value?"), null) == DialogResult.Yes)
                 {
                     args.Continue = true;
                 }
             }
             else
             {
                 ErrorForm.ShowWarning("msgCantDelete", "Can't delete object");
             }
         }
         else
         {
             ErrorForm.ShowWarning("msgErrorDelete", "Error occurred while deleting object");
         }
     }
 }
Example #3
0
        //private void AddButtonClickHandler(ButtonEdit cb, ButtonPressedEventHandler handler)
        //{
        //    try
        //    {
        //        cb.ButtonClick -= handler;
        //    }
        //    finally
        //    {
        //        cb.ButtonClick += handler;
        //    }
        //}

        //private void ClearLookup(object sender, ButtonPressedEventArgs e)
        //{
        //    if (e.Button.Kind == ButtonPredefines.Delete)
        //    {
        //        //var item = searchPanel.m_LContent.m_LinkedItems.Where(s => s.Controls.Contains(sender as BaseEdit)).FirstOrDefault();
        //        //string msg;
        //        ////if (item != null && item.MetaItem.DefaultValue != null && item.MetaItem.IsMandatory)
        //        ////    msg = BvMessages.Get("msgConfirmResetLookup", "Reset the content to default value?");
        //        ////else
        //        ////    msg = BvMessages.Get("msgConfirmClearLookup", "Clear the content?");
        //        ////if (
        //        ////    MessageForm.Show(msg, BvMessages.Get("Confirmation"),
        //        ////                     MessageBoxButtons.YesNo) != DialogResult.Yes)
        //        ////    return;
        //        var cb = (BaseEdit)sender;
        //        var e1 = new ChangingEventArgs(cb.EditValue, null);
        //        var mi = cb.GetType().GetMethod("OnEditValueChanging", BindingFlags.Instance | BindingFlags.NonPublic);
        //        if (mi != null)
        //        {
        //            mi.Invoke(cb, new object[] { e1 });
        //            if (e1.Cancel)
        //            {
        //                return;
        //            }
        //        }
        //        if (cb.DataBindings.Count > 0)
        //        {
        //            //TODO:correct this for BusinessObject
        //            //DataRow row = BaseForm.GetControlCurrentRow(cb);
        //            //if (row != null && !(row[cb.DataBindings[0].BindingMemberInfo.BindingField] == DBNull.Value))
        //            //{
        //            //    row.BeginEdit();
        //            //    row[cb.DataBindings[0].BindingMemberInfo.BindingField] = DBNull.Value;
        //            //    row.EndEdit();
        //            //}
        //        }
        //        searchPanel.ClearControl(cb);
        //    }
        //}
        public LookUpEdit CreateLookUpEdit(List <object> items, object currentValue, bool bSorting = true)
        {
            var control = new LookUpEdit();

            control.Properties.Columns.AddRange(new[]
            {
                new LookUpColumnInfo("Name", BvMessages.Get("colName", "Name"), 74)
            });

            control.Properties.DataSource    = items;
            control.Properties.DisplayMember = "Name";
            control.Properties.ValueMember   = "Value";

            control.Properties.BestFitMode           = BestFitMode.BestFitResizePopup;
            control.Properties.SearchMode            = SearchMode.AutoComplete;
            control.Properties.AutoSearchColumnIndex = 0;
            if (bSorting)
            {
                control.Properties.SortColumnIndex      = 0;
                control.Properties.Columns[0].SortOrder = ColumnSortOrder.Ascending;
            }
            control.Properties.NullText = "";
            if (currentValue != null && !string.IsNullOrWhiteSpace(currentValue.ToString()))
            {
                dynamic val = currentValue;
                control.EditValue = val.Key;
            }
            control.Tag = "";
            AddClearButton(control, true);
            return(control);
        }
Example #4
0
        public override string GetResourceNameForComponent(Component component, DesignElement designType)
        {
            var key = GetKeyForComponent(component, designType);

            if (!string.IsNullOrEmpty(ResourceSplitter.Read(GetViewNameForSplittedResources(), key)))
            {
                return(string.Empty);
            }
            BvMessages.Get(key);
            if (BvMessages.Instance.IsValueExists)
            {
                return("BvMessages");
            }
            if (Messages != null)
            {
                Messages.GetString(key);
                if (Messages.IsValueExists)
                {
                    return(Messages.GetType().Name);
                }
            }
            var parentView = ParentLayout.ParentBasePanel as ITranslationView;

            if (parentView != null)
            {
                return(parentView.GetResourceNameForComponent(component, designType));
            }
            return(base.GetResourceNameForComponent(component, designType));
        }
Example #5
0
        public void ResetLanguage(string langID)
        {
            if (Localizer.SupportedLanguages.ContainsKey(langID) == false)
            {
                return;
            }
            if (ModelUserContext.CurrentLanguage == langID)
            {
                return;
            }
            ModelUserContext.CurrentLanguage      = langID;
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(CustomCultureHelper.GetCustomCultureName(langID));
            string organization      = txtOrganization.Text;
            string activeControlName = "";

            if (ActiveControl != null)
            {
                activeControlName = ActiveControl.Name;
                if (activeControlName == "" && ActiveControl.Parent != null)
                {
                    activeControlName = ActiveControl.Parent.Name;
                }
            }
            SuspendLayout();
            Visible = false;
            while (Controls.Count > 0)
            {
                Controls[0].Dispose();
            }
            InitializeComponent();
            Visible = true;
            WinClientContext.InitFont();
            LayoutCorrector.ApplySystemFont(this);
            ResumeLayout();
            txtOrganization.Text  = organization;
            btnOk.Text            = BvMessages.Get("strOK_Id");
            btnCancel.Text        = BvMessages.Get("strCancel_Id");
            TabPageMain.Text      = EidssMessages.Get("EIDSS_Short_Caption");
            TabControlMain.Height = btnOk.Top - TabControlMain.Top - 4;
            ControlsLastLanguage  = new Dictionary <Control, string> {
                { txtUserName, "en" }, { txtPassword, "en" }
            };

            if (m_LoginType == LoginType.Simple)
            {
                TabControlMain.TabPages.Remove(TabPageSQL);
                TabControlMain.TabPages.Remove(TabPageArchive);
            }

            foreach (Control ctl in Controls)
            {
                if (ctl.Name == activeControlName)
                {
                    ctl.Select();
                    break;
                }
            }
        }
Example #6
0
        public static void CheckUserLoggedIn()
        {
            if (User != null && User.ID != null)
            {
                return;
            }

            throw new ApplicationException(BvMessages.Get("msgUserNotLoggedIn", "msgUserNotLoggedIn"));
        }
Example #7
0
        protected override void OnCreateControl()
        {
            base.OnCreateControl();

            btnOk.Text       = BvMessages.Get("strOK_Id");
            btnCancel.Text   = BvMessages.Get("strCancel_Id");
            TabPageMain.Text = EidssMessages.Get("EIDSS_Short_Caption");
            UpdateTabsVisibility();
        }
Example #8
0
        public void ShowTotal(long currentCount)
        {
            m_TotalsLabel.Visible = true;
            m_TotalsLabel.SendToBack();

            string currentTotalString = string.Format(BvMessages.Get("msgNumberOfRecords"), currentCount);

            m_TotalsLabel.Text = currentTotalString;
        }
Example #9
0
 /// <summary>
 /// </summary>
 /// <returns></returns>
 public static DialogResult ConfirmSaveForTranslationTool()
 {
     return
         (MessageForm.Show(
              BvMessages.Get("msgSaveTranslationToolPrompt", "Do you want to save changes and close the form?")
              , BvMessages.Get("Confirmation")
              , MessageBoxButtons.YesNoCancel
              , MessageBoxIcon.Question));
 }
        public static string Error(StandardError errType, params object[] param)
        {
            switch (errType)
            {
            case StandardError.DatabaseError:
                return(BvMessages.Get("ErrDatabase", "Error during database operation."));

            case StandardError.DataValidationError:
                return(BvMessages.Get("ErrDataValidation", "Some field contains invalid data."));

            case StandardError.DataRetrievingError:
                return(BvMessages.Get("ErrFillDataset", "Error during retrieving data from database."));

            case StandardError.DataSavingtError:
                return(BvMessages.Get("ErrPost", "Error during saving data to database."));

            case StandardError.InvalidLogin:
                return(BvMessages.Get("ErrInvalidLogin", "Invalid login name/password."));

            case StandardError.SqlQueryError:
                return(BvMessages.Get("ErrSqlQuery", "Error during executing sql query."));

            case StandardError.StoredProcedureError:
                return(BvMessages.Get("ErrStoredProcedure", "Error during executing sql stored procedure."));

            case StandardError.UnprocessedError:
                return(BvMessages.Get("ErrUnprocessedError", "Some error occurs in the application. Please send information about this error to developers team."));

            case StandardError.PermissionError:
                return(BvMessages.Get("ErrPermissionError", "Current user have not permissions for this operation."));

            case StandardError.ParamsCountError:
                return(BvMessages.Get("ErrParamsCountError", "There is Params count error."));

            case StandardError.PostError:
                return(BvMessages.Get("ErrPost"));

            case StandardError.CreateParameterError:
                return(BvMessages.Get("ErrCreateParameter"));

            case StandardError.FillDatasetError:
                return(BvMessages.Get("ErrFillDataset"));

            case StandardError.InvalidOldPassword:
                return(BvMessages.Get("ErrOldPassword"));

            case StandardError.InvalidParameter:
                return(BvMessages.Get("ErrInvalidParameter"));

            case StandardError.Mandatory:
                return(string.Format(BvMessages.Get("ErrMandatoryFieldRequired"), param[0]));

            default:
                return(BvMessages.Get("ErrUndefinedStdError", "Some error occurs in the application. Please send information about this error to developers team."));
            }
        }
Example #11
0
 /// <summary>
 /// </summary>
 /// <returns></returns>
 public static bool ConfirmCancel(Form owner)
 {
     if (owner != null)
     {
         owner.Activate();
         owner.BringToFront();
     }
     return(ConfirmMessage(BvMessages.Get("msgCancelPrompt", "Do you want to cancel all the changes and close the form?"),
                           BvMessages.Get("Confirmation")));
 }
Example #12
0
        public static void SetClearTooltip(BaseEdit ctl)
        {
            string tooltip = BvMessages.Get("msgClearControl", "Press Ctrl-Del to clear value.");

            if (ctl.ToolTip == null || !ctl.ToolTip.Contains(tooltip))
            {
                ctl.ToolTip         = tooltip;
                ctl.ToolTipIconType = ToolTipIconType.None;
            }
        }
Example #13
0
        public static string GetLoginErrorMessage(long code, string organization, string userName)
        {
            switch (code)
            {
            case 6:
                var sm = new Security.EidssSecurityManager();
                return(string.Format(BvMessages.Get("ErrLoginIsLocked", "You have exceeded the number of incorrect login attempts. Please try again in {0} minutes."), sm.GetAccountLockTimeout(organization, userName)));

            default:
                return(BvMessages.Get("ErrUnprocessedError"));
            }
        }
Example #14
0
        public static void AddClearButton(ButtonEdit ctl)
        {
            IEnumerable <EditorButton> buttons = ctl.Properties.Buttons.Cast <EditorButton>();

            if (buttons.All(button => button.Kind != ButtonPredefines.Delete))
            {
                ctl.ButtonClick += ClearButtonClick;
                var btn = new EditorButton(ButtonPredefines.Delete, BvMessages.Get("btnClear", "Clear the field contents"));

                ctl.Properties.Buttons.Add(btn);
            }
        }
Example #15
0
 public void Init()
 {
     m_PopupContainer         = new PopupContainerControl();
     m_ActionPanel            = new XtraPanel();
     m_PopupContainer.Padding = new Padding(4, 0, 4, 0);
     m_ActionPanel.Height     = 31;
     m_ActionPanel.Parent     = m_PopupContainer;
     m_ActionPanel.Dock       = DockStyle.Bottom;
     AddButton(m_CancelButton = new SimpleButton(), BvMessages.Get("strCancel_Id"));
     AddButton(m_OkButton     = new SimpleButton(), BvMessages.Get("strOK_Id"), m_CancelButton);
     m_OkButton.Click        += OkClick;
     m_CancelButton.Click    += CancelClick;
 }
Example #16
0
 private void Init()
 {
     btnOk.Text             = BvMessages.Get("strOK_Id");
     btnOk.DialogResult     = System.Windows.Forms.DialogResult.OK;
     btnCancel.Text         = BvMessages.Get("strCancel_Id");
     btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     LayoutCorrector.ApplySystemFont(this);
     if (BaseFormManager.MainForm != null)
     {
         this.Icon = BaseFormManager.MainForm.Icon;
     }
     RtlHelper.SetRTL(this);
 }
Example #17
0
        public void ShowTotal(long currentCount, long?totalCount)
        {
            m_TotalsLabel.Visible = true;
            m_TotalsLabel.SendToBack();

            string currentTotalString = string.Format(BvMessages.Get("msgNumberOfRecords"), currentCount);

            if (totalCount.HasValue)
            {
                currentTotalString = string.Format(BvMessages.Get("msgTotalNumberOfRecords"),
                                                   currentTotalString, totalCount.Value);
            }
            m_TotalsLabel.Text = currentTotalString;
        }
Example #18
0
        public static string GetExceptionDescription(Exception ex)
        {
            SqlException sqlException = TryGetSqlException(ex);
            string       msgId        = SqlExceptionMessage.Get(sqlException);

            if (msgId != null)
            {
                return(BvMessages.Get(msgId));
            }
            if (sqlException != null)
            {
                return(ex.Message);
            }
            return(string.Empty);
        }
Example #19
0
        void ShowNextTime()
        {
            m_ChkShowNextTime = new CheckEdit
            {
                Checked = false,
                Text    =
                    string.IsNullOrEmpty(m_checkBoxText) ? BvMessages.Get("DoNotShowMessageNextTime") : m_checkBoxText
            };
            m_ChkShowNextTime.Properties.AutoWidth  = true;
            m_ChkShowNextTime.Properties.AutoHeight = true;
            Height += m_ChkShowNextTime.Height + 8;
            m_ChkShowNextTime.Location = new Point(12, Buttons[0].Top);
            Buttons[0].Top            += m_ChkShowNextTime.Height + 10;

            Controls.Add(m_ChkShowNextTime);
        }
Example #20
0
        private static void ShowHiddenFieldsTooltip(ToolTipControllerGetActiveObjectInfoEventArgs e, bool showTooltip)
        {
            ToolTipControlInfo info = null;

            if (e.ControlMousePosition.X < 12 && e.ControlMousePosition.Y < 12 && showTooltip)
            {
                //An object that uniquely identifies a row indicator cell
                object o = "HiddenIcon";
                info = new ToolTipControlInfo(o, BvMessages.Get("msgSomeFieldsAreHidden"));
            }
            //Supply tooltip information if applicable, otherwise preserve default tooltip (if any)
            if (info != null)
            {
                e.Info = info;
            }
        }
Example #21
0
 public Splash()
 {
     //This call is required by the Windows Form Designer.
     InitializeComponent();
     this.HelpTopicId = Help2.HomePage;
     //Text = GlobalSettings.AppCaption
     lbVersionNumber.Text = Application.ProductVersion;
     lbCopyright.Text     = BvMessages.Get("msgEIDSSCopyright");
     //Add any initialization after the InitializeComponent() call
     LayoutCorrector.ApplySystemFont(this);
     if (Localizer.IsRtl)
     {
         var l = lbVersionNumber.Left + lbVersionNumber.Width;
         lbVersionNumber.Left = lbVersion.Left;
         lbVersion.Left       = l - lbVersion.Width;
     }
 }
Example #22
0
        public static string GetMessage(string resourceKey)
        {
            if (resourceKey == null)
            {
                return(String.Empty);
            }
            var s = BvMessages.Get(resourceKey);

            if (BvMessages.Instance.IsValueExists)
            {
                return(s);
            }
            if (Messages != null)
            {
                s = Messages.GetString(resourceKey);
                return(s);
            }
            return(String.Empty);
        }
Example #23
0
        public ChangePasswordForm()
        {
            InitializeComponent();

            ControlsLastLanguage = new Dictionary <Control, string>
            {
                { txtUserName, "en" }
                , { txtPassword, "en" }
                , { txtNewPassword1, "en" }
                , { txtNewPassword2, "en" }
            };

            HelpTopicId = "change_password";

            txtOrganization.Text = OrganizationLookup.OrganizationNational;
            txtUserName.Text     = EidssUserContext.User.LoginName;
            ActiveControl        = txtPassword;

            btnOk.Text     = BvMessages.Get("strOK_Id");
            btnCancel.Text = BvMessages.Get("strCancel_Id");

            var ch    = txtPassword.Properties.PasswordChar;
            var field = new string(ch, 8);

            txtPassword.Properties.NullText     = field;
            txtPassword.EditValue               = null;
            txtNewPassword1.Properties.NullText = field;
            txtNewPassword1.EditValue           = null;
            txtNewPassword2.Properties.NullText = field;
            txtNewPassword2.EditValue           = null;
            LayoutCorrector.ApplySystemFont(this);
            LayoutCorrector.SetStyleController(txtOrganization, LayoutCorrector.ReadOnlyStyleController);
            txtOrganization.ReadOnly = true;
            LayoutCorrector.SetStyleController(txtNewPassword1, LayoutCorrector.MandatoryStyleController);
            LayoutCorrector.SetStyleController(txtNewPassword2, LayoutCorrector.MandatoryStyleController);
            LayoutCorrector.SetStyleController(txtPassword, LayoutCorrector.MandatoryStyleController);
            LayoutCorrector.SetStyleController(txtUserName, LayoutCorrector.ReadOnlyStyleController);
            txtUserName.ReadOnly = true;

            Application.Idle += UpdateLangIndicators;
        }
Example #24
0
        public static string GetDBErrorMessage(int?sqlErrorNumber, string databaseName, string serverName)
        {
            switch (sqlErrorNumber)
            {
            case 15211:
                return(BvMessages.Get("InvalidOldPassword"));

            case 18456:
            case 18450:
            case 18452:
            case 18458:
            case 18459:
            case 18460:
                return(StandardErrorHelper.Error(StandardError.InvalidLogin));

            case 4060:
                return(string.Format(BvMessages.Get("errDatabaseNotFound", "Cannot open database \'{0}\' on server \'{1}\'. Check the correctness of database name."), databaseName, serverName));

            default:
                return(BvMessages.Get("errSQLLoginError", "Cannot connect to SQL server. Check the correctness of SQL connection parameters in the SQL Server tab or SQL server accessibility."));
            }
        }
Example #25
0
        /*public bool ValidateOnChange()
         * {
         *  if (NewPassword != ConfirmPassword)
         *  {
         *      ErrorMessage = Translator.GetMessageString("msgConfirmPasswordError");
         *      return false;
         *  }
         *  var security = new EidssSecurityManager();
         *  var result = security.LogIn(Organization, UserName, OldPassword);
         *  if (result == 0) //authorized
         *  {
         *      return true;
         *  }
         *  else
         *  {
         *      ErrorMessage = SecurityMessages.GetLoginErrorMessage(result);
         *      return false;
         *  }
         * }*/

        public bool Authorize()
        {
            var security = new EidssSecurityManager();
            var result   = security.LogIn(Organization, UserName, Password);

            switch (result)
            {
            case 0:
                EidssUserContext.CurrentLanguage = Cultures.GetLanguageAbbreviation(LanguagePreference);
                System.Web.Security.FormsAuthentication.SetAuthCookie(this.UserName, false);
                return(true);

            case 6:
                int    lockInMinutes = security.GetAccountLockTimeout(this.Organization, this.UserName);
                string err           = BvMessages.Get("ErrLoginIsLocked", "You have exceeded the number of incorrect login attempts. Please try again in {0} minutes.");
                ErrorMessage = string.Format(err, lockInMinutes);
                return(false);

            default:
                ErrorMessage = SecurityMessages.GetLoginErrorMessage(result);
                return(false);
            }
        }
Example #26
0
        public static string GetLoginErrorMessage(long code)
        {
            switch (code)
            {
            case 1:
                return(BvMessages.Get("ErrEmptyUserLogin", "User login can\'t be empty"));

            case 2:
                return(BvMessages.Get("ErrUserNotFound", "User with such login/password is not found."));

            case 3:
                return(BvMessages.Get("ErrLowClientVersion", "The application version doesn\'t correspond to database version. Please install the latest application version."));

            case 4:
                return(BvMessages.Get("ErrLowDatabaseVersion", "The application requires the newest database version. Please upgrade your database to latest database version."));

            case 5:
                return(BvMessages.Get("ErrIncorrectDatabaseVersion", "The database version is absent or in incorrect format. Please upgrade your database to latest database version."));

            case 6:
                var sm = new Security.EidssSecurityManager();
                return(string.Format(BvMessages.Get("ErrLoginIsLocked", "You have exceeded the number of incorrect login attempts. Please try again in {0} minutes."), sm.GetAccountLockTimeout()));

            case 7:
                return(BvMessages.Get("ErrInvalidParameter", "Invalid parameter specified."));

            case 8:
                return(BvMessages.Get("ErrPasswordPolicy", "Unable to update the password. The value provided for the new password does not meet the length, complexity, or history requirement."));

            case 9:
                return(BvMessages.Get("ErrPasswordExpired", "Your password is expired. Please change your password."));

            default:
                return(BvMessages.Get("ErrUnprocessedError"));
            }
        }
Example #27
0
        public LookUpEdit CreateLookUpEdit(IObject obj, string lookupName, List <Tuple <string, string> > columns, object currentValue, bool bBinding)
        {
            var control = new LookUpEdit();

            control.Properties.Columns.Clear();
            if (columns != null && columns.Count > 0)
            {
                control.Properties.Columns.AddRange(
                    columns.Select(c => new LookUpColumnInfo(c.Item1, c.Item2, 74)).ToArray());
            }
            else
            {
                control.Properties.Columns.AddRange(new[]
                {
                    new LookUpColumnInfo("ToStringProp", BvMessages.Get("colName", "Name"), 74)
                });
            }
            PropertyInfo pi = obj.GetType().GetProperty(lookupName);

            if (pi != null)
            {
                var ds = pi.GetValue(obj, null);
                //string identName = "";

                var dsl = ds as IList;
                if ((dsl != null) && dsl.Count > 0)
                {
                    control.Enabled = true;
                    //var dsli = dsl[0] as IObject;
                    //if (dsli != null) identName = dsli.KeyName;
                }
                else
                {
                    control.Enabled = false;
                }

                control.Properties.DataSource    = null;
                control.Properties.DataSource    = ds;
                control.Properties.DisplayMember = "ToStringProp";
                control.Properties.ValueMember   = String.Empty;// identName;
                control.Properties.NullText      = String.Empty;
                control.Properties.ShowDropDown  = ShowDropDown.SingleClick;

                control.DataBindings.Clear();
                var bindProp = lookupName.Replace("Lookup", String.Empty);
                if (bBinding)
                {
                    control.DataBindings.Add("EditValue", obj, bindProp, false, DataSourceUpdateMode.OnPropertyChanged);
                }
            }

            /*
             * control.Properties.Columns.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[]
             *                                      {
             *                                          new LookUpColumnInfo("ToStringProp", BvMessages.Get("colName", "Name"), 74)
             *                                      });
             * PropertyInfo pi = obj.GetType().GetProperty(lookupName);
             * if (pi != null)
             * {
             *  object ds = pi.GetValue(obj, null);
             *
             *  if ((ds as IList).Count == 0)
             *      control.Enabled = false;
             *
             * //if (items != null)
             * //{
             *
             *  //List<object> objectList = new List<object>();
             *
             *  //var s = items.items.GetEnumerator();
             *  //while (s.MoveNext())
             *  //{
             *  //    var item = s.Current;
             *  //    dynamic d = item;
             *
             *  //    objectList.Add(new { Value = d.Key, Name = item.ToString() });
             *  //}
             *  //return CreateLookUpEdit(objectList, items.selectedValue);
             *
             *  control.Properties.DataSource = ds;
             *  control.Properties.DisplayMember = "ToStringProp";
             *  control.Properties.ValueMember = obj.KeyName;
             *  //if (items.dataTextField != null)
             *  //    control.Properties.DisplayMember = items.dataTextField;
             *  //control.Properties.ValueMember = items.dataValueField;
             *
             *  //control.Properties.BestFitMode = BestFitMode.BestFitResizePopup;
             *  control.Properties.SearchMode = SearchMode.AutoComplete;
             *  control.Properties.AutoSearchColumnIndex = 0;
             *  control.Properties.NullText = "";
             *  //control.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
             *  //var v = control.Properties.Columns;
             *
             *  //if (items.selectedValue != null && !string.IsNullOrWhiteSpace(items.selectedValue.ToString()))
             *  //{
             *  //    dynamic val = items.selectedValue;
             *  //    control.EditValue = val.GetValue(control.Properties.ValueMember);
             *  //}
             *  control.Tag = "";
             *
             * }
             */

            AddClearButton(control, true);
            return(control);
        }
Example #28
0
 private static void InvalidRowException(object sender, InvalidRowExceptionEventArgs e)
 {
     e.WindowCaption = BvMessages.Get("Warning");
 }
Example #29
0
        public static string GetText(string labelId)
        {
            string id = labelId;

            return(BvMessages.Get(id, id));
        }
Example #30
0
        private void btnOk_Click(Object sender, EventArgs e)
        {
            string errorMessage  = string.Empty;
            var    errorCode     = -1;
            var    bSuccessLogin = false;

            try
            {
                if (!ValidateArchiveConnection())
                {
                    return;
                }
                if (!ValidateAvrService())
                {
                    return;
                }
                InitConnection();
                bSuccessLogin = DoLogin(m_Manager, txtOrganization.Text, txtUserName.Text, txtPassword.Text, out errorCode);
                if (!bSuccessLogin)
                {
                    switch (errorCode)
                    {
                    case 6:
                        errorMessage = SecurityMessages.GetLoginErrorMessage(errorCode, txtOrganization.Text,
                                                                             txtUserName.Text);
                        break;

                    default:
                        errorMessage = SecurityMessages.GetLoginErrorMessage(errorCode);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                if (SqlExceptionHandler.Handle(ex))
                {
                    m_LoginType = LoginType.Complex;
                    UpdateTabsVisibility();
                    return;
                }
                errorMessage = SqlExceptionMessage.Get(ex);
                if (errorMessage == null)
                {
                    Dbg.Debug("unprocessed error during login: {0}", ex);
                    errorMessage = StandardErrorHelper.Error(StandardError.UnprocessedError);
                }
                else
                {
                    errorMessage = BvMessages.Get(errorMessage);
                }
            }

            if (bSuccessLogin)
            {
                SuccessLogin();
            }
            else
            {
                FailedLogin(errorMessage, errorCode);
            }
        }