Ejemplo n.º 1
0
        /// <summary>
        /// 進捗データ取得
        /// </summary>
        /// <param name="dpyno">伝票No</param>
        /// <param name="process">工程コード</param>
        /// <remarks>
        /// 作成者    :  sesaki
        /// 作成日    :  2019/09/24
        /// </remarks>
        private void GetMgmt(string dpyno, string process)
        {
            DataSet  dtSet    = null;
            DataBase dataBase = null;

            try
            {
                dataBase = new DataBase();
                List <object> paraList = new List <object>();
                string        sqlStr   = QueryBuild.GetSappanMgmt(dpyno, ref paraList);


                dataBase.ConnectDB();
                dtSet = dataBase.GetDataSet(sqlStr, paraList.ToArray());

                dataBase.DisconnectDB();

                foreach (DataRow row in dtSet.Tables[0].Rows)
                {
                    string cd           = row["PROCESS_CD"].ToString();
                    bool   disabled_flg = (cd != process);
                    switch (cd)
                    {
                    case Constants.PROCESS_SPNSEIZO:
                        Sappans = new Register(row, disabled_flg);
                        break;

                    case Constants.PROCESS_SPNKENSA:
                        Sappank = new Register(row, disabled_flg);
                        break;

                    case Constants.PROCESS_HENSHU:
                        switch (row["SUBPROCESS_CD"].ToString())
                        {
                        case Constants.PROCESS_SUB1:
                            Henshus = new Register(row, disabled_flg);
                            break;

                        case Constants.PROCESS_SUB2:
                            Henshuk = new Register(row, disabled_flg);
                            break;

                        default:
                            Henshus = new Register(row, disabled_flg);
                            Henshuk = new Register(row, disabled_flg);
                            break;
                        }
                        break;

                    case Constants.PROCESS_KENSA:
                        Kensa = new Register(row, disabled_flg);
                        break;

                    case Constants.PROCESS_GYOUMU:
                        Gyoumu = new Register(row, disabled_flg);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorGetMgmtMessage = Resources.TextResource.ErrorGetMgmt;
            }
            finally
            {
                if (dataBase != null)
                {
                    dataBase.DisconnectDB();
                }
                if (dtSet != null)
                {
                    dtSet.Dispose();
                }
            }
        }