Exemplo n.º 1
0
 //功能:读取环节信息
 private static void ReadCase(HandleCase hcase, DataRow Row)
 {
     hcase.strID           = Row["strID"].ToString();
     hcase.strCaseName     = Row["strCaseName"].ToString();
     hcase.nStandardMinute = PageBase.static_ext_int(Row["nStandardMinute"].ToString());
     hcase.strProcessID    = Row["strProcessID"].ToString();
     hcase.nOrder          = PageBase.static_ext_int(Row["nOrder"].ToString());
     hcase.dtPostTime      = Row["dtPostTime"].ToString();
     hcase.X         = PageBase.static_ext_int(Row["X"].ToString());
     hcase.W         = PageBase.static_ext_int(Row["W"].ToString());
     hcase.nCaseType = PageBase.static_ext_int(Row["nCaseType"].ToString());
 }
Exemplo n.º 2
0
        /// <summary>
        /// 更新机车状态,包括当前环节,以及机车状态
        /// </summary>
        /// <returns></returns>
        public static void UpdateJiCheState(int nJiCheID)
        {
            //1.根据机车ID,获得当前环节ID
            lsDatJT6JiChe JiChe = new lsDatJT6JiChe(nJiCheID);

            //2.如果当前环节ID为空,则跳过,否则,根据环节ID,检查下面所有步骤是否整备完毕,如果整备完毕,则切换到下一个环节ID(如果没有,则不改变环节ID)
            if (JiChe.strHandleCaseID != "")
            {
                UpdateJiCheCase(JiChe);
            }

            //3.检查当前机车状态是否为1,如果为1的话,检查该机车是否全部步骤整备完毕,如果整备完毕,设置nState为2
            if (JiChe.nState == 1)
            {
                List <HandleCase> HandleCaseList = HandleCase.getJieCheCaseList(PageBase.static_ext_int(JiChe.ID));
                Boolean           bIsAllHandle   = true;
                for (int i = 0; i < HandleCaseList.Count; i++)
                {
                    if (CheckJiCheCase(JiChe, HandleCaseList[i]) == false)
                    {
                        bIsAllHandle = false;
                        break;
                    }
                }

                if (Lxd.GetCountJt6tpFromJiCheID(JiChe.ID) > 0)
                {
                    bIsAllHandle = false;
                }
                if (JiChe.LocoType == "HXD2B")
                {
                    if (LKJDataAnalysis.GetAllTAB_LKJDataAnalysis(JiChe.ID) <= 0)
                    {
                        bIsAllHandle = false;
                    }
                }
                if (bIsAllHandle)
                {
                    JiChe.nState = 2;
                    PageBase.log("要更新endtime");
                    JiChe.dtHandleEndTime = DateTime.Now;
                    JiChe.Update();
                }
            }
        }
Exemplo n.º 3
0
        //功能:获得机车所有的环节信息
        public static List <HandleCase> getJieCheCaseList(int nJiCheID)
        {
            List <HandleCase> HandleCaseList = new List <HandleCase>();
            string            strSql         = "select * from VIEW_Jt6JicheProcess where jcid = @JiCheID";

            SqlParameter[] sqlParams =
            {
                new SqlParameter("JiCheID", nJiCheID)
            };
            DataTable dtCaseList = SqlHelper.ExecuteDataset(searchmaster.GetSqlConnConfig("57"), CommandType.Text, strSql, sqlParams).Tables[0];

            foreach (DataRow drCase in dtCaseList.Rows)
            {
                HandleCase Case = new HandleCase();
                Case.strID = drCase["caseid"].ToString();
                HandleCaseList.Add(Case);
            }
            return(HandleCaseList);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获得下一个环节
        /// </summary>
        public HandleCase getNextCase(int order, string caseid)
        {
            HandleCase NextCase = null;

            DataTable dtCaseList = HandleCase.GetAllCaseInProcessFromCaseID(caseid);

            if (order < dtCaseList.Rows.Count)//判断是否有下个环节
            {
                if (dtCaseList.Select("nOrder=" + (order + 1))[0]["strID"].ToString() != "")
                {
                    NextCase = new HandleCase(dtCaseList.Select("nOrder=" + (order + 1))[0]["strID"].ToString());
                }
            }
            else
            {
                return(null);
            }
            return(NextCase);
        }
Exemplo n.º 5
0
        private static void CheckNextCase(lsDatJT6JiChe JiChe, HandleCase Case)
        {
            if (CheckJiCheCase(JiChe, Case))
            {
                //更新环节记录
                UpdateCaseRecord(JiChe.ID, JiChe.strHandleCaseID);

                //获得下一个环节信息
                HandleCase NextCase = Case.getNextCase(Case.nOrder, Case.strID);
                if (NextCase != null)
                {
                    PageBase.log("下一个环节" + NextCase.strID);
                    JiChe.strHandleCaseID = NextCase.strID;
                    JiChe.UpdateCaseID();
                    addCaseRecord(JiChe.ID, NextCase.strID);
                    CheckNextCase(JiChe, NextCase);
                }
            }
        }
Exemplo n.º 6
0
 //功能:检查机车某一个环节是否整备完毕
 private static bool CheckJiCheCase(lsDatJT6JiChe JiChe, HandleCase Case)
 {
     return(HandleCase.boolCheckCaseFinish(Case.strID, JiChe.ID));
 }
Exemplo n.º 7
0
        //功能:更新机车环节
        private static void UpdateJiCheCase(lsDatJT6JiChe JiChe)
        {
            HandleCase Case = new HandleCase(JiChe.strHandleCaseID);

            CheckNextCase(JiChe, Case);
        }