private void HandlePostRequestHeader(HttpRequest request, string operating) { if (operating != Operating.POST) { request.Headers["X-Http-Method-Override"] = operating; } string hour = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now).Hours.ToString(); string sign = SignParameters(UserSysNo.ToString(), UserAcct, hour); request.Headers["X-Accept-Language-Override"] = System.Threading.Thread.CurrentThread.CurrentUICulture.Name; request.Headers["X-User-SysNo"] = UserSysNo.ToString(); request.Headers["X-User-Acct"] = UserAcct; request.Headers["X-User-Display-Name"] = HttpUtility.UrlEncode(UserDisplayName); request.Headers["X-User-Selected-CompanyCode"] = HttpUtility.UrlEncode(SelectedCompanyCode); request.Headers["X-User-CompanyCode-List"] = HttpUtility.UrlEncode(AuthorizedCompanyCodeList); request.Headers["X-Portal-TimeZone"] = hour; request.Headers["X-Portal-Sign"] = sign; }
private string SetIdentityAndTimeZone(string url) { if (url != null && url.Length > 0) { string firstChar = url.Contains("?") ? "&" : "?"; string hour = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now).Hours.ToString(); string sign = SignParameters(UserSysNo.ToString(), UserAcct, hour); url += firstChar + "Portal_UserSysNo=" + UserSysNo + "&Portal_UserAcct=" + HttpUtility.UrlEncode(UserAcct) + "&Portal_UserDisplayName=" + HttpUtility.UrlEncode(UserDisplayName) + "&Portal_SelectedCompanyCode=" + HttpUtility.UrlEncode(SelectedCompanyCode) + "&Portal_AuthorizedCompanyCodeList=" + HttpUtility.UrlEncode(AuthorizedCompanyCodeList) + "&Portal_TimeZone=" + hour + "&Portal_Sign=" + HttpUtility.UrlEncode(sign); } return(url); }