コード例 #1
0
        private void ChangeFormState(eFormState fState)
        {
            try
            {
                GridView view = this.grdPickingList.Views[0] as GridView;

                switch (fState)
                {
                case eFormState.Edit:

                    this.dntPickingList.Enabled          = true;
                    this.dntPickingList.TextStringFormat = "      Edit Mode      ";
                    this.dntPickingList.Enabled          = false;

                    this.btnEdit.Enabled   = false;
                    this.btnDelete.Enabled = false;
                    this.btnSave.Enabled   = true;
                    this.btnClose.Enabled  = true;
                    this.btnClose.Text     = "Cancel";

                    this.ddbOptions.Enabled = false;

                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.CellFocus, true);
                    UiUtility.SetGridEditOnly(view, false, "QTY");

                    break;

                case eFormState.ReadOnly:

                    this.dntPickingList.Enabled          = false;
                    this.dntPickingList.TextStringFormat = " Record {0} of {1} ";
                    this.dntPickingList.Enabled          = true;

                    this.btnEdit.Enabled    = true;;
                    this.btnDelete.Enabled  = true;
                    this.btnSave.Enabled    = false;
                    this.btnClose.Enabled   = true;
                    this.btnClose.Text      = "Close";
                    this.ddbOptions.Enabled = true;

                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.CellFocus, true);
                    UiUtility.SetGridEditOnly(view, true, "QTY");

                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #2
0
        private void luePRODUCTION_TYPE_Validated(object sender, EventArgs e)
        {
            LookUpEdit control = sender as LookUpEdit;
            GridView   view    = (GridView)this.grdProdProcess.Views[0];

            if (control != null)
            {
                switch (control.EditValue.ToString().ToUpper())
                {
                case "H":
                    //disable Grid
                    for (int i = 0; i < view.RowCount; i++)
                    {
                        if (i.Equals(0))
                        {
                            view.SetRowCellValue(i, "REC_STAT", true);
                            view.SetRowCellValue(i, "FLAG", 2);
                        }
                        else
                        {
                            view.SetRowCellValue(i, "REC_STAT", false);
                            view.SetRowCellValue(i, "FLAG", 1);
                        }
                    }
                    view.OptionsBehavior.Editable = false;
                    UiUtility.SetGridReadOnly(view, true);

                    break;

                default:
                    UiUtility.SetGridEditOnly(view, true, 1);
                    view.OptionsBehavior.Editable = true;
                    break;
                }
            }
        }
コード例 #3
0
        private void ChangeFormState(eFormState fState)
        {
            try
            {
                GridView view = (GridView)this.grdRole.Views[0];

                switch (fState)
                {
                case eFormState.Add:

                    //Lock Main menu
                    ((frmMainMenu)this.ParentForm).LockMenu = true;

                    this.xtpUserList.PageEnabled = false;

                    this.ChangeControlStatus(false);

                    UiUtility.SetGridEditOnly(view, true, 0);
                    view.Columns[2].OptionsColumn.AllowEdit = true;

                    this.dntUser.TextStringFormat  = "      Add Mode      ";
                    this.dntUser.Enabled           = false;
                    this.btnAssignUserRole.Enabled = true;
                    this.btnEdit.Enabled           = false;
                    this.btnSave.Enabled           = true;

                    this.btnCancel.Text = "Cancel";

                    break;

                case eFormState.Edit:

                    ((frmMainMenu)this.ParentForm).LockMenu = true;

                    this.xtpUserList.PageEnabled = false;


                    this.ChangeControlStatus(false);
                    //set for read only again
                    this.txtUSER_ID.Properties.ReadOnly = true;

                    UiUtility.SetGridEditOnly(view, true, 0);
                    view.Columns[2].OptionsColumn.AllowEdit = true;

                    this.dntUser.TextStringFormat  = "      Edit Mode      ";
                    this.dntUser.Enabled           = false;
                    this.btnAssignUserRole.Enabled = true;
                    this.btnEdit.Enabled           = false;
                    this.btnSave.Enabled           = true;

                    this.btnCancel.Text = "Cancel";

                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.CellFocus, true);

                    break;

                case eFormState.ReadOnly:

                    ((frmMainMenu)this.ParentForm).LockMenu = false;

                    this.ChangeControlStatus(true);

                    view.Columns[2].OptionsColumn.AllowEdit = false;

                    UiUtility.SetGridReadOnly(view, true);

                    this.dntUser.TextStringFormat  = " Record {0} of {1} ";
                    this.dntUser.Enabled           = true;
                    this.btnChangePassword.Enabled = false;
                    this.btnAssignUserRole.Enabled = false;
                    this.btnEdit.Enabled           = true;;
                    this.btnSave.Enabled           = false;

                    this.btnCancel.Text = "Back";

                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.RowFocus, true);

                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #4
0
        private void ChangeFormState(eFormState fState)
        {
            try
            {
                GridView view = (GridView)this.grdProdProcess.Views[0];

                switch (fState)
                {
                case eFormState.Add:
                    //Lock Main menu
                    ((frmMainMenu)this.ParentForm).LockMenu = true;

                    this.ChangeControlState(false);

                    this.dntProduct.Enabled = true;

                    this.dntProduct.TextStringFormat = "      Add Mode      ";
                    this.dntProduct.Enabled          = false;

                    this.btnEdit.Enabled   = false;
                    this.btnSave.Enabled   = true;
                    this.btnCancel.Enabled = true;
                    this.btnCancel.Text    = "&Cancel";

                    view.OptionsBehavior.Editable = true;

                    break;

                case eFormState.Edit:

                    ((frmMainMenu)this.ParentForm).LockMenu = true;

                    this.ChangeControlState(false);

                    this.dntProduct.Enabled = true;

                    this.dntProduct.TextStringFormat = "      Edit Mode      ";
                    this.dntProduct.Enabled          = false;

                    this.btnEdit.Enabled   = false;
                    this.btnSave.Enabled   = true;
                    this.btnCancel.Enabled = true;
                    this.btnCancel.Text    = "&Cancel";

                    if (this.luePRODUCTION_TYPE.EditValue != null)
                    {
                        switch (this.luePRODUCTION_TYPE.EditValue.ToString().ToUpper())
                        {
                        case "H":
                            view.OptionsBehavior.Editable = false;
                            UiUtility.SetGridReadOnly(view, true);
                            break;

                        default:
                            view.OptionsBehavior.Editable = true;
                            UiUtility.SetGridEditOnly(view, true, 1);
                            break;
                        }
                    }


                    break;

                case eFormState.ReadOnly:

                    ((frmMainMenu)this.ParentForm).LockMenu = false;

                    this.ChangeControlState(true);

                    this.dntProduct.Enabled = false;

                    this.dntProduct.TextStringFormat = " Record {0} of {1} ";
                    this.dntProduct.Enabled          = true;

                    this.btnEdit.Enabled   = true;;
                    this.btnSave.Enabled   = false;
                    this.btnCancel.Enabled = true;
                    this.btnCancel.Text    = "&Back";

                    view.OptionsBehavior.Editable = false;

                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
コード例 #5
0
        private void ChangeFormState(eFormState fState)
        {
            try
            {
                GridView view = (GridView)this.grdProgramType.Views[0];

                switch (fState)
                {
                case eFormState.Add:
                    //Lock Main menu
                    ((frmMainMenu)this.ParentForm).LockMenu = true;

                    //set readonly status for grdInvoiceDetail

                    view.OptionsBehavior.Editable            = true;
                    view.Columns[0].OptionsColumn.ReadOnly   = false;
                    view.Columns[0].OptionsColumn.AllowEdit  = true;
                    view.Columns[0].OptionsColumn.AllowFocus = true;

                    this.dntProgramType.TextStringFormat = "      Add Mode      ";
                    this.dntProgramType.Enabled          = false;

                    this.btnEdit.Enabled   = false;
                    this.btnSave.Enabled   = true;
                    this.btnCancel.Enabled = true;

                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.CellFocus, true);

                    break;

                case eFormState.Edit:

                    ((frmMainMenu)this.ParentForm).LockMenu = true;

                    UiUtility.SetGridEditOnly(view, true, 0);

                    view.Columns[1].OptionsColumn.AllowEdit  = true;
                    view.Columns[1].OptionsColumn.AllowFocus = true;

                    this.dntProgramType.TextStringFormat = "      Edit Mode      ";
                    this.dntProgramType.Enabled          = false;

                    this.btnEdit.Enabled   = false;
                    this.btnSave.Enabled   = true;
                    this.btnCancel.Enabled = true;

                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.CellFocus, true);

                    break;

                case eFormState.ReadOnly:

                    ((frmMainMenu)this.ParentForm).LockMenu = false;

                    //set readonly status for grdInvoiceDetail;
                    UiUtility.SetGridReadOnly(view, true);

                    this.dntProgramType.TextStringFormat = " Record {0} of {1} ";
                    this.dntProgramType.Enabled          = true;

                    this.btnEdit.Enabled   = true;;
                    this.btnSave.Enabled   = false;
                    this.btnCancel.Enabled = false;

                    view.OptionsBehavior.Editable = false;
                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.RowFocus, true);

                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }