/// <summary> /// Fetches matter details from excel sheet /// </summary> /// <param name="dataValue">Data value</param> /// <returns>List of data storage</returns> internal static List<DataStorage> FetchMatterData(Collection<Collection<string>> dataValue) { List<DataStorage> kvp = new List<DataStorage>(); int xlRange = dataValue.Count; if (0 != xlRange) { int rowCount; for (rowCount = 1; rowCount <= xlRange - 1; rowCount++) { if (!string.IsNullOrWhiteSpace(dataValue[rowCount][0])) { DataStorage tuple = new DataStorage(); tuple.ClientName = Convert.ToString(dataValue[rowCount][0], CultureInfo.InvariantCulture).Trim(); tuple.MatterPrefix = Convert.ToString(dataValue[rowCount][1], CultureInfo.InvariantCulture).Trim(); tuple.MatterDescription = Convert.ToString(dataValue[rowCount][2], CultureInfo.InvariantCulture).Trim(); tuple.MatterIdPrefix = Convert.ToString(dataValue[rowCount][3], CultureInfo.InvariantCulture).Trim(); tuple.PracticeGroup = Convert.ToString(dataValue[rowCount][4], CultureInfo.InvariantCulture).Trim(); tuple.AreaOfLaw = Convert.ToString(dataValue[rowCount][5], CultureInfo.InvariantCulture).Trim(); tuple.SubAreaOfLaw = Convert.ToString(dataValue[rowCount][6], CultureInfo.InvariantCulture).Trim(); tuple.ConflictCheckConductedBy = Convert.ToString(dataValue[rowCount][7], CultureInfo.InvariantCulture).Trim(); tuple.ConflictDate = Convert.ToString(dataValue[rowCount][8], CultureInfo.InvariantCulture).Trim(); tuple.BlockedUser = Convert.ToString(dataValue[rowCount][9], CultureInfo.InvariantCulture).Trim(); tuple.ResponsibleAttorneys = Convert.ToString(dataValue[rowCount][10], CultureInfo.InvariantCulture).Trim(); tuple.Attorneys = Convert.ToString(dataValue[rowCount][11], CultureInfo.InvariantCulture).Trim(); tuple.BlockedUploadUsers = Convert.ToString(dataValue[rowCount][12], CultureInfo.InvariantCulture).Trim(); tuple.ConflictIdentified = Convert.ToString(dataValue[rowCount][14], CultureInfo.InvariantCulture).Trim(); tuple.CopyPermissionsFromParent = Convert.ToBoolean(tuple.ConflictIdentified, CultureInfo.InvariantCulture) ? Constants.FALSE.ToUpperInvariant() : Convert.ToString(dataValue[rowCount][13], CultureInfo.InvariantCulture).Trim(); kvp.Add(tuple); } } } return kvp; }
/// <summary> /// Initializes a new instance of the <see cref="Matter" /> class. /// </summary> /// <param name="matterData">Matter data</param> internal Matter(DataStorage matterData) { if (null != matterData) { this.MatterName = matterData.MatterPrefix; this.MatterId = matterData.MatterIdPrefix; this.MatterDescription = matterData.MatterDescription; this.MatterType = new MatterType() { PracticeGroup = Utility.ProcessString(matterData.PracticeGroup), AreaofLaw = Utility.ProcessString(matterData.AreaOfLaw), SubAreaofLaw = Utility.ProcessString(matterData.SubAreaOfLaw) }; this.Conflict = new Conflict() { ConflictCheckBy = matterData.ConflictCheckConductedBy, ConflictCheckOn = Utility.ValidateDateFormat(matterData.ConflictDate), ConflictIdentified = matterData.ConflictIdentified, SecureMatter = Utility.UpperFirst(Convert.ToString(!Convert.ToBoolean(matterData.CopyPermissionsFromParent, CultureInfo.InvariantCulture), CultureInfo.InvariantCulture)) }; this.TeamInfo = new TeamInfo() { ResponsibleAttorneys = Utility.ProcessString(matterData.ResponsibleAttorneys), Attorneys = Utility.ProcessString(matterData.Attorneys), BlockedUploadUsers = Utility.ProcessString(matterData.BlockedUploadUsers), BlockedUsers = matterData.BlockedUser, }; string dateFormat = System.Configuration.ConfigurationManager.AppSettings["DateFormat"]; this.OpenDate = Convert.ToDateTime(DateTime.Now, CultureInfo.InvariantCulture).ToString(dateFormat, CultureInfo.InvariantCulture); this.CopyPermissionsFromParent = Convert.ToBoolean(matterData.CopyPermissionsFromParent, CultureInfo.InvariantCulture); this.BlockUserNames = matterData.BlockedUser.Trim().Split(';').ToList(); this.DefaultContentType = matterData.DefaultContentType; this.DocumentCount = matterData.DocumentCount; this.MatterGuid = matterData.MatterGuid; } }