Beispiel #1
0
        public WorkHourHistoryJson ToJson(WorkHourHistory entity)
        {
            WorkHourHistoryJson json = new WorkHourHistoryJson();

            json.Action = entity.Action;
            json.Description = entity.Description;
            json.ID = entity.ID;
            json.ManagerName = entity.Manager.UserTitle;
            json.PersianDate = DateUtility.GetPersianDate(entity.Date);
            json.Time = DateUtility.ConvertDateTimeToTime(entity.Date);
            json.StageTitle = entity.Stage.Title;

            return json;
        }
Beispiel #2
0
        public HourlyMissionJson ToJson(HourlyMission hourlyMission)
        {
            HourlyMissionJson result = new HourlyMissionJson();

            result.ID              = hourlyMission.ID;
            result.RegisterDate    = DateUtility.GetPersianDate(hourlyMission.RegisterDate);
            result.MissionDate     = DateUtility.GetPersianDate(hourlyMission.Date);
            result.From            = DateUtility.ConvertDateTimeToTime(hourlyMission.From);
            result.TO              = DateUtility.ConvertDateTimeToTime(hourlyMission.To);
            result.Organisation    = hourlyMission.OrganisationId != null ? hourlyMission.Organisation.Title : "فاقد واحد سازمانی";
            result.PersonnelNumber = hourlyMission.User.Code != null ? hourlyMission.User.Code : "فاقد کد پرسنلی";
            result.ProjectTitle    = hourlyMission.Project != null ? hourlyMission.Project.Title : "فاقد پروژه";
            result.UserTitle       = hourlyMission.User.UserTitle;
            return(result);
        }