コード例 #1
0
        public override Appraisal TranslateToModel(APPRAISAL_HEADER entity)
        {
            try
            {
                Appraisal model = null;
                if (entity != null)
                {
                    model                  = new Appraisal();
                    model.Id               = entity.Appraisal_Header_ID;
                    model.Period           = periodTranslator.Translate(entity.PERIOD);
                    model.Staff            = staffTranslator.Translate(entity.STAFF);
                    model.Supervisor       = staffTranslator.Translate(entity.STAFF1);
                    model.AppraisalDate    = entity.Appraisal_Date;
                    model.ResponseDate     = entity.Staff_Response_Date;
                    model.Hod              = staffTranslator.Translate(entity.STAFF2);
                    model.HodAppraisalDate = entity.Hod_Appraisal_Date;
                    model.Status           = statusTranslator.Translate(entity.STATUS);
                }

                return(model);
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #2
0
ファイル: PeriodTranslator.cs プロジェクト: nitware/mango
        public override Period TranslateToModel(PERIOD entity)
        {
            try
            {
                Period period = null;
                if (entity != null)
                {
                    period        = new Period();
                    period.Id     = entity.Period_ID;
                    period.Status = statusTranslator.Translate(entity.STATUS);

                    //entity.CURRENT_PERIOD
                    //period.Name = entity.Period_Name;
                    //period.Type = entity.Type;


                    period.Span      = entity.Span;
                    period.StartDate = entity.Start_Date;
                    period.EndDate   = entity.End_Date;
                    period.Type      = periodTypeTranslator.Translate(entity.PERIOD_TYPE);
                    period.Year      = entity.Year;

                    period.Name = entity.Year + " " + period.Type.Name;
                }

                return(period);
            }
            catch (Exception)
            {
                throw;
            }
        }