public string ConcatenateFields(WpPlan wpPlan) { var mhrPlan = wpPlan.MHR != 0 ? $" - {wpPlan.MHR} MH" : ""; var remarks = !string.IsNullOrEmpty(wpPlan.INTERNAL_REMARKS) ? wpPlan.INTERNAL_REMARKS + "<br/>" : ""; var name = $"{remarks}{wpPlan.AC_MODEL} {wpPlan.AC_REGISTR} {wpPlan.DESCRIPTION}{mhrPlan}"; return(name); }
public ACModel CovertToACModelEnum(WpPlan wpPlan) { Enum.TryParse(wpPlan.AC_MODEL, out ACModel acModel); return(acModel); }
public ACType CovertToACTypeEnum(WpPlan wpPlan) { Enum.TryParse(wpPlan.AC_TYP, out ACType acType); return(acType); }
public DateTime ConvertToDateTime(WpPlan wpPlan, string date, string field) { DateTime.TryParseExact(date, "MM/dd/yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime selectDateTime); wpPlan.GetType().GetProperty(field).SetValue(wpPlan, selectDateTime.ToString("dd.MM.yyyy HH:mm:ss")); return(Convert.ToDateTime(wpPlan.GetType().GetProperty(field).GetValue(wpPlan))); }