Beispiel #1
0
        TransDef MkTransDef(object trans, object domain, object range, object gexprs)
        {
            var transT     = (FastToken)trans;
            var domainT    = (FastToken)domain;
            var rangeT     = (FastToken)range;
            var gexpr_list = (Cons <GuardedExp>)gexprs;

            var tdef = new TransDef(transT, domainT, rangeT, null);

            foreach (var gexpr in gexpr_list)
            {
                tdef.AddCase(gexpr);
            }

            return(tdef);
        }
Beispiel #2
0
        private void InitialIns()
        {
            DbMaintainment operDb   = new DbMaintainment();
            DataTable      insTable = new DataTable();

            if (operDb.QueryInsInfo(ref insTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                if (null != insTable.Columns[ConstDef.TEXT_CONST_IND_KIND])
                {
                    foreach (DataRow row in insTable.Rows)
                    {
                        int kind = Convert.ToInt32(Judgement.JudgeDBNullValue(row[ConstDef.TEXT_CONST_IND_KIND].ToString(), EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                        row[ConstDef.TEXT_CONST_IND_KIND] = TransDef.MatchInsKindToString((EnumDef.INS_KINDS)kind);
                    }
                }
                dgv.DataSource = insTable;
                if (null != dgv.Columns[DBConstDef.INS_ID])
                {
                    dgv.Columns[DBConstDef.INS_ID].Visible = false;
                }
            }
        }
Beispiel #3
0
        private void InitialSterileArea()
        {
            DbMaintainment operDb     = new DbMaintainment();
            DataTable      queryTable = new DataTable();

            if (operDb.QuerySterileAreaInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                if (null != queryTable.Columns[ConstDef.TEXT_STERILE_AREA_TYPE])
                {
                    foreach (DataRow row in queryTable.Rows)
                    {
                        int type = Convert.ToInt32(Judgement.JudgeDBNullValue(row[ConstDef.TEXT_STERILE_AREA_TYPE].ToString(), EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                        row[ConstDef.TEXT_STERILE_AREA_TYPE] = TransDef.MatchSterileRoomTypeToString((EnumDef.STERILE_ROOM_TYPE)type);
                    }
                }
                dgv.DataSource = queryTable;
                if (null != dgv.Columns[DBConstDef.SI_ID])
                {
                    dgv.Columns[DBConstDef.SI_ID].Visible = false;
                }
            }
        }
Beispiel #4
0
        async Task <ProcessTransactionResponse> IAuthorizerService.ProcessTransactionAsync(TransDef transaction)
        {
            try
            {
                var transResponse = await _internalAuthorizer.ProcessTransactionAsync(transaction);

                await _transactionRepo.AddAsync(transaction);

                await _unitOfWork.CompleteAsync();

                return(new ProcessTransactionResponse(transResponse));
            }
            catch (Exception ex)
            {
                //do some logging stuff
                return(new ProcessTransactionResponse($"An error ocurred processing transaction: {ex.Message}"));
            }
        }
 public async Task AddAsync(TransDef transDef)
 {
     await _context.AddAsync(transDef);
 }