コード例 #1
0
        public AgentObjectTypeRateDTO GetAgentObjectTypeRateById(int Id)
        {
            AgentObjectTypeRateDTO result = new AgentObjectTypeRateDTO();

            SessionManager.DoWork(session =>
            {
                result = session.Query <AgentObjectTypeRate>().SingleOrDefault(a => a.AgentObjectTypeId == Id).Map <AgentObjectTypeRateDTO>();
                AgentObjectType aot        = session.Query <AgentObjectType>().SingleOrDefault(a => a.Id == result.AgentObjectTypeId);
                result.AgentObjectTypeName = aot.Name;
            });
            return(result);
        }
コード例 #2
0
        public int PutAgentObjectTypeRate(AgentObjectTypeRateDTO obj)
        {
            int result = 0;
            AgentObjectTypeRate agentObjectTypeRate = obj.Map <AgentObjectTypeRate>();

            SessionManager.DoWork(session =>
            {
                session.SaveOrUpdate(agentObjectTypeRate);
                result = 1;
            });
            //SessionManager.DoWork(session => session.SaveOrUpdate(obj));
            return(result);
        }