예제 #1
0
        public ActionResult Create(NewWebsiteModel website)
        {
            website.LoginID = User.Identity.GetUserId();
            IDBConnector db = DBConnectorFactory.GetDBConnector();

            db.InsertWebsite(website);

            return(RedirectToAction("MyWebsites"));
        }
예제 #2
0
        public void InsertWebsite(NewWebsiteModel website)
        {
            List <NewWebsiteModel> websites = new List <NewWebsiteModel>()
            {
                website
            };

            using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(connectionString))
            {
                connection.Execute("WebsiteData.spWebsite_Insert @Title, @LoginID, @VisibilityID, @Description", websites);
            }
        }