示例#1
0
 /// <summary>
 /// 删除等位基因
 /// </summary>
 /// <param name="member"></param>
 /// <returns></returns>
 public bool Delete(string id)
 {
     using (EFGeneAlleleRepository repository = new EFGeneAlleleRepository())
     {
         return(repository.Delete(id));
     }
 }
示例#2
0
 /// <summary>
 /// 获取等位基因
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public GeneAllele Get(string id)
 {
     using (EFGeneAlleleRepository repository = new EFGeneAlleleRepository())
     {
         GN_GENEALLELE entity = repository.Get(id);
         return(EntityToModel(entity));
     }
 }
示例#3
0
 /// <summary>
 /// 根据基因ID获取等位基因列表
 /// </summary>
 /// <param name="geneID"></param>
 /// <returns></returns>
 public List <GeneAllele> GetList(string geneID, ref PageInfo pageInfo)
 {
     using (EFGeneAlleleRepository repository = new EFGeneAlleleRepository())
     {
         List <GeneAllele> modelList = new List <GeneAllele>();
         if (!string.IsNullOrEmpty(geneID))
         {
             modelList = repository.FindAll(o => o.GENEID.Equals(geneID) && !o.ISDELETED).Paging(ref pageInfo).Select(EntityToModel).ToList();
         }
         return(modelList);
     }
 }
示例#4
0
 /// <summary>
 /// 根据基因ID获取等位基因列表
 /// </summary>
 /// <param name="geneID"></param>
 /// <returns></returns>
 public List <GeneAllele> GetList(string geneID)
 {
     using (EFGeneAlleleRepository repository = new EFGeneAlleleRepository())
     {
         List <GeneAllele> modelList = new List <GeneAllele>();
         if (!string.IsNullOrEmpty(geneID))
         {
             var list = repository.FindAll(o => o.GENEID.Equals(geneID) && !o.ISDELETED).ToList();;
             modelList = (from g in list select EntityToModel(g)).ToList();
         }
         return(modelList);
     }
 }
示例#5
0
        /// <summary>
        /// 编辑等位基因
        /// </summary>
        /// <param name="member"></param>
        /// <returns></returns>
        public bool Edit(GeneAllele model)
        {
            using (EFGeneAlleleRepository repository = new EFGeneAlleleRepository())
            {
                if (model == null || string.IsNullOrEmpty(model.ID))
                {
                    return(false);
                }
                GN_GENEALLELE entity = ModelToEntity(model);
                entity.EDITDATETIME = DateTime.Now;
                UserInfo currentUser = new UserInfoService().GetCurrentUser();
                if (currentUser != null)
                {
                    entity.EDITUSERID   = currentUser.UserId;
                    entity.EDITUSERNAME = currentUser.LoginName;
                }

                return(repository.Edit(entity));
            }
        }
示例#6
0
        /// <summary>
        /// 添加等位基因
        /// </summary>
        /// <param name="member"></param>
        /// <returns></returns>
        public string Add(GeneAllele model)
        {
            using (EFGeneAlleleRepository repository = new EFGeneAlleleRepository())
            {
                if (model == null)
                {
                    return(string.Empty);
                }
                GN_GENEALLELE entity = ModelToEntity(model);
                entity.ID             = string.IsNullOrEmpty(model.ID) ? Guid.NewGuid().ToString() : model.ID;
                entity.CREATEDATETIME = (model.CreateDateTime != null && model.CreateDateTime.HasValue) ? model.CreateDateTime.Value : DateTime.Now;
                UserInfo currentUser = new UserInfoService().GetCurrentUser();
                if (currentUser != null)
                {
                    entity.CREATEUSERID   = currentUser.UserId;
                    entity.CREATEUSERNAME = currentUser.LoginName;
                }
                entity.EDITDATETIME = entity.CREATEDATETIME;
                entity.EDITUSERID   = entity.CREATEUSERID;
                entity.EDITUSERNAME = entity.CREATEUSERNAME;

                return(repository.Add(entity));
            }
        }