private void Delete()
 {
     if (mtugsbl.M_Gaisya_Delect(mse))
     {
         ChangeMode(OperationMode);
         ScShippingCD.SetFocus(1);
         mtugsbl.ShowMessage("I102");
     }
     else
     {
         mtugsbl.ShowMessage("S001");
     }
 }
        private void InsertUpdate(int mode)
        {
            if (mtugsbl.M_Gaisya_InsertUpdate(mse, mode))
            {
                ChangeMode(OperationMode);
                ScShippingCD.SetFocus(1);

                mtugsbl.ShowMessage("I101");
            }
            else
            {
                mtugsbl.ShowMessage("S001");
            }
        }
        public FrmMasterTouroku_UnsouGaisya()
        {
            InitializeComponent();
            InProgramID = Application.ProductName;

            SetFunctionLabel(EProMode.MENTE);
            StartProgram();

            mtugsbl = new MasterTouroku_UnsouGaisya_BL();

            SetRequireField();

            //SelectNextControl(PanelDetail, true, true, true, true);

            BindCombo();
            ScShippingCD.SetFocus(1);
        }
        public override void FunctionProcess(int index)
        {
            CKM_SearchControl sc = new CKM_SearchControl();

            switch (index + 1)
            {
            case 2:
                ChangeMode(EOperationMode.INSERT);
                break;

            case 3:
                ChangeMode(EOperationMode.UPDATE);
                break;

            case 4:
                ChangeMode(EOperationMode.DELETE);
                break;

            case 5:
                ChangeMode(EOperationMode.SHOW);
                break;

            case 6:
                if (bbl.ShowMessage("Q004") == DialogResult.Yes)
                {
                    ChangeMode(OperationMode);
                    ScShippingCD.SetFocus(1);
                }
                break;

            case 11:
                F11();
                break;

            case 12:
                F12();
                break;
            }
        }
        private void ChangeMode(EOperationMode OperationMode)
        {
            base.OperationMode = OperationMode;
            switch (OperationMode)
            {
            case EOperationMode.INSERT:
                Clear(PanelNormal);
                Clear(PanelCopy);
                Clear(PanelDetail);
                EnablePanel(PanelNormal);
                EnablePanel(PanelCopy);
                DisablePanel(PanelDetail);
                ScShippingCD.SearchEnable     = false;
                ScCopyShippingCD.SearchEnable = true;
                F9Visible          = false;
                F12Enable          = true;
                btnDisplay.Enabled = F11Enable = true;

                break;

            case EOperationMode.UPDATE:
            case EOperationMode.DELETE:
            case EOperationMode.SHOW:
                Clear(PanelNormal);
                Clear(PanelCopy);
                Clear(PanelDetail);
                EnablePanel(PanelNormal);
                DisablePanel(PanelCopy);
                DisablePanel(PanelDetail);
                ScShippingCD.SearchEnable     = true;
                ScCopyShippingCD.SearchEnable = false;
                F9Visible          = true;
                F12Enable          = false;
                btnDisplay.Enabled = F11Enable = true;
                break;
            }
            ScShippingCD.SetFocus(1);
        }
        /// <summary>
        /// Error Check for F11 and F12 btn
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        private bool ErrorCheck(int index)
        {
            mtugsbl = new MasterTouroku_UnsouGaisya_BL();
            if (index == 11)
            {
                if (OperationMode == EOperationMode.INSERT)
                {
                    if (type == 1)//New
                    {
                        if (!RequireCheck(new Control[] { ScShippingCD.TxtCode, ScShippingCD.TxtChangeDate }))
                        {
                            return(false);
                        }

                        //if (ScShippingCD.IsExists())
                        //{
                        //    mtugsbl.ShowMessage("E132");
                        //    ScShippingCD.SetFocus(1);
                        //    return false;
                        //}
                    }
                    else//Copy
                    {
                        if (!RequireCheck(new Control[] { ScShippingCD.TxtCode, ScShippingCD.TxtChangeDate }))
                        {
                            return(false);
                        }

                        if (ScShippingCD.IsExists(1))
                        {
                            mtugsbl.ShowMessage("E132");
                            ScShippingCD.SetFocus(1);
                            return(false);
                        }
                        else
                        {
                            if (!string.IsNullOrWhiteSpace(ScCopyShippingCD.TxtCode.Text))
                            {
                                if (!ScCopyShippingCD.IsExists(1))
                                {
                                    mtugsbl.ShowMessage("E133");
                                    ScCopyShippingCD.SetFocus(1);
                                    return(false);
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (!ScShippingCD.IsExists(1))
                    {
                        mtugsbl.ShowMessage("E133");
                        ScShippingCD.SetFocus(1);
                        return(false);
                    }
                }
            }
            else if (index == 12)
            {
                if (!RequireCheck(new Control[] { ScShippingCD.TxtCode, ScShippingCD.TxtChangeDate }))
                {
                    return(false);
                }

                if (OperationMode == EOperationMode.INSERT)
                {
                    if (ScShippingCD.IsExists(1))
                    {
                        mtugsbl.ShowMessage("E132");
                        ScShippingCD.SetFocus(1);
                        return(false);
                    }
                }

                if (string.IsNullOrWhiteSpace(txtShippingName.Text))
                {
                    mtugsbl.ShowMessage("E102");
                    txtShippingName.Focus();
                    return(false);
                }

                if (string.IsNullOrWhiteSpace(cboIdentity.Text.ToString()))
                {
                    mtugsbl.ShowMessage("E102");
                    cboIdentity.Focus();
                    return(false);
                }

                if (string.IsNullOrWhiteSpace(cboNormalType.Text.ToString()))
                {
                    mtugsbl.ShowMessage("E102");
                    cboNormalType.Focus();
                    return(false);
                }

                //*** Insert Other Error Check
            }
            return(true);
        }