示例#1
0
 public BaseWebService()
 {
     if (HttpContext.Current != null && HttpContext.Current.User != null)
     {
         _credentials = new CredentialsInformation(User ?? HttpContext.Current.User);
     }
 }
示例#2
0
 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;
 }
示例#3
0
 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);
     }
       }
 }
示例#4
0
 private static DateTime UtcToLocal(this DateTime date, CredentialsInformation credentials)
 {
     DateTime d = date;
       var tz = GetTimeZoneInfo(credentials);
       d = ConvertTime(date, tz);
       return d;
 }
示例#5
0
 public void SaveAs(CredentialsInformation credentials)
 {
     this.SaveAs(credentials, this.FileName);
 }
示例#6
0
 public static string GetFullVirtualPath(CredentialsInformation credentials)
 {
     return Path.Combine(AjaxControlConfigurationSection.Section.UploadDirectoryPath, credentials.UserId.ToString());
 }
示例#7
0
 public static string GetFullPath(CredentialsInformation credentials)
 {
     return HttpContext.Current.Server.MapPath(GetFullVirtualPath(credentials));
 }
示例#8
0
 public static string GetFullFilePath(CredentialsInformation credentials, string fileName)
 {
     return Path.Combine(GetFullPath(credentials), fileName);
 }