public string GenBlock()
    {
        string result = "";

        MDLineData oMDLine = new MDLineData();

        oMDLine = oLine.GetLineDataByFactoryID(Convert.ToInt32(ViewState["FactoryID"]));
        if (oMDLine.ListOfLine.Count > 0)
        {
            foreach (MDLineData.CMDLineData oMD in oMDLine.ListOfLine)
            {
                result += "	<div class='col-sm-6 col-md-2'>" + Environment.NewLine;
                result += "        <div class='board-widget-wrap'>" + Environment.NewLine;
                result += "            <a href='" + ResolveClientUrl("~/Production/DataHistory/Quantity/PDQuantityDataMachine.aspx?ld_id=" + oMD.ld_id + "&FactoryID=" + ViewState["FactoryID"].ToString()) + "'><i class='icon-tree'></i>" + Environment.NewLine;
                result += "                <span class='board-widget-label'>" + oMD.ld_linename + " </span>" + Environment.NewLine;
                result += "                <span class='board-widget-intro'>M/C Qty: " + oMD.MachineTotal + "</span>" + Environment.NewLine;
                result += "            </a>" + Environment.NewLine;
                result += "        </div>" + Environment.NewLine;
                result += "    </div>" + Environment.NewLine;
            }
        }


        return(result);
    }
Ejemplo n.º 2
0
    public MDLineData GetLineDataByFactoryID(int FactoryID)
    {
        MDLineData oMDLine = new MDLineData();
        DataTable  dTable  = new DataTable();
        SqlCommand sql     = new SqlCommand();

        sql.CommandText += "SELECT ld.ld_id,ld_linename,ld.FactoryID,fac.FactoryName";
        sql.CommandText += " ,Count(mc.mc_code) as MachineTotal";
        sql.CommandText += " FROM LineData ld";
        sql.CommandText += " LEFT JOIN FactoryData fac ON ld.FactoryID = fac.FactoryID";
        sql.CommandText += " LEFT JOIN Machine mc ON ld.ld_id = mc.ld_id";
        sql.CommandText += " WHERE ld.FactoryID = @FactoryID";
        sql.CommandText += " GROUP BY ld_order,ld.ld_id,ld_linename,ld.FactoryID,fac.FactoryName";
        sql.Parameters.Add(new SqlParameter("@FactoryID", FactoryID));
        dTable = oConn.Query(sql);
        if (dTable.Rows.Count > 0)
        {
            foreach (DataRow row in dTable.Rows)
            {
                MDLineData.CMDLineData oMD = new MDLineData.CMDLineData();
                oMD.ld_id        = row["ld_id"] != DBNull.Value ? Convert.ToInt32(row["ld_id"]) : 0;
                oMD.ld_linename  = row["ld_linename"].ToString();
                oMD.FactoryID    = row["FactoryID"] != DBNull.Value ? Convert.ToInt32(row["FactoryID"]) : 0;
                oMD.FactoryName  = row["FactoryName"].ToString();
                oMD.MachineTotal = row["MachineTotal"] != DBNull.Value ? Convert.ToInt32(row["MachineTotal"]) : 0;
                oMDLine.ListOfLine.Add(oMD);
            }
        }
        return(oMDLine);
    }
Ejemplo n.º 3
0
    public MDLineData GetLineDataByLineID(int ld_id)
    {
        MDLineData oMDLine = new MDLineData();
        DataTable  dTable  = new DataTable();
        SqlCommand sql     = new SqlCommand();

        sql.CommandText += "SELECT ld_id,ld_linename,ld.FactoryID,fac.FactoryName,ld_order,ld_createby";
        sql.CommandText += " ,ld_createdate,ld_updateby,ld_updatedate";
        sql.CommandText += " FROM LineData ld";
        sql.CommandText += " LEFT JOIN FactoryData fac ON ld.FactoryID = fac.FactoryID";
        sql.CommandText += " WHERE ld_id=@ld_id";
        sql.Parameters.Add(new SqlParameter("@ld_id", ld_id));
        dTable = oConn.Query(sql);
        if (dTable.Rows.Count > 0)
        {
            foreach (DataRow row in dTable.Rows)
            {
                MDLineData.CMDLineData oMD = new MDLineData.CMDLineData();
                oMD.ld_id         = row["ld_id"] != DBNull.Value ? Convert.ToInt32(row["ld_id"]) : 0;
                oMD.ld_linename   = row["ld_linename"].ToString();
                oMD.FactoryID     = row["FactoryID"] != DBNull.Value ? Convert.ToInt32(row["FactoryID"]) : 0;
                oMD.FactoryName   = row["FactoryName"].ToString();
                oMD.ld_order      = row["ld_order"] != DBNull.Value ? Convert.ToInt32(row["ld_order"]) : 0;
                oMD.ld_createby   = row["ld_createby"].ToString();
                oMD.ld_createdate = row["ld_createdate"].ToString();
                oMD.ld_updateby   = row["ld_updateby"].ToString();
                oMD.ld_updatedate = row["ld_updatedate"].ToString();
                oMDLine.ListOfLine.Add(oMD);
            }
        }
        return(oMDLine);
    }
    private void InitialControl()
    {
        oGenControl.GenDDLModel(CGeneral.TypeSelect.Please, ddlModel);

        MDFactory  oMDFactory  = new MDFactory();
        MDLineData oMDLineData = new MDLineData();
        MDMachine  oMDMachine  = new MDMachine();

        oMDFactory  = oFactory.GetFactoryByFactoryID(ViewState["FactoryID"].ToString());
        oMDLineData = oLineData.GetLineDataByLineID(Convert.ToInt32(ViewState["ld_id"]));
        oMDMachine  = oMachine.GetMachineBymc_code(ViewState["mc_code"].ToString());

        if (oMDFactory.ListOfFactory.Count > 0)
        {
            lbFactory.Text = oMDFactory.ListOfFactory[0].FactoryName;
        }
        if (oMDLineData.ListOfLine.Count > 0)
        {
            lbPDLine.Text = oMDLineData.ListOfLine[0].ld_linename;
        }
        if (oMDMachine.ListOfmachine.Count > 0)
        {
            lbMachine.Text = oMDMachine.ListOfmachine[0].mc_code + " " + oMDMachine.ListOfmachine[0].mc_name;
        }
    }
Ejemplo n.º 5
0
    public string GenBlock()
    {
        string result = "";

        MDLineData oMDLine = new MDLineData();

        oMDLine = oLine.GetLineMonitoringByFactoryID(Convert.ToInt32(ViewState["FactoryID"]));
        if (oMDLine.ListOfLine.Count > 0)
        {
            foreach (MDLineData.CMDLineData oMD in oMDLine.ListOfLine)
            {
                if (oMD.ld_id == 5)
                {
                    result += "	<div class='col-sm-6 col-md-2'>" + Environment.NewLine;
                    result += "        <div class='board-widget-wrap'>" + Environment.NewLine;
                    result += "            <a href='" + ResolveClientUrl("~/Monitoring/MainAssyMonitor.aspx") + "'><i class='icon-tree'></i>" + Environment.NewLine;
                    result += "                <span class='board-widget-label'>Main Assembly: Productivity </span>" + Environment.NewLine;
                    //result += "                <span class='board-widget-intro'>M/C Qty: " + oMD.MachineTotal + "</span>" + Environment.NewLine;
                    result += "            </a>" + Environment.NewLine;
                    result += "        </div>" + Environment.NewLine;
                    result += "    </div>" + Environment.NewLine;

                    result += "	<div class='col-sm-6 col-md-2'>" + Environment.NewLine;
                    result += "        <div class='board-widget-wrap'>" + Environment.NewLine;
                    result += "            <a href='" + ResolveClientUrl("~/Monitoring/ProductivityFac3.aspx") + "'><i class='icon-tree'></i>" + Environment.NewLine;
                    result += "                <span class='board-widget-label'>Productivity Graph </span>" + Environment.NewLine;
                    result += "            </a>" + Environment.NewLine;
                    result += "        </div>" + Environment.NewLine;
                    result += "    </div>" + Environment.NewLine;

                    result += "	<div class='col-sm-6 col-md-2'>" + Environment.NewLine;
                    result += "        <div class='board-widget-wrap'>" + Environment.NewLine;
                    result += "            <a href='" + ResolveClientUrl("~/DataHistory/ProductivityFac3History.aspx") + "'><i class='icon-tree'></i>" + Environment.NewLine;
                    result += "                <span class='board-widget-label'>Productivity History </span>" + Environment.NewLine;
                    result += "            </a>" + Environment.NewLine;
                    result += "        </div>" + Environment.NewLine;
                    result += "    </div>" + Environment.NewLine;
                }
                else
                {
                    result += "	<div class='col-sm-6 col-md-2'>" + Environment.NewLine;
                    result += "        <div class='board-widget-wrap'>" + Environment.NewLine;
                    if (oMD.ld_id >= 1 && oMD.ld_id <= 4)
                    {
                        result += "            <a href='" + ResolveClientUrl("~/Monitoring/ETDMeasurementTool.aspx?ld_id=" + oMD.ld_id + "&FactoryID=" + ViewState["FactoryID"].ToString()) + "'><i class='icon-tree'></i>" + Environment.NewLine;
                        result += "                <span class='board-widget-label'>" + oMD.ld_linename + " </span>" + Environment.NewLine;
                    }
                    else if (oMD.ld_id >= 7 && oMD.ld_id <= 10)
                    {
                        result += "            <a href='" + ResolveClientUrl("~/Trends Data/DailyReport.aspx?ld_id=" + oMD.ld_id + "&FactoryID=" + ViewState["FactoryID"].ToString()) + "'><i class='icon-tree'></i>" + Environment.NewLine;
                        result += "                <span class='board-widget-label'>" + oMD.ld_linename + " </span>" + Environment.NewLine;
                    }
                    result += "            </a>" + Environment.NewLine;
                    result += "        </div>" + Environment.NewLine;
                    result += "    </div>" + Environment.NewLine;
                }
            }
        }


        return(result);
    }
Ejemplo n.º 6
0
    public string GenBlock()
    {
        string result = "";

        MDLineData oMDLine = new MDLineData();

        oMDLine = oLine.GetLineDataByFactoryID(Convert.ToInt32(ViewState["FactoryID"]));
        if (oMDLine.ListOfLine.Count > 0)
        {
            foreach (MDLineData.CMDLineData oMD in oMDLine.ListOfLine)
            {
                if (oMD.ld_id == 25 || oMD.ld_id == 26) // Alarm History and Alarm History Detail
                {
                    continue;
                }

                result += "	<div class='col-sm-6 col-md-2'>" + Environment.NewLine;
                result += "        <div class='board-widget-wrap'>" + Environment.NewLine;
                if (oMD.ld_id >= 12 && oMD.ld_id <= 15) //etd
                {
                    result += "            <a href='" + ResolveClientUrl("~/DataHistory/MstDataHistory.aspx?ld_id=" + oMD.ld_id + "&FactoryID=" + ViewState["FactoryID"].ToString()) + "'><i class='icon-tree'></i>" + Environment.NewLine;
                    result += "                <span class='board-widget-label'>" + oMD.ld_linename + " </span>" + Environment.NewLine;
                    result += "                <span class='board-widget-intro'>ElectronicData Measurement Tool</span>" + Environment.NewLine;
                }
                else if (oMD.ld_id == 11) //mecha fac 3
                {
                    result += "            <a href='" + ResolveClientUrl("~/DataHistory/MstDataHistory2.aspx?ld_id=" + oMD.ld_id + "&FactoryID=" + ViewState["FactoryID"].ToString()) + "'><i class='icon-tree'></i>" + Environment.NewLine;
                    result += "                <span class='board-widget-label'>" + oMD.ld_linename + " </span>" + Environment.NewLine;
                    result += "                <span class='board-widget-intro'>M/C Qty: 10</span>" + Environment.NewLine;
                }
                else if (oMD.ld_id >= 17 && oMD.ld_id <= 20)                 //leak
                {
                    result += "            <a href='" + ResolveClientUrl("~/DataHistory/DataLeakcheck.aspx?ld_id=" + oMD.ld_id + "&FactoryID=" + ViewState["FactoryID"].ToString()) + "'><i class='icon-tree'></i>" + Environment.NewLine;
                    result += "                <span class='board-widget-label'>" + oMD.ld_linename + " </span>" + Environment.NewLine;
                    result += "                <span class='board-widget-intro'>Leak Check</span>" + Environment.NewLine;
                }
                else if (oMD.ld_id == 8 || oMD.ld_id == 9)
                {
                    result += "            <a href='" + ResolveClientUrl("~/DataHistory/DataMachine.aspx?ld_id=" + oMD.ld_id + "&FactoryID=" + ViewState["FactoryID"].ToString()) + "'><i class='icon-tree'></i>" + Environment.NewLine;
                    result += "                <span class='board-widget-label'>" + oMD.ld_linename + " </span>" + Environment.NewLine;
                    result += "                <span class='board-widget-intro'>M/C Qty: " + oMD.MachineTotal + "</span>" + Environment.NewLine;
                }
                else if (oMD.ld_id == 21)
                {
                    result += "            <a href='" + ResolveClientUrl("~/DataHistory/DataQC.aspx?ld_id=" + oMD.ld_id + "&FactoryID=" + ViewState["FactoryID"].ToString()) + "'><i class='icon-tree'></i>" + Environment.NewLine;
                    result += "                <span class='board-widget-label'>" + oMD.ld_linename + " </span>" + Environment.NewLine;
                    result += "                <span class='board-widget-intro'>QC Temp Data</span>" + Environment.NewLine;
                }
                else
                {
                    result += "            <a href='" + ResolveClientUrl("~/DataHistory/DataHistoryMain.aspx?ld_id=" + oMD.ld_id) + "'><i class='icon-tree'></i>" + Environment.NewLine;
                    result += "                <span class='board-widget-label'>" + oMD.ld_linename + " </span>" + Environment.NewLine;
                    result += "                <span class='board-widget-intro'>M/C Qty: " + oMD.MachineTotal + "</span>" + Environment.NewLine;
                }

                result += "            </a>" + Environment.NewLine;
                result += "        </div>" + Environment.NewLine;
                result += "    </div>" + Environment.NewLine;
            }

            try
            {
                if (Convert.ToInt32(ViewState["FactoryID"]) == 3)
                {
                    divCR.Visible          = true;
                    divCRPallet.Visible    = true;
                    divAlarm.Visible       = true;
                    divAlarmDetail.Visible = true;
                }
                else
                {
                    divCR.Visible          = false;
                    divCRPallet.Visible    = false;
                    divAlarm.Visible       = false;
                    divAlarmDetail.Visible = false;
                }
            }
            catch (Exception)
            {
            }
        }


        return(result);
    }