private void btnLang_Click(object sender, EventArgs e)
 {
     if (ComVar.Var._strValue3 == "Vi")
     {
         btnLang.BackgroundImage = Properties.Resources.enSel;
         btnLangClick            = 0;
         ComVar.Var._strValue3   = "En";
         foreach (UserControl c in this.tblMain2.Controls)
         {
             UC.UC_MENU_DSF_2 MENU_WS = null;
             MENU_WS = (UC.UC_MENU_DSF_2)c;
             MENU_WS.Animation("En", c);
         }
     }
     else
     {
         btnLang.BackgroundImage = Properties.Resources.VieSel;
         ComVar.Var._strValue3   = "Vi";
         foreach (UserControl c in this.tblMain2.Controls)
         {
             UC.UC_MENU_DSF_2 MENU_WS = null;
             MENU_WS = (UC.UC_MENU_DSF_2)c;
             MENU_WS.Animation("Vi", c);
         }
     }
 }
        private void timer2_Tick(object sender, EventArgs e)
        {
            try
            {
                if (lockTimerCounterN == 0)
                {
                    int iLine = 0;
                    foreach (UserControl c in this.tblMain2.Controls)
                    {
                        if (iLine > 2)
                        {
                            break;
                        }
                        else
                        {
                            UC.UC_MENU_DSF_2 MENU_WS = null;
                            MENU_WS = (UC.UC_MENU_DSF_2)c;
                            MENU_WS.changeColor();
                            MENU_WS.UpdateText(iLine);
                            lockTimerCounter--;
                        }

                        iLine++;
                    }
                }
            }
            catch
            {
            }
        }
Beispiel #3
0
        private void cmd_NosN_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                ComVar.Var._strValue1 = "099";
                lang = ComVar.Var._strValue3;
                lblTitle.Text = _dtnInit["Title"];
                if (ComVar.Var._strValue3 == "Vi")
                {
                    btnLang.BackgroundImage = Properties.Resources.VieSel;
                }
                else
                {
                    btnLang.BackgroundImage = Properties.Resources.enSel;
                    ComVar.Var._strValue3 = "En";

                }

                DataTable dt = dtPUPLayout();
                DataTable dtModel = SEL_MODEL_NAME("Q", "099", "099");
                if (ccountN == 0)
                {
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            DataTable dtOS = SEL_PROD_MDI(dt.Rows[i]["LINE_CD"].ToString(), dt.Rows[i]["LINE_CD1"].ToString());
                            UC.UC_MENU_DSF_2 MENU_WS = new UC.UC_MENU_DSF_2(dt.Rows[i]["LINE_NM"].ToString(), dt.Rows[i]["LINE_CD"].ToString(), dt.Rows[i]["LINE_CD1"].ToString());
                            MENU_WS.Animation(lang, MENU_WS);
                            tblMain2.Controls.Add(MENU_WS, Convert.ToInt32(dt.Rows[i]["LOC_COL"]), Convert.ToInt32(dt.Rows[i]["LOC_ROW"]));
                            MENU_WS.BindingData(dtOS, i, dtModel);
                            dtOS = null;
                            MENU_WS.OnMenuClick += MenuOnClick;
                            MENU_WS.MoveLeave += MoveLeaveClick;
                            MENU_WS.Dock = DockStyle.Fill;
                          //  MENU_WS.GetImage(dt, i);
                        }
                    }
                    loadLinePicture("099");
                }
                else
                {

                    foreach (UserControl c in this.tblMain2.Controls)
                    {
                        UC.UC_MENU_DSF_2 MENU_WS = null;
                        MENU_WS = (UC.UC_MENU_DSF_2)c;
                        MENU_WS.Animation(lang, c);
                    }
                }

                ccountN++;
                selectNos();
            }
            catch { }
            finally { this.Cursor = Cursors.Default; }
        }
Beispiel #4
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     try
     {
         lblDateTime.Text = string.Format(DateTime.Now.ToString("yyyy-MM-dd\nHH:mm:ss"));
         _iCount++;
         if (_iCount >= 30)
         {
             DataTable dt = dtPUPLayout();
             if (ComVar.Var._strValue1 != "099")
             {
                 if (dt != null && dt.Rows.Count > 0)
                 {
                     int iLine = 0;
                     foreach (UserControl c in this.tblMain1.Controls)
                     {
                         DataTable dtOS = SEL_PROD_MDI(dt.Rows[iLine]["LINE_CD"].ToString(), dt.Rows[iLine]["LINE_CD1"].ToString());
                         UC.UC_MENU_DSF MENU_WS = null;
                         MENU_WS = (UC.UC_MENU_DSF)c;
                         MENU_WS.BindingData(dtOS, iLine, dtModel);
                         iLine++;
                     }
                     _iCount = 0;
                 }
             }
             else if (ComVar.Var._strValue1 == "099")
             {
                 if (dt != null && dt.Rows.Count > 0)
                 {
                     int iLine = 0;
                     foreach (UserControl c in this.tblMain2.Controls)
                     {
                         DataTable dtOS = SEL_PROD_MDI(dt.Rows[iLine]["LINE_CD"].ToString(), dt.Rows[iLine]["LINE_CD1"].ToString());
                         UC.UC_MENU_DSF_2 MENU_WS = null;
                         MENU_WS = (UC.UC_MENU_DSF_2)c;
                         MENU_WS.BindingData(dtOS, iLine, dtModel);
                        iLine++;
                     }
                     _iCount = 0;
                 }
             }
             else
             {
                 Init_Form();
             }
             _iCount = 0;
         }
     }
     catch
     {
     }
 }
Beispiel #5
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            try
            {
                if (ComVar.Var._strValue1 != "099")
                {
                        int iLine = 0;
                        foreach (UserControl c in this.tblMain1.Controls)
                        {
                            UC.UC_MENU_DSF MENU_WS = null;
                            MENU_WS = (UC.UC_MENU_DSF)c;
                            MENU_WS.changeColor();
                            MENU_WS.UpdateText(iLine);
                            iLine++;
                    }
                }
                else
                {
                    if (lockTimerCounterN == 0)
                    {
                        int iLine = 0;
                        foreach (UserControl c in this.tblMain2.Controls)
                        {
                            UC.UC_MENU_DSF_2 MENU_WS = null;
                            MENU_WS = (UC.UC_MENU_DSF_2)c;
                            MENU_WS.changeColor();
                            MENU_WS.UpdateText(iLine);
                            lockTimerCounter--;
                            iLine++;

                        }
                    }
                }
            }
            catch
            {
            }
        }
        private void DIGITAL_SHOP_FLOOR_OS_Load(object sender, EventArgs e)
        {
            try
            {
                // down_img("fac_1.PNG");
                // down_img("nos_n1.PNG");
                // cmdBack.Visible = true;
                _dtnInit = ComVar.Func.getInitForm(this.GetType().Assembly.GetName().Name, this.GetType().Name);
                _dtGMES  = ComVar.Func.ReadXML(Application.StartupPath + @"\Config.xml", "GMES");

                this.Cursor = Cursors.WaitCursor;
                //line_cd =  ComVar.Var._strValue1;
                lang          = ComVar.Var._strValue3;
                lblTitle.Text = _dtnInit["Title"];
                if (ComVar.Var._strValue3 == "Vi")
                {
                    btnLang.BackgroundImage = Properties.Resources.VieSel;
                    //  ComVar.Var._strValue3 = "Vi";
                }
                else
                {
                    btnLang.BackgroundImage = Properties.Resources.enSel;
                    ComVar.Var._strValue3   = "En";
                }

                DataTable dt      = dtPUPLayout();
                DataTable dtModel = SEL_MODEL_NAME("Q", "", "");     // "202", "000");
                if (ccountN == 0)
                {
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            //  if (i == 0 || i == 1)
                            //  {
                            DataTable        dtOS    = SEL_PROD_MDI(dt.Rows[i]["LINE_CD"].ToString(), dt.Rows[i]["LINE_CD1"].ToString());
                            UC.UC_MENU_DSF_2 MENU_WS = new UC.UC_MENU_DSF_2(dt.Rows[i]["LINE_NM"].ToString(), dt.Rows[i]["LINE_CD"].ToString(), dt.Rows[i]["LINE_CD1"].ToString(), ComVar.Var._strValue3);
                            MENU_WS.Animation(lang, MENU_WS);
                            tblMain2.Controls.Add(MENU_WS, Convert.ToInt32(dt.Rows[i]["LOC_COL"]), Convert.ToInt32(dt.Rows[i]["LOC_ROW"]));

                            MENU_WS.BindingData(dtOS, i, dtModel);
                            dtOS = null;
                            MENU_WS.OnMenuClick += MenuOnClick;
                            MENU_WS.MoveLeave   += MoveLeaveClick;
                            MENU_WS.Dock         = DockStyle.Fill;
                            MENU_WS.GetImage(dt, i);
                            //}
                            //else //Khong can Binding.
                            //{
                            //    UC.UC_MENU_DSF_2 MENU_WS = new UC.UC_MENU_DSF_2();
                            //    tblMain2.Controls.Add(MENU_WS, Convert.ToInt32(dt.Rows[i]["LOC_COL"]), Convert.ToInt32(dt.Rows[i]["LOC_ROW"]));
                            //    MENU_WS.OnMenuClick += MenuOnClick;
                            //    MENU_WS.MoveLeave += MoveLeaveClick;
                            //    MENU_WS.GetImage(dt, i);
                            //    MENU_WS.Dock = DockStyle.Fill;
                            //}
                        }
                    }
                }
                else
                {
                    foreach (UserControl c in this.tblMain2.Controls)
                    {
                        UC.UC_MENU_DSF_2 MENU_WS = null;
                        MENU_WS = (UC.UC_MENU_DSF_2)c;
                        MENU_WS.Animation(lang, c);
                    }
                }

                ccountN++;
                selectNos();
            }
            catch (Exception ex)
            {
                ComVar.Var.writeToLog(this.Name + "/Form_Load  :   " + ex.ToString());
            }
            finally { this.Cursor = Cursors.Default; }
        }