예제 #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 dntUser_PositionChanged(object sender, EventArgs e)
        {
            GridView view = (GridView)this.grdUserList.Views[0]; //this.gridView2

            if (this.xtcUser.SelectedTabPage == this.xtpUserDetail)
            {
                string userid = view.GetFocusedRowCellValue("USER_ID").ToString();

                this.GetUserByUserID(userid);
            }
            else
            {
                UiUtility.SetGridFocused(view, DrawFocusRectStyle.RowFocus, true);
            }
        }
예제 #3
0
        private void dntProgram_PositionChanged(object sender, EventArgs e)
        {
            GridView view = (GridView)this.grdProgramList.Views[0]; //this.gridView2

            if (this.xtcProgram.SelectedTabPage == this.xtpProgramDetail)
            {
                string procID = view.GetFocusedRowCellValue("PROG_ID").ToString();

                this.GetProgramByID(procID);
            }
            else
            {
                UiUtility.SetGridFocused(view, DrawFocusRectStyle.RowFocus, true);
            }
        }
예제 #4
0
        private void dntParty_PositionChanged(object sender, EventArgs e)
        {
            try
            {
                GridView view = (GridView)this.grdParty.Views[0]; //this.gridView2

                if (this.xtcParty.SelectedTabPage == this.xtpPartyDetail)
                {
                    string partyID = view.GetFocusedRowCellValue("PARTY_ID").ToString();

                    this.GetBindingParty(partyID);
                }
                else
                {
                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.RowFocus, true);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
예제 #5
0
        private void dntMaterial_PositionChanged(object sender, EventArgs e)
        {
            try
            {
                GridView view = (GridView)this.grdMTLType.Views[0]; //this.gridView2

                if (this.xtcMaterial.SelectedTabPage == this.xtpMTLDetail)
                {
                    string mtltypeid = view.GetFocusedRowCellValue("SEQ_NO").ToString();

                    this.GetBindingMTLType(mtltypeid);
                }
                else
                {
                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.RowFocus, true);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
예제 #6
0
        private void dntQCReturn_PositionChanged(object sender, EventArgs e)
        {
            try
            {
                GridView view = (GridView)this.grdQCReturn.Views[0]; //this.gridView2

                if (this.xtcQCReturnWH.SelectedTabPage == this.xtpQCReturnDetail)
                {
                    string returnNo = view.GetFocusedRowCellValue("RT_NO").ToString();

                    this.GetBindingQcReturn(returnNo);
                }
                else
                {
                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.RowFocus, true);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
예제 #7
0
        private void dntLoadingOrder_PositionChanged(object sender, EventArgs e)
        {
            try
            {
                GridView view = (GridView)this.grdLoadingOrder.Views[0]; //this.gridView2

                if (this.xtcLoadingOrder.SelectedTabPage == this.xtpLoadingOrderDetail)
                {
                    string loadingNo = view.GetFocusedRowCellValue("LOADING_NO").ToString();

                    this.GetBindingLoadingOrder(loadingNo);
                }
                else
                {
                    UiUtility.SetGridFocused(view, DrawFocusRectStyle.RowFocus, true);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
예제 #8
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);
            }
        }
예제 #9
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);
            }
        }