Ejemplo n.º 1
0
        /// <summary>
        /// 查詢標簽語言
        /// </summary>
        /// <param name="requestValue"></param>
        /// <param name="Data"></param>
        /// <param name="StationReturn"></param>
        public void QueryActionPara(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            OleExec              sfcdb = null;
            T_C_ACTION_PARA      ActionPara;
            List <C_ACTION_PARA> InputList;
            string ID = Data["ID"].ToString().Trim();
            string StationActionID = Data["StationActionID"].ToString().Trim();
            string Name            = Data["Name"].ToString().Trim();

            try
            {
                sfcdb                     = this.DBPools["SFCDB"].Borrow();
                ActionPara                = new T_C_ACTION_PARA(sfcdb, DBTYPE);
                InputList                 = ActionPara.QueryActionPara(ID, StationActionID, Name, sfcdb);
                StationReturn.Status      = StationReturnStatusValue.Pass;
                StationReturn.MessageCode = "MES00000001";
                StationReturn.Data        = InputList;
                this.DBPools["SFCDB"].Return(sfcdb);
            }
            catch (Exception e)
            {
                this.DBPools["SFCDB"].Return(sfcdb);
                throw e;
            }
        }
Ejemplo n.º 2
0
        public void Init(string DisplayName, OleExec SFCDB)
        {
            //生成R_STATION類
            Dictionary <string, object> ret = new Dictionary <string, object>();
            T_R_Station   T        = new T_R_Station(SFCDB, DBType);
            Row_R_Station R        = T.GetRowByDisplayName(DisplayName, SFCDB);
            R_Station     RStation = R.GetDataObject();

            ret["ID"] = RStation.ID;
            ret["DISPLAY_STATION_NAME"] = RStation.DISPLAY_STATION_NAME;
            ret["STATION_NAME"]         = RStation.STATION_NAME;
            ret["FAIL_STATION_ID"]      = RStation.FAIL_STATION_ID;
            ret["FAIL_STATION_FLAG"]    = RStation.FAIL_STATION_FLAG;
            ret["EDIT_TIME"]            = RStation.EDIT_TIME;
            ret["EDIT_EMP"]             = RStation.EDIT_EMP;

            List <object> inputlist = new List <object>();

            ret["InputList"] = inputlist;
            //生成InputActionList類
            List <R_Station_Input> RStationInputList = new List <R_Station_Input>();
            T_R_Station_Input      T_I = new T_R_Station_Input(SFCDB, DBType);

            RStationInputList = T_I.GetRowsByStationID(RStation.ID, SFCDB, true);

            T_R_Input_Action T_A = new T_R_Input_Action(SFCDB, DBType);

            T_R_Station_Action S_A = new T_R_Station_Action(SFCDB, DBType);

            for (int i = 0; i < RStationInputList.Count; i++)
            {
                Dictionary <string, object> input = new Dictionary <string, object>();

                input                        = MakeInput();
                input["ID"]                  = RStationInputList[i].ID;
                input["STATION_ID"]          = RStationInputList[i].STATION_ID;
                input["INPUT_ID"]            = RStationInputList[i].INPUT_ID;
                input["SEQ_NO"]              = RStationInputList[i].SEQ_NO;
                input["REMEMBER_LAST_INPUT"] = RStationInputList[i].REMEMBER_LAST_INPUT;
                input["EDIT_TIME"]           = RStationInputList[i].EDIT_TIME;
                input["EDIT_EMP"]            = RStationInputList[i].EDIT_EMP;
                input["SCAN_FLAG"]           = RStationInputList[i].SCAN_FLAG;
                input["DISPLAY_NAME"]        = RStationInputList[i].DISPLAY_NAME;

                List <object>         daction     = new List <object>();
                List <R_Input_Action> inputaction = new List <R_Input_Action>();
                inputaction = T_A.GetActionByInputID(RStationInputList[i].INPUT_ID.ToString(), SFCDB);
                for (int j = 0; j < inputaction.Count; j++) //R_Input_Action表
                {
                    Dictionary <string, object> dinputaction = new Dictionary <string, object>();

                    dinputaction["ID"]                  = inputaction[j].ID;
                    dinputaction["INPUT_ID"]            = inputaction[j].INPUT_ID;
                    dinputaction["C_STATION_ACTION_ID"] = inputaction[j].C_STATION_ACTION_ID;
                    dinputaction["SEQ_NO"]              = inputaction[j].SEQ_NO;
                    dinputaction["CONFIG_TYPE"]         = inputaction[j].CONFIG_TYPE;
                    dinputaction["CONFIG_VALUE"]        = inputaction[j].CONFIG_VALUE;
                    dinputaction["ADD_FLAG"]            = inputaction[j].ADD_FLAG;
                    dinputaction["EDIT_TIME"]           = inputaction[j].EDIT_TIME;
                    dinputaction["EDIT_EMP"]            = inputaction[j].EDIT_EMP;
                    //  ret["ParaIA"] =;
                    T_R_Station_Action_Para      T_P      = new T_R_Station_Action_Para(SFCDB, DBType);//R_Station_Action_Para 表
                    List <R_Station_Action_Para> ParaList = T_P.GetActionParaByInputActionID(inputaction[j].ID, SFCDB);
                    dinputaction["ParaSA"] = ParaList;
                    T_C_ACTION_PARA      A_P       = new T_C_ACTION_PARA(SFCDB, DBType); //C_ACTION_PAR 表
                    List <C_ACTION_PARA> AParaList = A_P.QueryActionPara(RStationInputList[i].INPUT_ID, SFCDB);
                    dinputaction["ParaSB"] = AParaList;
                    T_c_station_action CS_A      = new T_c_station_action(SFCDB, DBType);//R_Station_Action_Para 表
                    c_station_action   ParaList3 = CS_A.GetActionByID(inputaction[j].C_STATION_ACTION_ID, SFCDB);
                    dinputaction["C_STATION_ACTION"] = ParaList3;

                    daction.Add(dinputaction);
                }


                List <object>           dsaction      = new List <object>();
                List <R_Station_Action> stationaction = new List <R_Station_Action>();//R_Station_Action 表
                stationaction = S_A.GetActionByInputID(RStationInputList[i].ID.ToString(), SFCDB);


                for (int j = 0; j < stationaction.Count; j++) //R_Station_Action 表
                {
                    Dictionary <string, object> dinputaction2 = new Dictionary <string, object>();
                    dinputaction2       = MakeStationAction();
                    dinputaction2["ID"] = stationaction[j].ID;
                    dinputaction2["R_STATION_INPUT_ID"]  = stationaction[j].R_STATION_INPUT_ID;
                    dinputaction2["C_STATION_ACTION_ID"] = stationaction[j].C_STATION_ACTION_ID;
                    dinputaction2["SEQ_NO"]       = stationaction[j].SEQ_NO;
                    dinputaction2["CONFIG_TYPE"]  = stationaction[j].CONFIG_TYPE;
                    dinputaction2["CONFIG_VALUE"] = stationaction[j].CONFIG_VALUE;
                    dinputaction2["ADD_FLAG"]     = stationaction[j].ADD_FLAG;
                    dinputaction2["EDIT_TIME"]    = stationaction[j].EDIT_TIME;
                    dinputaction2["EDIT_EMP"]     = stationaction[j].EDIT_EMP;

                    T_R_Station_Action_Para      T_P2      = new T_R_Station_Action_Para(SFCDB, DBType);//R_Station_Action_Para 表
                    List <R_Station_Action_Para> ParaList2 = T_P2.GetActionParaByStationActionID(stationaction[j].ID, SFCDB);
                    dinputaction2["ParaSA"] = ParaList2;

                    T_C_ACTION_PARA      A_P       = new T_C_ACTION_PARA(SFCDB, DBType);//C_ACTION_PARA 表
                    List <C_ACTION_PARA> AParaList = A_P.QueryActionParaByStation(stationaction[j].C_STATION_ACTION_ID, SFCDB);
                    dinputaction2["ParaSB"] = AParaList;

                    T_c_station_action CS_A      = new T_c_station_action(SFCDB, DBType);//R_Station_Action_Para 表
                    c_station_action   ParaList3 = CS_A.GetActionByID(stationaction[j].C_STATION_ACTION_ID, SFCDB);
                    dinputaction2["C_STATION_ACTION"] = ParaList3;

                    dsaction.Add(dinputaction2);
                }
                input["StationActionList"] = dsaction;

                inputlist.Add(input);
            }

            ret["InputList"] = inputlist;
            T_R_Station_Output      R_O           = new T_R_Station_Output(SFCDB, DBType);//R_Station_Output 表
            List <R_Station_Output> StationOutput = R_O.GetStationOutputByStationID(RStation.ID, SFCDB, true);

            ret["OutputList"] = StationOutput;

            Station = ret;
        }