public void initMaintainLine()
    {
            if (iSMTLine != null)
            {
                DataTable dt = iSMTLine.GetSMTLine(connectionString);
                IList<PdLineInfo> lstMaintainLine = new List<PdLineInfo>();
                if (dt.Rows.Count == 0)
                { initControl(null); }
                else
                {

                    foreach (DataRow dr in dt.Rows)
                    {
                        PdLineInfo pdline = new PdLineInfo();
                        pdline.id = dr["Line"].ToString().Trim();
                        pdline.friendlyName = dr["Descr"].ToString().Trim();
                        lstMaintainLine.Add(pdline);

                    }
                }
                if (lstMaintainLine != null && lstMaintainLine.Count != 0)
                {
                    initControl(lstMaintainLine);
                }
                else
                {
                    initControl(null);
                }
            }
            else
            {
                initControl(null);
            }

        }
Example #2
0
    public void initPDLine(string paraStation, string customer)
    {
        if (QueryCommon != null)
        {

            if (string.IsNullOrEmpty(stage))
            { return; }
        //    IList<PdLineInfo> lstPDLine = null;
            IList<PdLineInfo> lstPDLine = new List<PdLineInfo>();
            //Add for Query using...by Benson
            string[] listLine = stage.Split(',');
            List<string> Process = new List<string>();
            foreach (string s in listLine)
            {
                Process.Add(s);
            }

            DataTable dt = QueryCommon.GetLine(Process, customer, isWithoutShift, connectionString);
             if (dt.Rows.Count == 0)
             { initControl(null); ;}
             else
             {
                 if (isWithoutShift)
                 {
                     foreach (DataRow dr in dt.Rows)
                     {
                         PdLineInfo pdline = new PdLineInfo();
                         pdline.id = dr["Line"].ToString().Trim();
                    //     pdline.friendlyName = dr["Line"].ToString().Trim();
                         lstPDLine.Add(pdline);

                     }
                 }
                 else
                 {
                     foreach (DataRow dr in dt.Rows)
                     {
                         PdLineInfo pdline = new PdLineInfo();
                         pdline.id = dr["Line"].ToString().Trim();
                         pdline.friendlyName = dr["Descr"].ToString().Trim();
                         lstPDLine.Add(pdline);

                     }
                 }
              
                 initControl(lstPDLine);
             }
             //return;
            //Add for Query using...by Benson



        //    if (!string.IsNullOrEmpty(customer))
        //    {
        //        if (!string.IsNullOrEmpty(paraStation))
        //        {
        //            lstPDLine = iPDLine.GetPdLineList(paraStation, customer);
        //        }
        //        else
        //        {
        //            lstPDLine = iPDLine.GetPdLineList(customer);
        //        }
        //    }

        //    if (lstPDLine != null && lstPDLine.Count != 0)
        //    {
        //        initControl(lstPDLine);
        //    }
        //    else
        //    {
        //        initControl(null);
        //    }
        }
        else
        {
            initControl(null);
        }
    }