Пример #1
0
        // CheckCondition()
        //       - Check the conditions before transaction
        // Return Value
        //       - Boolean : Return True/False
        // Arguments
        //       - sStep as String  : Step
        //
        private bool CheckCondition(string sStep)
        {
            try
            {
                switch (CmnFunction.RTrim(sStep))
                {
                case "UPDATE":

                    if (cdvFactory.Text == "")
                    {
                        CmnFunction.ShowMsgBox(modLanguageFunction.GetMessage(6), "FMB Client", MessageBoxButtons.OK, 1);
                        cdvFactory.Focus();
                        return(false);
                    }
                    if (lisResource.SelectedItems.Count == 0)
                    {
                        CmnFunction.ShowMsgBox(modLanguageFunction.GetMessage(19) + " (Resource)", "FMB Client", MessageBoxButtons.OK, 1);
                        lisResource.Focus();
                        return(false);
                    }
                    if (lisImagelist.SelectedItems.Count == 0)
                    {
                        CmnFunction.ShowMsgBox(modLanguageFunction.GetMessage(19) + " (Image)", "FMB Client", MessageBoxButtons.OK, 1);
                        lisImagelist.Focus();
                        return(false);
                    }
                    break;

                case "DELETE":

                    if (cdvFactory.Text == "")
                    {
                        CmnFunction.ShowMsgBox(modLanguageFunction.GetMessage(6), "FMB Client", MessageBoxButtons.OK, 1);
                        cdvFactory.Focus();
                        return(false);
                    }
                    if (lisResource.SelectedItems.Count == 0)
                    {
                        CmnFunction.ShowMsgBox(modLanguageFunction.GetMessage(19) + " (Resource)", "FMB Client", MessageBoxButtons.OK, 1);
                        lisResource.Focus();
                        return(false);
                    }
                    break;
                }

                return(true);
            }
            catch (Exception ex)
            {
                CmnFunction.ShowMsgBox("frmFMBViewLotListDetail.CheckCondition()" + "\r\n" + ex.Message, "FMB Client", MessageBoxButtons.OK, 1);
                return(false);
            }
        }
Пример #2
0
        private void btnOK_Click(object sender, System.EventArgs e)
        {
            try
            {
                string sTag = "";
                if (cdvFactory.Text == "")
                {
                    CmnFunction.ShowMsgBox(modLanguageFunction.GetMessage(6), "FMB Client", MessageBoxButtons.OK, 1);
                    cdvFactory.Focus();
                    this.DialogResult = DialogResult.None;
                    return;
                }

                if (cdvLayout.Text == "")
                {
                    CmnFunction.ShowMsgBox(modLanguageFunction.GetMessage(6), "FMB Client", MessageBoxButtons.OK, 1);
                    cdvLayout.Focus();
                    this.DialogResult = DialogResult.None;
                    return;
                }

                if (cboCategory.Text == "")
                {
                    CmnFunction.ShowMsgBox(modLanguageFunction.GetMessage(6), "FMB Client", MessageBoxButtons.OK, 1);
                    cboCategory.Focus();
                    this.DialogResult = DialogResult.None;
                    return;
                }
                if (cboCategory.SelectedIndex == 0)
                {
                    sTag = modGlobalConstant.FMB_CATEGORY_LAYOUT;
                }
                else if (cboCategory.SelectedIndex == 1)
                {
                    sTag = modGlobalConstant.FMB_CATEGORY_GROUP;
                }

                Microsoft.VisualBasic.Interaction.SaveSetting(Application.ProductName, "DefaultLayout", "Category", sTag);
                Microsoft.VisualBasic.Interaction.SaveSetting(Application.ProductName, "DefaultLayout", "Factory", CmnFunction.RTrim(cdvFactory.Text));
                Microsoft.VisualBasic.Interaction.SaveSetting(Application.ProductName, "DefaultLayout", "Layout", CmnFunction.RTrim(cdvLayout.Text));

                CmnFunction.ShowMsgBox(modLanguageFunction.GetMessage(4), "FMB Client", MessageBoxButtons.OK, 1);
            }
            catch (Exception ex)
            {
                CmnFunction.ShowMsgBox("frmFMBSetupDefaultLayout.btnOK_Click()" + "\r\n" + ex.Message, "FMB Client", MessageBoxButtons.OK, 1);
            }
        }