Example #1
0
        public virtual YZJ_CheckRecordModel GetById(string id)
        {
            if (IsExists(id))
            {
                YZJ_CheckRecord      entity = m_Rep.GetById(id);
                YZJ_CheckRecordModel model  = new YZJ_CheckRecordModel();
                model.id             = entity.id;
                model.available      = entity.available;
                model.StdId          = entity.StdId;
                model.StdName        = entity.StdName;
                model.ApplicantNo    = entity.ApplicantNo;
                model.ApplicantName  = entity.ApplicantName;
                model.ApplyDate      = entity.ApplyDate;
                model.AssessorId     = entity.AssessorId;
                model.AssessorName   = entity.AssessorName;
                model.AssessDate     = entity.AssessDate;
                model.ExaminantId    = entity.ExaminantId;
                model.ExaminantName  = entity.ExaminantName;
                model.ExamineName    = entity.ExamineName;
                model.ExamineDate    = entity.ExamineDate;
                model.AssessResult   = entity.AssessResult;
                model.AssessState    = entity.AssessState;
                model.ApplyReason    = entity.ApplyReason;
                model.ExamineOpinion = entity.ExamineOpinion;
                model.ApplyType      = entity.ApplyType;

                return(model);
            }
            else
            {
                return(null);
            }
        }
Example #2
0
        public virtual bool Create(YZJ_CheckRecordModel model)
        {
            try
            {
                YZJ_CheckRecord entity = m_Rep.GetById(model.id);
                if (entity != null)
                {
                    return(false);
                }
                entity                = new YZJ_CheckRecord();
                entity.id             = model.id;
                entity.available      = model.available;
                entity.StdId          = model.StdId;
                entity.StdName        = model.StdName;
                entity.ApplicantNo    = model.ApplicantNo;
                entity.ApplicantName  = model.ApplicantName;
                entity.ApplyDate      = model.ApplyDate;
                entity.AssessorId     = model.AssessorId;
                entity.AssessorName   = model.AssessorName;
                entity.AssessDate     = model.AssessDate;
                entity.ExaminantId    = model.ExaminantId;
                entity.ExaminantName  = model.ExaminantName;
                entity.ExamineName    = model.ExamineName;
                entity.ExamineDate    = model.ExamineDate;
                entity.AssessResult   = model.AssessResult;
                entity.AssessState    = model.AssessState;
                entity.ApplyReason    = model.ApplyReason;
                entity.ExamineOpinion = model.ExamineOpinion;
                entity.ApplyType      = model.ApplyType;


                if (m_Rep.Create(entity))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }