Esempio n. 1
0
        private void fMain_Load(object sender, EventArgs e)
        {
            panel1.BackgroundImage       = ClientUtils.LoadImage("ImgMain.jpg");
            panel1.BackgroundImageLayout = ImageLayout.Stretch;
            panel3.BackgroundImage       = ClientUtils.LoadImage("ImgFilter.jpg");
            panel3.BackgroundImageLayout = ImageLayout.Stretch;
            panel2.BackgroundImage       = ClientUtils.LoadImage("ImgButton.jpg");
            panel2.BackgroundImageLayout = ImageLayout.Stretch;

            g_sUserID   = ClientUtils.UserPara1;
            g_sExeName  = ClientUtils.fCurrentProject;
            g_sFunction = ClientUtils.fFunctionName;
            g_sProgram  = ClientUtils.fProgramName;

            //==
            this.Text = this.Text + " (" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion.ToString() + ")";
            SajetCommon.SetLanguageControl(this);

            check_privilege();

            //Read Ini File
            SajetInifile sajetInifile1 = new SajetInifile();

            g_sIniFactoryID = sajetInifile1.ReadIniFile(g_sIniFile, "System", "Factory", "0");
            g_sTerminalID   = sajetInifile1.ReadIniFile(g_sIniFile, g_sProgram, "Terminal", "0");


            //Factory
            sSQL = "Select FACTORY_ID,FACTORY_CODE,FACTORY_NAME "
                   + "From SAJET.SYS_FACTORY "
                   + "Where ENABLED = 'Y' "
                   + "Order By Factory_COde ";
            dsTemp = ClientUtils.ExecuteSQL(sSQL);
            string sFind = "";

            for (int i = 0; i <= dsTemp.Tables[0].Rows.Count - 1; i++)
            {
                combFactory.Items.Add(dsTemp.Tables[0].Rows[i]["FACTORY_CODE"].ToString());
                if (g_sIniFactoryID == dsTemp.Tables[0].Rows[i]["FACTORY_ID"].ToString())
                {
                    sFind = dsTemp.Tables[0].Rows[i]["FACTORY_CODE"].ToString();
                }
            }

            if (sFind != "")
            {
                combFactory.SelectedIndex = combFactory.FindString(sFind);
            }
            else
            {
                combFactory.SelectedIndex = 0;
            }
        }
Esempio n. 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (LabTerminal.Text == "")
            {
                MessageBox.Show("Please Choose Terminal", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string sTerminalID = Get_TerminalID();

            if (sTerminalID == "0")
            {
                return;
            }
            SajetInifile sajetInifile1 = new SajetInifile();

            sajetInifile1.WriteIniFile(g_sIniFile, g_sIniSection, "Terminal", sTerminalID);
            sajetInifile1.WriteIniFile(g_sIniFile, "System", "Factory", g_sFCID);
            g_sTerminalID = sTerminalID;
            SajetCommon.Show_Message("Assign Terminal OK", -1);
            DialogResult = DialogResult.OK;
        }
Esempio n. 3
0
        private void fMain_Load(object sender, EventArgs e)
        {
            SajetCommon.SetLanguageControl(this);
            this.Text = this.Text + "( " + SajetCommon.g_sFileVersion + " )";
            tabControl1.SelectedIndex = 0;

            //Read Ini File
            SajetInifile sajetInifile1 = new SajetInifile();

            g_sIniFactoryID = sajetInifile1.ReadIniFile(g_sIniFile, "System", "Factory", "0");
            g_sTerminalID   = sajetInifile1.ReadIniFile(g_sIniFile, g_sIniSection, "Terminal", "0");

            //Factory
            sSQL = "SELECT FACTORY_ID,FACTORY_CODE,FACTORY_NAME "
                   + "FROM SAJET.SYS_FACTORY "
                   + "WHERE ENABLED = 'Y' "
                   + "ORDER BY FACTORY_CODE ";
            dsTemp = ClientUtils.ExecuteSQL(sSQL);

            string sFind = "";

            for (int i = 0; i <= dsTemp.Tables[0].Rows.Count - 1; i++)
            {
                combFactory.Items.Add(dsTemp.Tables[0].Rows[i]["FACTORY_CODE"].ToString());
                if (g_sIniFactoryID == dsTemp.Tables[0].Rows[i]["FACTORY_ID"].ToString())
                {
                    sFind = dsTemp.Tables[0].Rows[i]["FACTORY_CODE"].ToString();
                }
            }
            if (sFind != "")
            {
                combFactory.SelectedIndex = combFactory.FindString(sFind);
            }
            else
            {
                combFactory.SelectedIndex = 0;
            }
        }