Ejemplo n.º 1
0
        /// <summary>
        /// 获取特定的工具夹实体
        /// </summary>
        /// <param name="tongsEntity"></param>
        /// <returns></returns>
        public TongsEntityVo GetTongsEntity(TongsEntity tongsEntity)
        {
            TongsEntityVo   result = new TongsEntityVo();
            TongsEntity     tongs  = tongsEntityDao.selectTongsEntityByCodeAndSeq(tongsEntity);
            TongsDefinition p      = new TongsDefinition();

            p.Code = tongs.Code;
            TongsDefinition tongsDefinition = tongsDefinitionDao.selectTongsDefinitionByCode(p);
            var             ParentType      = typeof(TongsEntity);
            var             Properties      = ParentType.GetProperties();

            foreach (var Propertie in Properties)
            {
                if (Propertie.CanRead && Propertie.CanWrite)
                {
                    Propertie.SetValue(result, Propertie.GetValue(tongs, null), null);
                }
            }
            result.FamilyId = tongsDefinition.FamilyId;
            result.Name     = tongsDefinition.Name;
            result.Model    = tongsDefinition.Model;
            result.PartNo   = tongsDefinition.PartNo;
            result.UserdFor = tongsDefinition.UserdFor;
            result.Upl      = tongsDefinition.Upl;
            result.OwnerId  = tongsDefinition.OwnerId;
            result.Remark   = tongsDefinition.Remark;
            result.PmPeriod = tongsDefinition.PmPeriod;
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取所有工具夹实体
        /// </summary>
        /// <param name="tongsEntity"></param>
        /// <returns></returns>
        public List <TongsEntityVo> GetTongsEntities(TongsEntity tongsEntity)
        {
            List <TongsEntity>   tongsList = tongsEntityDao.selectAllTongsEntitys(tongsEntity).ToList();
            List <TongsEntityVo> result    = new List <TongsEntityVo>(tongsList.Count());

            for (int i = 0; i < tongsList.Count(); i++)
            {
                TongsDefinition p = new TongsDefinition();
                p.Code = tongsList[i].Code;
                TongsDefinition tongsDefinition = tongsDefinitionDao.selectTongsDefinitionByCode(p);
                var             ParentType      = typeof(TongsEntity);
                var             Properties      = ParentType.GetProperties();
                foreach (var Propertie in Properties)
                {
                    if (Propertie.CanRead && Propertie.CanWrite)
                    {
                        Propertie.SetValue(result[i], Propertie.GetValue(tongsList[i], null), null);
                    }
                }
                result[i].FamilyId = tongsDefinition.FamilyId;
                result[i].Name     = tongsDefinition.Name;
                result[i].Model    = tongsDefinition.Model;
                result[i].PartNo   = tongsDefinition.PartNo;
                result[i].UserdFor = tongsDefinition.UserdFor;
                result[i].Upl      = tongsDefinition.Upl;
                result[i].OwnerId  = tongsDefinition.OwnerId;
                result[i].Remark   = tongsDefinition.Remark;
                result[i].PmPeriod = tongsDefinition.PmPeriod;
            }
            return(result);
        }
Ejemplo n.º 3
0
        public string getAllEntity()
        {
            string      token       = TokenHelper.GetTokenJson(HttpContext.Request.Headers["Authorization"]);//利用这个进行数据按部门进行隔离
            TokenInfo   tokenInfo   = JSONHelper.JSONToObject <TokenInfo>(token);
            int         WorkcellId  = tokenInfo.workCell;
            TongsEntity tongsEntity = new TongsEntity();

            tongsEntity.WorkcellId = WorkcellId;
            List <TongsEntityVo> tongsEntities = fixtureService.GetTongsEntities(tongsEntity);

            return(JSONHelper.ObjectToJSON(ResponseUtil.Ok(tongsEntities)));
        }
Ejemplo n.º 4
0
        public string getEntity(string code, int seq)
        {
            string      token       = TokenHelper.GetTokenJson(HttpContext.Request.Headers["Authorization"]);//利用这个进行数据按部门进行隔离
            TokenInfo   tokenInfo   = JSONHelper.JSONToObject <TokenInfo>(token);
            int         WorkcellId  = tokenInfo.workCell;
            TongsEntity tongsEntity = new TongsEntity();

            tongsEntity.WorkcellId = WorkcellId;
            tongsEntity.Code       = code;
            tongsEntity.SeqId      = seq;
            TongsEntityVo result = fixtureService.GetTongsEntity(tongsEntity);

            return(JSONHelper.ObjectToJSON(ResponseUtil.Ok(result)));
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 删除单条夹具实体
 /// </summary>
 /// <param name="id"></param>
 /// <returns>操作状态码</returns>
 public int deleteTongsEntityById(TongsEntity tongsEntity)
 {
     return(BaseDao.Delete <TongsEntity>("DeleteTongsEntityById", tongsEntity));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 更新单条夹具实体内容
 /// </summary>
 /// <param name="tongsEntity"></param>
 /// <returns>操作状态码</returns>
 public int updateTongsEntity(TongsEntity tongsEntity)
 {
     return(BaseDao.Update <TongsEntity>("UpdateTongsEntity", tongsEntity));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 插入单条夹具实体内容
 /// </summary>
 /// <param name="tongsEntity"></param>
 /// <returns>操作状态码</returns>
 public int insertTongsEntity(TongsEntity tongsEntity)
 {
     return(BaseDao.Insert <TongsEntity>("InsertTongsEntity", tongsEntity));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 查询单条夹具实体
 /// </summary>
 /// <param name="tongsEntity"></param>
 /// <returns>单个夹具实体信息</returns>
 public TongsEntity selectTongsEntityByCodeAndSeq(TongsEntity tongsEntity)
 {
     return(BaseDao.QueryForObject <TongsEntity>("SelectTongsEntityByCodeAndSeq", tongsEntity));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 查询单条夹具实体
 /// </summary>
 /// <param name="tongsEntity"></param>
 /// <returns>单个夹具实体信息</returns>
 public TongsEntity selectTongsEntityById(TongsEntity tongsEntity)
 {
     return(BaseDao.QueryForObject <TongsEntity>("SelectTongsEntityById", tongsEntity));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 查询所有夹具实体内容
 /// </summary>
 /// <param name="tongsEntity"></param>
 /// <returns>夹具实体列表</returns>
 public IList <TongsEntity> selectAllTongsEntitys(TongsEntity tongsEntity)
 {
     return(BaseDao.QueryForList <TongsEntity>("SelectAllTongsEntitys", tongsEntity));
 }