public BaseWebService() { if (HttpContext.Current != null && HttpContext.Current.User != null) { _credentials = new CredentialsInformation(User ?? HttpContext.Current.User); } }
private static TimeZoneInfo GetTimeZoneInfo(CredentialsInformation credentials) { TimeZoneInfo tz = null; if (credentials != null && credentials.Profile != null && string.IsNullOrEmpty(credentials.Profile.TimeZone) == false) { int timeZoneId = TypeConverter.ToInt32(credentials.Profile.TimeZone, int.MinValue); if (timeZoneId != int.MinValue) { tz = Dictionaries.Instance.GetTimeZoneInfoById(timeZoneId); } } return tz; }
public void SaveAs(CredentialsInformation credentials, string fileName) { if (Context != null) { if (null != credentials && null != credentials.UserId) { var fullPath = GetFullPath(credentials); if(Directory.Exists(fullPath) == false) { Directory.CreateDirectory(fullPath); } var fullFilePath = GetFullFilePath(credentials, fileName); base.SaveAs(fullFilePath); } } }
private static DateTime UtcToLocal(this DateTime date, CredentialsInformation credentials) { DateTime d = date; var tz = GetTimeZoneInfo(credentials); d = ConvertTime(date, tz); return d; }
public void SaveAs(CredentialsInformation credentials) { this.SaveAs(credentials, this.FileName); }
public static string GetFullVirtualPath(CredentialsInformation credentials) { return Path.Combine(AjaxControlConfigurationSection.Section.UploadDirectoryPath, credentials.UserId.ToString()); }
public static string GetFullPath(CredentialsInformation credentials) { return HttpContext.Current.Server.MapPath(GetFullVirtualPath(credentials)); }
public static string GetFullFilePath(CredentialsInformation credentials, string fileName) { return Path.Combine(GetFullPath(credentials), fileName); }