Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     System.Collections.Generic.IList<LeadSource> LsList = Sage.Platform.EntityFactory.GetRepository<LeadSource>().FindAll();
     ddlHowDidYouHear.DataSource = LsList;
     ddlHowDidYouHear.DataTextField = "DESCRIPTION";
     ddlHowDidYouHear.DataValueField = "ID";
     ddlHowDidYouHear.DataBind();
     if (!Page.IsPostBack)
     {
         Page.ClientScript.RegisterClientScriptInclude("YAHOO_yahoo", "jscript/YUI/yahoo.js");
         Page.ClientScript.RegisterClientScriptInclude("YAHOO_event", "jscript/YUI/event.js");
         Page.ClientScript.RegisterClientScriptInclude("YAHOO_util", "jscript/YUI/utilities.js");
         Page.ClientScript.RegisterClientScriptInclude("timezone", "jscript/timezone.js");
     }
     else
     {
         if (Request.Params["tz_info"] != null)
         {
             Sage.Platform.TimeZones tzs = new Sage.Platform.TimeZones();
             string[] tzinfo = Request.Params["tz_info"].Split(',');
             if (tzinfo.Length == 11)
             {
                 Sage.Platform.TimeZone tz = tzs.FindTimeZone(tzinfo[0], tzinfo[1], tzinfo[2], tzinfo[3], tzinfo[4], tzinfo[5], tzinfo[6], tzinfo[7], tzinfo[8], tzinfo[9], tzinfo[10]);
                 Sage.Platform.Application.IContextService context = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Application.IContextService>(true);
                 context.SetContext("TimeZone", tz);
             }
         }
     }
 }
Ejemplo n.º 2
0
 private static Sage.Platform.TimeZone GetTimeZoneContext()
 {
     var tz = (Sage.Platform.TimeZone)ApplicationContext.Current.Services.Get<Sage.Platform.Application.IContextService>().GetContext("TimeZone");
     if (tz == null)
     {
         tz = new Sage.Platform.TimeZones().CurrentTimeZone;
         ApplicationContext.Current.Services.Get<Sage.Platform.Application.IContextService>().SetContext("TimeZone", tz);
     }
     return tz;
 }
Ejemplo n.º 3
0
        private static Sage.Platform.TimeZone GetTimeZoneContext()
        {
            var tz = (Sage.Platform.TimeZone)ApplicationContext.Current.Services.Get <Sage.Platform.Application.IContextService>().GetContext("TimeZone");

            if (tz == null)
            {
                tz = new Sage.Platform.TimeZones().CurrentTimeZone;
                ApplicationContext.Current.Services.Get <Sage.Platform.Application.IContextService>().SetContext("TimeZone", tz);
            }
            return(tz);
        }