Exemplo n.º 1
0
        private void FRM_SMT_MGL_DSF_VJ2cs_Load(object sender, EventArgs e)
        {
            lblDate.Text = string.Format(DateTime.Now.ToString("yyyy-MM-dd\nHH:mm:ss")); //Gán dữ liệu giờ cho label ngày giờ
                                                                                         // DataTable _dtXML = null;

            //  _dtXML = ComVar.Func.ReadXML(Application.StartupPath + "\\Config.XML", "MAIN");
            isBack = ComVar.Var._IsBack;
            try
            {
                for (int i = 0; i < 5; i++)
                {
                    UC.UC_DSF DSF = new UC.UC_DSF();
                    DSF.TabIndex = i;
                    tblLayout.Controls.Add(DSF, i, 0);
                }


                lblDate.Text = string.Format(DateTime.Now.ToString("yyyy-MM-dd\nHH:mm:ss")); //Gán dữ liệu giờ cho label ngày giờ
                // InitLayout(5);
                setImg(5);
                InitLayout(5);
            }
            catch (Exception ex)
            { }
        }
Exemplo n.º 2
0
 private void setImg(int number)
 {
     for (int i = 0; i < number; i++)
     {
         UC.UC_DSF DSF = (UC.UC_DSF)tblLayout.GetControlFromPosition(i, 0);
         DSF.OnTitleClick += clickMenu;
         DSF.image_name(i);
         DSF.LoadImage_final(i);
     }
 }
Exemplo n.º 3
0
        private void InitLayout(int number)
        {
            DataTable dt = new DataTable();

            dt = PRINTING_OS_PRODUCTION_DATA("Q");
            //for (int i = 0; i < tblLayout.ColumnCount; i++)
            //{
            //    UC.UC_DSF DSF = (UC.UC_DSF)tblLayout.GetControlFromPosition(i, 0);
            //    DSF.OnTitleClick += clickMenu;
            //    DSF.image_name(i);
            //    DSF.LoadImage_final(i);
            //}

            UC.UC_DSF DSF = null;;
            for (int i = 0; i < number; i++)
            {
                // UC.UC_DSF DSF = new UC.UC_DSF();
                // DSF.TabIndex = i;
                // tblLayout.Controls.Add(DSF, i, 0);

                DSF = (UC.UC_DSF)tblLayout.GetControlFromPosition(i, 0);
                // DSF.OnTitleClick += clickMenu;
                //DSF.image_name(i);
                //DSF.LoadImage_final(i);

                //if (i == 0)
                //{
                //    if (dt.Select("TYPE = 'PRINTING'", "").Count() > 0 )
                //    {
                //        DataTable dt_printing = dt.Select("TYPE = 'PRINTING'", "").CopyToDataTable() ;
                //        if(dt_printing.Rows.Count > 0 && dt_printing != null)
                //        {
                //         DSF.BindingData(dt_printing);
                //        }
                //    }
                //}
                //else if (i == 1)
                //{
                //    if (dt.Select("TYPE = 'HF'", "").Count() > 0)
                //    {
                //        DataTable dt_hf = dt.Select("TYPE = 'HF'", "").CopyToDataTable();
                //        if (dt_hf.Rows.Count > 0 && dt_hf != null)
                //        {
                //            DSF.BindingData(dt_hf);
                //        }
                //    }
                //}
                //else if (i == 2)
                //{
                //    if (dt.Select("TYPE = 'LASER'", "").Count() > 0)
                //    {
                //        DataTable dt_laser = dt.Select("TYPE = 'LASER'", "").CopyToDataTable();
                //        if (dt_laser.Rows.Count > 0 && dt_laser != null)
                //        {
                //            DSF.BindingData(dt_laser);
                //        }
                //    }
                //}
                //else if (i == 3)
                //{
                //    if (dt.Select("TYPE = 'NOSEW'", "").Count() > 0)
                //    {
                //        DataTable dt_nosew = dt.Select("TYPE = 'NOSEW'", "").CopyToDataTable();
                //        if (dt_nosew.Rows.Count > 0 && dt_nosew != null)
                //        {
                //            DSF.BindingData(dt_nosew);
                //        }
                //    }
                //}
                //else if (i == 4)
                //{
                //    if (dt.Select("TYPE = 'EMB'", "").Count() > 0)
                //    {
                //        DataTable dt_emb = dt.Select("TYPE = 'EMB'", "").CopyToDataTable();
                //        if (dt_emb.Rows.Count > 0 && dt_emb != null)
                //        {
                //            DSF.BindingData(dt_emb);
                //        }
                //    }
                //}

                DSF.BindingData(dt);
                // DSF.LoadImage_final(i);
                DSF.Dock = DockStyle.Fill;
            }
        }