Click here to Skip to main content
15,885,546 members
Articles / Web Development / HTML

Signum Framework Tutorials Part 1 – Southwind Entities

Rate me:
Please Sign up or sign in to vote.
4.50/5 (12 votes)
14 Nov 2012LGPL315 min read 41.3K   2K   52  
Tutorial focused in writing the entities using Signum Framework, a Win/Web LINQ-enabled framework for writing data-centric applications.
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.235
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace ASP
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Web;
    using System.Web.Helpers;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.WebPages;
    using System.Web.Mvc;
    using System.Web.Mvc.Ajax;
    using System.Web.Mvc.Html;
    using System.Web.Routing;
    using Signum.Utilities;
    using Signum.Entities;
    using Signum.Web;
    using System.Collections;
    using System.Collections.Specialized;
    using System.ComponentModel.DataAnnotations;
    using System.Configuration;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Web.Caching;
    using System.Web.DynamicData;
    using System.Web.SessionState;
    using System.Web.Profile;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Xml.Linq;
    using Signum.Web.Properties;
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("MvcRazorClassGenerator", "1.0")]
    [System.Web.WebPages.PageVirtualPathAttribute("~/Signum/Views/NormalControl.cshtml")]
    public class _Page_Signum_Views_NormalControl_cshtml : System.Web.Mvc.WebViewPage<TypeContext>
    {
#line hidden

        public _Page_Signum_Views_NormalControl_cshtml()
        {
        }
        protected System.Web.HttpApplication ApplicationInstance
        {
            get
            {
                return ((System.Web.HttpApplication)(Context.ApplicationInstance));
            }
        }
        public override void Execute()
        {




  
    ModifiableEntity modifiable = Model.UntypedValue as ModifiableEntity;
    string partialViewName = ViewData[ViewDataKeys.PartialViewName].ToString();
               

WriteLiteral("<div>\r\n    ");


Write(Html.AntiForgeryToken());

WriteLiteral("\r\n    ");


Write(Html.Hidden(ViewDataKeys.TabId, ViewData[ViewDataKeys.TabId]));

WriteLiteral("\r\n    ");


Write(Html.Hidden(ViewDataKeys.PartialViewName, ViewData[ViewDataKeys.PartialViewName]));

WriteLiteral("\r\n    <div class=\"ui-widget-header ui-corner-all sf-normal-control-header\">\r\n    " +
"    <span class=\"sf-type-nice-name\">");


                                   Write(Navigator.Manager.GetTypeTitle(modifiable));

WriteLiteral("</span>\r\n        ");


   Write(Html.RenderWidgetsForEntity(modifiable, partialViewName, Model.ControlID));

WriteLiteral("\r\n    </div>\r\n    <div class=\"clearall\"></div>\r\n");


     if(string.IsNullOrEmpty(ViewBag.Title))
    {
        ViewBag.Title = modifiable.TryToString();
    }

WriteLiteral("    <span class=\"sf-entity-title\">");


                              Write(ViewBag.Title);

WriteLiteral("</span>\r\n</div>\r\n<div class=\"sf-button-bar\">\r\n");


     if (Model != null && Navigator.Manager.ShowOkSave(modifiable.GetType(), false))
    {

WriteLiteral("        <a id=\"ebSave\" class=\"sf-entity-button sf-save\" onclick=\"javascript:new S" +
"F.Validator({controllerUrl:\'");


                                                                                                        Write(Url.SignumAction("TrySave"));

WriteLiteral("\'}).trySave();\">");


                                                                                                                                                    Write(Resources.Save);

WriteLiteral("</a>  \r\n");


    }

WriteLiteral("    ");


Write(ButtonBarEntityHelper.GetForEntity(this.ViewContext, modifiable, ViewData[ViewDataKeys.PartialViewName].ToString(), Model.ControlID).ToString(Html));

WriteLiteral("\r\n</div>\r\n\r\n<div class=\"clearall\"></div>\r\n<div class=\"validationSummaryAjax\">\r\n  " +
"  ");


Write(Html.ValidationSummaryAjax());

WriteLiteral("\r\n    ");


Write(Html.NormalPageHeader());

WriteLiteral("\r\n</div>\r\n<div id=\"divMainControl\" class=\"sf-main-control\">\r\n");


       Html.RenderPartial(partialViewName, Model);

WriteLiteral("</div>\r\n");


        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Software Developer (Senior) Signum Software
Spain Spain
I'm Computer Scientist, one of the founders of Signum Software, and the lead developer behind Signum Framework.

www.signumframework.com

I love programming in C#, Linq, Compilers, Algorithms, Functional Programming, Computer Graphics, Maths...

Comments and Discussions