public ActionResult GetMeta() { return(this.Ok ( new ViewModels.Dashboard { Culture = CultureManager.GetCurrent().Name, Tenant = this.Tenant, Language = CultureManager.GetCurrent().TwoLetterISOLanguageName, JqueryUIi18NPath = "/Scripts/jquery-ui/i18n/", Today = DateTime.Today.Date.ToString("O"), Now = DateTimeOffset.UtcNow.ToString("O"), UserId = this.AppUser.UserId, User = this.AppUser.Email, Office = this.AppUser.OfficeName, MetaView = this.AppUser, ShortDateFormat = CultureManager.GetShortDateFormat(), LongDateFormat = CultureManager.GetLongDateFormat(), ThousandSeparator = CultureManager.GetThousandSeparator(), DecimalSeparator = CultureManager.GetDecimalSeparator(), CurrencyDecimalPlaces = CultureManager.GetCurrencyDecimalPlaces(), CurrencySymbol = CultureManager.GetCurrencySymbol(), DatepickerFormat = CultureManager.GetCurrent().DateTimeFormat.ShortDatePattern, DatepickerShowWeekNumber = true, DatepickerWeekStartDay = (int)CultureManager.GetCurrent().DateTimeFormat.FirstDayOfWeek, DatepickerNumberOfMonths = "[2, 3]" })); }
public ActionResult GetMeta() { return(Json(new ViewModels.Dashboard { Culture = CultureManager.GetCurrent().Name, Language = CultureManager.GetCurrent().TwoLetterISOLanguageName, JqueryUIi18NPath = "/Scripts/jquery-ui/i18n/", Today = DateTime.Now.ToShortDateString(), Now = DateTime.Now.ToString(CultureManager.GetCurrent()), UserId = AppUsers.GetCurrent().View.UserId, User = AppUsers.GetCurrent().View.Email, Office = AppUsers.GetCurrent().View.Office, MetaView = AppUsers.GetCurrent().View, ShortDateFormat = CultureManager.GetShortDateFormat(), LongDateFormat = CultureManager.GetLongDateFormat(), ThousandSeparator = CultureManager.GetThousandSeparator(), DecimalSeparator = CultureManager.GetDecimalSeparator(), CurrencyDecimalPlaces = CultureManager.GetCurrencyDecimalPlaces(), CurrencySymbol = CultureManager.GetCurrencySymbol(), DatepickerFormat = CultureManager.GetCurrent().DateTimeFormat.ShortDatePattern, DatepickerShowWeekNumber = true, DatepickerWeekStartDay = (int)CultureManager.GetCurrent().DateTimeFormat.FirstDayOfWeek, DatepickerNumberOfMonths = "[2, 3]" }, JsonRequestBehavior.AllowGet)); }
private void RegisterJavascript() { string script = JSUtility.GetVar("culture", CultureManager.GetCurrent().Name); script += JSUtility.GetVar("language", CultureManager.GetCurrent().TwoLetterISOLanguageName); script += JSUtility.GetVar("jqueryUIi18nPath", this.Page.ResolveUrl("~/Scripts/jquery-ui/i18n")); script += JSUtility.GetVar("today", string.Format(CultureManager.GetCurrent(), CultureManager.GetCurrent().DateTimeFormat.ShortDatePattern, DateTime.Now)); script += JSUtility.GetVar("now", DateTime.Now.ToString(CultureManager.GetCurrent())); script += JSUtility.GetVar("date", DateTime.Now.ToString(CultureInfo.InvariantCulture)); script += JSUtility.GetVar("reportTemplatePath", PageUtility.ResolveUrl(DbConfig.GetScrudParameter(AppUsers.GetCurrentUserDB(), "TemplatePath"))); script += JSUtility.GetVar("reportExportTemplatePath", PageUtility.ResolveUrl(DbConfig.GetScrudParameter(AppUsers.GetCurrentUserDB(), "ExportTemplatePath"))); script += JSUtility.GetVar("reportHeaderPath", PageUtility.ResolveUrl(DbConfig.GetScrudParameter(AppUsers.GetCurrentUserDB(), "HeaderPath"))); script += JSUtility.GetVar("userId", AppUsers.GetCurrent().View.UserId); script += JSUtility.GetVar("user", AppUsers.GetCurrent().View.UserName); script += JSUtility.GetVar("officeCode", AppUsers.GetCurrent().View.OfficeCode); script += JSUtility.GetVar("office", AppUsers.GetCurrent().View.OfficeName); script += JSUtility.GetVar("applicationDates", JsonConvert.SerializeObject(DatePersister.GetFrequencyDates(AppUsers.GetCurrentUserDB(), AppUsers.GetCurrent().View.OfficeId.ToInt())), false); script += JSUtility.GetVar("metaView", JsonConvert.SerializeObject(AppUsers.GetCurrent().View), false); script += JSUtility.GetVar("overridePath", this.OverridePath); script += JSUtility.GetVar("shortDateFormat", CultureManager.GetShortDateFormat()); script += JSUtility.GetVar("longDateFormat", CultureManager.GetLongDateFormat()); script += JSUtility.GetVar("thousandSeparator", CultureManager.GetThousandSeparator()); script += JSUtility.GetVar("decimalSeparator", CultureManager.GetDecimalSeparator()); script += JSUtility.GetVar("currencyDecimalPlaces", CultureManager.GetCurrencyDecimalPlaces()); script += JSUtility.GetVar("currencySymbol", CultureManager.GetCurrencySymbol()); script += JSUtility.GetVar("today", DateTime.Now.ToShortDateString()); script += JSUtility.GetVar("shortDateFormat", CultureManager.GetShortDateFormat()); script += JSUtility.GetVar("thousandSeparator", CultureManager.GetThousandSeparator()); script += JSUtility.GetVar("decimalSeparator", CultureManager.GetDecimalSeparator()); script += JSUtility.GetVar("currencyDecimalPlaces", CultureManager.GetCurrencyDecimalPlaces()); script += JSUtility.GetVar("baseCurrencyCode", AppUsers.GetCurrent().View.CurrencyCode); script += JSUtility.GetVar("catalog", AppUsers.GetCurrentUserDB()); script += JSUtility.GetVar("update", this.Update()); script += JSUtility.GetVar("firstStepsPending", this.Context.Session["FirstStepsPending"]); script += JSUtility.GetVar("datepickerFormat", jQueryUI.GetDatePickerFormat()); script += JSUtility.GetVar("datepickerShowWeekNumber", jQueryUI.ShowWeekNumber()); script += JSUtility.GetVar("datepickerWeekStartDay", jQueryUI.GetWeekStartDay()); script += JSUtility.GetVar("datepickerNumberOfMonths", jQueryUI.GetNumberOfMonths()); ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "MixERPMasterPage", script, true); }
private void RegisterJavascript() { string script = JSUtility.GetVar("culture", CultureManager.GetCurrent().Name); script += JSUtility.GetVar("language", CultureManager.GetCurrent().TwoLetterISOLanguageName); script += JSUtility.GetVar("jqueryUIi18nPath", this.Page.ResolveUrl("~/Scripts/jquery-ui/i18n/")); script += JSUtility.GetVar("today", string.Format(CultureManager.GetCurrent(), CultureManager.GetCurrent().DateTimeFormat.ShortDatePattern, DateTime.Now)); script += JSUtility.GetVar("now", DateTime.Now.ToString(CultureManager.GetCurrent())); script += JSUtility.GetVar("user", AppUsers.GetCurrent().View.UserName); script += JSUtility.GetVar("office", AppUsers.GetCurrent().View.OfficeName); script += JSUtility.GetVar("shortDateFormat", CultureManager.GetShortDateFormat()); script += JSUtility.GetVar("longDateFormat", CultureManager.GetLongDateFormat()); script += JSUtility.GetVar("thousandSeparator", CultureManager.GetThousandSeparator()); script += JSUtility.GetVar("decimalSeparator", CultureManager.GetDecimalSeparator()); script += JSUtility.GetVar("currencyDecimalPlaces", CultureManager.GetCurrencyDecimalPlaces()); script += JSUtility.GetVar("currencySymbol", CultureManager.GetCurrencySymbol()); script += JSUtility.GetVar("today", DateTime.Now.ToShortDateString()); script += JSUtility.GetVar("shortDateFormat", CultureManager.GetShortDateFormat()); script += JSUtility.GetVar("thousandSeparator", CultureManager.GetThousandSeparator()); script += JSUtility.GetVar("decimalSeparator", CultureManager.GetDecimalSeparator()); script += JSUtility.GetVar("currencyDecimalPlaces", CultureManager.GetCurrencyDecimalPlaces()); script += JSUtility.GetVar("baseCurrencyCode", AppUsers.GetCurrent().View.CurrencyCode); script += JSUtility.GetVar("catalog", AppUsers.GetCurrentUserDB()); script += JSUtility.GetVar("update", this.Update()); script += JSUtility.GetVar("firstStepsPending", this.Context.Session["FirstStepsPending"]); script += JSUtility.GetVar("datepickerFormat", jQueryUI.GetDatePickerFormat()); script += JSUtility.GetVar("datepickerShowWeekNumber", jQueryUI.ShowWeekNumber()); script += JSUtility.GetVar("datepickerWeekStartDay", jQueryUI.GetWeekStartDay()); script += JSUtility.GetVar("datepickerNumberOfMonths", jQueryUI.GetNumberOfMonths()); PageUtility.RegisterJavascript("MixERPMasterPage", script, this.Page, true); }