/// <summary>
 /// Deprecated Method for adding a new object to the Portals EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPortals(Portal portal)
 {
     base.AddObject("Portals", portal);
 }
示例#2
0
        /// <summary>
        /// Creates a new portal and inserts it into the database
        /// </summary>
        /// <param name="values">A hashtable of values used to create the Portals entity</param>
        public void Insert(Hashtable values)
        {
            float taxRate = 0;

            if (!string.IsNullOrWhiteSpace(values["TaxRate"].ToString()))
            {
                taxRate = float.Parse(values["TaxRate"].ToString());
            }

            DAL.Portal r = new DAL.Portal
            {
                Name = values["Name"].ToString(),
                Theme = values["Theme"].ToString(),
                MasterPage = values["MasterPage"].ToString(),
                UrlRedirect = values["UrlRedirect"].ToString(),
                FacebookAppID = values["FacebookAppID"].ToString(),
                FacebookSecret = values["FacebookSecret"].ToString(),
                PayPalEnvironment = bool.Parse(values["PayPalEnvironment"].ToString()),
                PayPalBusiness = values["PayPalBusiness"].ToString(),
                EmailHost = values["EmailHost"].ToString(),
                EmailPort = values["EmailPort"].ToString(),
                EmailUser = values["EmailUser"].ToString(),
                EmailPass = values["EmailPass"].ToString(),
                EmailSSL = bool.Parse(values["EmailSSL"].ToString()),
                RobotsText = values["RobotsText"].ToString(),
                GoogleAnalytics = values["GoogleAnalytics"].ToString(),
                CreateDate = DateTime.Now,
                CreatedByUserID = (int)HttpContext.Current.Session["UserID"],
                StartMethod = values["StartMethod"].ToString(),
                TaxRate = taxRate
            };
            this.context.AddToPortals(r);
            this.context.SaveChanges();
        }
 /// <summary>
 /// Create a new Portal object.
 /// </summary>
 /// <param name="portalID">Initial value of the PortalID property.</param>
 /// <param name="createDate">Initial value of the CreateDate property.</param>
 /// <param name="createdByUserID">Initial value of the CreatedByUserID property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 public static Portal CreatePortal(global::System.Int32 portalID, global::System.DateTime createDate, global::System.Int32 createdByUserID, global::System.String name)
 {
     Portal portal = new Portal();
     portal.PortalID = portalID;
     portal.CreateDate = createDate;
     portal.CreatedByUserID = createdByUserID;
     portal.Name = name;
     return portal;
 }