public AMSRequestActivityFFS[] FormatFFS(DataTable dt) { AMSRequestActivityFFS[] _list = new AMSRequestActivityFFS[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { _list[i] = FormatFFS(dt.Rows[i]); } return(_list); }
public AMSRequestActivityFFS FormatFFS(DataRow row) { AMSRequestActivityFFS entry = new AMSRequestActivityFFS(); entry.ID = row["ID"].ToString(); entry.RequestID = row["RequestID"].ToString(); entry.Activity_ID = row["Activity_ID"].ToString(); entry.Category = row["Category"].ToString(); entry.CVPoolID = row["CVPoolID"].ToString(); entry.ProviderName = row["ProviderName"].ToString(); entry.ProviderBelongs = row["ProviderBelongs"].ToString(); entry.ProviderLevel = row["ProviderLevel"].ToString(); entry.SelectionCriteria = row["SelectionCriteria"].ToString(); entry.Planed_ProvidingTime = string.IsNullOrEmpty(row["Planed_ProvidingTime"].ToString()) ? 0 : float.Parse(row["Planed_ProvidingTime"].ToString()); entry.Planed_FeePerTime = string.IsNullOrEmpty(row["Planed_FeePerTime"].ToString()) ? 0 : float.Parse(row["Planed_FeePerTime"].ToString()); if (!string.IsNullOrEmpty(row["IsBackUp"].ToString())) { entry.IsBackUp = bool.Parse(row["IsBackUp"].ToString()); } entry.Planed_Total = string.IsNullOrEmpty(row["Planed_Total"].ToString()) ? 0 : float.Parse(row["Planed_Total"].ToString()); entry.Actual_ProvidingTime = string.IsNullOrEmpty(row["Actual_ProvidingTime"].ToString()) ? 0 : float.Parse(row["Actual_ProvidingTime"].ToString()); entry.Actual_FeePerTime = string.IsNullOrEmpty(row["Actual_FeePerTime"].ToString()) ? 0 : float.Parse(row["Actual_FeePerTime"].ToString()); if (!string.IsNullOrEmpty(row["Attended"].ToString())) { entry.Attended = bool.Parse(row["Attended"].ToString()); } entry.Actual_Total = string.IsNullOrEmpty(row["Actual_Total"].ToString()) ? 0 : float.Parse(row["Actual_Total"].ToString()); entry.ProvidingUnit = row["ProvidingUnit"].ToString(); entry.SAPCode = row["SAPCode"].ToString(); entry.Currency = row["Currency"].ToString(); entry.Exchange = string.IsNullOrEmpty(row["Exchange"].ToString()) ? 0 : float.Parse(row["Exchange"].ToString()); entry.Tax = row["Tax"].ToString(); entry.ActualPayment = string.IsNullOrEmpty(row["CreateTime"].ToString()) ? 0 : float.Parse(row["ActualPayment"].ToString()); entry.CreateTime = string.IsNullOrEmpty(row["CreateTime"].ToString()) ? DateTime.MinValue : DateTime.Parse(row["CreateTime"].ToString()); entry.CreatedBy = row["CreatedBy"].ToString(); entry.UpdateTime = string.IsNullOrEmpty(row["UpdateTime"].ToString()) ? DateTime.MinValue : DateTime.Parse(row["UpdateTime"].ToString()); entry.UpdatedBy = row["UpdatedBy"].ToString(); entry.IDCard = row["IDCard"].ToString(); //entry.ParticipateCount = string.IsNullOrEmpty(row["ParticipatCount"].ToString()) ? 0 : int.Parse(row["ParticipatCount"].ToString()); //entry.ParticipateAmountSUM = string.IsNullOrEmpty(row["ParticipatAmountSUM"].ToString()) ? 0 : decimal.Parse(row["ParticipatAmountSUM"].ToString()); entry.ParticipateAmountLimit = string.IsNullOrEmpty(row["ParticipateAmountLimit"].ToString()) ? 1000000 : float.Parse(row["ParticipateAmountLimit"].ToString()); entry.AmountPercent = string.IsNullOrEmpty(row["AmountPercent"].ToString()) ? 0 : float.Parse(row["AmountPercent"].ToString()); return(entry); }