private void frmPOPLabelOption_Load(object sender, EventArgs e)
        {
            try
            {
                this.InitializaLOVData();

                this.BingingItem();


                this.txtTOTAL_OUTER_QTY.EditValue = this.TOTAL_INNER_QTY;

                this.GetLabelOptionList(this.ARRIVAL_NO, this.LINE_NO);

                this.btnSave.Enabled = !this.IsLabelGenerated;

                //set grid to read only
                GridView view = (GridView)this.grdLabelOption.Views[0];
                UiUtility.SetGridReadOnly(view, this.IsLabelGenerated);


                if (!base.DialogIdle.IsRunning)
                {
                    base.DialogIdle.Start();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #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);
            }
        }