// GET: api/FormAPI public JsonResult Get() { FormModule module = new FormModule(_context); var resultVal = module.GetList(); return(Json(resultVal)); }
public JsonResult GetInfo(int id) { FormModule module = new FormModule(_context); var item = module.GetInfo(id); return(Json(item)); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FormResolve.Wire(FormModule.Create()); if (Convert.ToBoolean(ConfigurationManager.AppSettings["usuario.necessita.logar"])) { Application.Run(FormResolve.Resolve <FrmLogin>()); } else { Application.Run(FormResolve.Resolve <FrmPrincipal>()); } }
public ModuleBase Load() { ModuleBase m; switch (Path.GetExtension(FileName).ToLowerInvariant()) { case ".frm": m = new FormModule(); break; case ".cls": m = new ClassModule(); break; case ".bas": m = new StandardModule(); break; default: throw new NotSupportedException(); } _States = new Stack <ISourceReadingState>(); _States.Push(new ModuleReadingState(m)); using (var sr = new StreamReader(FileName)) using (var tp = new TokenParser(sr)) { Encoding = sr.CurrentEncoding; while (_States.Any() && tp.Read()) { if (!tp.Tokens.Any()) { continue; } if (!_States.Peek().Accept(this, tp.Tokens)) { _States.Pop(); } } } _States = null; return(m); }
public static FormModule ProcessFormsXML(string fileName) { //XNamespace ns = "http://xmlns.oracle.com/Forms/"; XNamespace ns = String.Empty; string text = File.ReadAllText(fileName, Encoding.GetEncoding("UTF-8")); XElement fmx = XElement.Parse(text); List <Block> blocks = BlockParser.GetBlocks(ns, fmx).ToList <Block>(); blocks.ForEach(blockItem => { XElement block = (from el in fmx.Descendants(ns + "Block") where el.Attribute("Name").Value == blockItem.Name select el).First(); blockItem.Items.AddRange(ItemParser.GetItems(ns, block)); }); FormModule formModule = new FormModule("Name", "Title", "Max", "MenuModule", "Console", blocks); return(formModule); }
public static NumberFormElement CacheVersion( this FormModule <Domain.Settings> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.CacheVersion, file, line);
public static StringFormElement Name( this FormModule <Domain.Settings> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.Name, file, line);
public static DateTimeFormElement DateCreated( this FormModule <Domain.PasswordResetTicket> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.DateCreated, file, line);
public static AssociationFormElement User( this FormModule <Domain.PasswordResetTicket> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.User, file, line);
static void Main(string[] args) { /* * This example creates a master-detail form based on the dept and emp database tables owned by the user scott. * The master contains the following fields: empno, ename, job, sal, and deptno. * The detail contains the following fields deptno, dname, and loc. * The join condition is deptno. */ // Create the form var module = new FormModule("empdept"); // Create a window var mywin = new Window(module, "MYWIN"); // Create a canvas and set canvas-related properties var mycanvas = new Canvas(module, "MYCANVAS") { ViewportWidth = 512, ViewportHeight = 403, ViewportXPosition = 0, ViewportYPosition = 0, Width = 538, Height = 403, Window = mywin, }; // Create Emp block and set block-related properties var emp = new Block(module, "EMP") { IsDatabaseBlock = true, QueryDataSourceType = QueryDataSourceType.Table, QueryDataSourceName = "EMP", DMLDataTargetType = DMLDataTargetType.Table, DMLDataTargetName = "EMP" }; // Create Dept block and set block-related properties var dept = new Block(module, "DEPT") { IsDatabaseBlock = true, QueryDataSourceType = QueryDataSourceType.Table, QueryDataSourceName = "DEPT", DMLDataTargetType = DMLDataTargetType.Table, DMLDataTargetName = "DEPT" }; // Create empno item and item-related properties var empno = new Item(emp, "EMPNO") { ItemType = ItemType.TextItem, IsEnabled = true, IsKeyboardNavigable = true, DataType = ItemDataType.Number, MaximumLength = 6, IsRequired = true, DistanceBetweenRecords = 0, IsDatabaseItem = true, IsQueryAllowed = true, QueryLength = 6, IsUpdateAllowed = true, IsVisible = true, Canvas = mycanvas, XPosition = 32, YPosition = 50, Width = 51, Height = 17, Bevel = Bevel.Lowered, Hint = "Enter value for :EMPNO" }; // Create Ename item and item-related properties var ename = new Item(emp, "ENAME") { ItemType = ItemType.TextItem, IsEnabled = true, IsKeyboardNavigable = true, DataType = ItemDataType.Char, MaximumLength = 10, DistanceBetweenRecords = 0, IsDatabaseItem = true, IsQueryAllowed = true, QueryLength = 10, IsUpdateAllowed = true, IsVisible = true, Canvas = mycanvas, XPosition = 83, YPosition = 50, Width = 77, Height = 17, Bevel = Bevel.Lowered, Hint = "Enter value for :ENAME" }; // Create JOB item and item-related properties var job = new Item(emp, "JOB") { ItemType = ItemType.TextItem, IsEnabled = true, IsKeyboardNavigable = true, DataType = ItemDataType.Char, MaximumLength = 9, DistanceBetweenRecords = 0, IsDatabaseItem = true, IsQueryAllowed = true, QueryLength = 9, IsUpdateAllowed = true, IsVisible = true, Canvas = mycanvas, XPosition = 160, YPosition = 50, Width = 70, Height = 17, Bevel = Bevel.Lowered, Hint = "Enter value for :JOB" }; // Create SALARY item and item-related properties var sal = new Item(emp, "SAL") { ItemType = ItemType.TextItem, IsEnabled = true, IsKeyboardNavigable = true, DataType = ItemDataType.Number, MaximumLength = 9, DistanceBetweenRecords = 0, IsDatabaseItem = true, IsQueryAllowed = true, QueryLength = 9, IsUpdateAllowed = true, IsVisible = true, Canvas = mycanvas, XPosition = 352, YPosition = 50, Width = 70, Height = 17, Bevel = Bevel.Lowered, Hint = "Enter value for :SAL" }; // Create DEPTNO item and item-related properties var deptnoEmp = new Item(emp, "DEPTNO") { ItemType = ItemType.TextItem, IsEnabled = true, IsKeyboardNavigable = true, DataType = ItemDataType.Number, MaximumLength = 4, DistanceBetweenRecords = 0, IsDatabaseItem = true, IsQueryAllowed = true, QueryLength = 4, IsUpdateAllowed = true, IsVisible = true, Canvas = mycanvas, XPosition = 493, YPosition = 50, Width = 30, Height = 17, Bevel = Bevel.Lowered, Hint = "Enter value for :DEPTNO" }; // Create DEPTNO item and item-related properties var deptnoDept = new Item(dept, "DEPTNO") { ItemType = ItemType.TextItem, IsEnabled = true, IsKeyboardNavigable = true, DataType = ItemDataType.Number, MaximumLength = 4, DistanceBetweenRecords = 0, IsDatabaseItem = true, IsQueryAllowed = true, QueryLength = 4, IsUpdateAllowed = true, IsVisible = true, Canvas = mycanvas, XPosition = 32, YPosition = 151, Width = 38, Height = 17, Bevel = Bevel.Lowered, Hint = "Enter value for :DEPTNO" }; // Create DNAME item and item-related properties var dname = new Item(dept, "DNAME") { ItemType = ItemType.TextItem, IsEnabled = true, IsKeyboardNavigable = true, DataType = ItemDataType.Char, MaximumLength = 14, DistanceBetweenRecords = 0, IsDatabaseItem = true, IsQueryAllowed = true, QueryLength = 14, IsUpdateAllowed = true, IsVisible = true, Canvas = mycanvas, XPosition = 70, YPosition = 151, Width = 102, Height = 17, Bevel = Bevel.Lowered, Hint = "Enter value for :DNAME" }; // Create LOC item and item-related properties var loc = new Item(dept, "LOC") { ItemType = ItemType.TextItem, IsEnabled = true, IsKeyboardNavigable = true, DataType = ItemDataType.Char, MaximumLength = 13, DistanceBetweenRecords = 0, IsDatabaseItem = true, IsQueryAllowed = true, QueryLength = 14, IsUpdateAllowed = true, IsVisible = true, Canvas = mycanvas, XPosition = 173, YPosition = 151, Width = 96, Height = 17, Bevel = Bevel.Lowered, Hint = "Enter value for :LOC" }; // Create Relations and relations-related properties var relation = new BlockRelation(dept, "DEPT_EMP") { DetailBlock = "EMP", DeleteRecordBehavior = DeleteRecordBehavior.NonIsolated, IsDeferred = false, AutomaticQuery = false, PreventMasterlessOperations = false, JoinCondition = "DEPTNO" }; relation.Generate(); module.Save(); }
public static BooleanFormElement IsExpired(this FormModule <Domain.PasswordResetTicket> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.module.Field(x => x.IsExpired, file, line);
public static StringFormElement Password( this FormModule <Domain.Administrator> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.Password, file, line);
public static StringFormElement Salt( this FormModule <Domain.User> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.Salt, file, line);
public static DateTimeFormElement LastExecuted(this FormModule <Domain.BackgroundTask> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.module.Field(x => x.LastExecuted, file, line);
public static NumberFormElement TimeoutInMinutes(this FormModule <Domain.BackgroundTask> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.module.Field(x => x.TimeoutInMinutes, file, line);
public static StringFormElement ExecutingInstance(this FormModule <Domain.BackgroundTask> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.module.Field(x => x.ExecutingInstance, file, line);
public static StringFormElement UserIp(this FormModule <Domain.AuditEvent> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.module.Field(x => x.UserIp, file, line);
public static StringFormElement LastName(this FormModule <Domain.User> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.module.Field(x => x.LastName, file, line);
public static NumberFormElement PasswordResetTicketExpiryMinutes( this FormModule <Domain.Settings> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.PasswordResetTicketExpiryMinutes, file, line);
public static AssociationFormElement Type(this FormModule <Domain.Pet> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.module.Field(x => x.Type, file, line);
public static BooleanFormElement IsDeactivated( this FormModule <Domain.User> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.IsDeactivated, file, line);
public static StringFormElement Key( this FormModule <Domain.ContentBlock> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.Key, file, line);
public static StringFormElement Email(this FormModule <Domain.Administrator> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.module.Field(x => x.Email, file, line);
public static StringFormElement IP( this FormModule <Domain.LogonFailure> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.IP, file, line);
public static StringFormElement ItemType( this FormModule <Domain.AuditEvent> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.container.Field(x => x.ItemType, file, line);
public static DateTimeFormElement Date(this FormModule <Domain.LogonFailure> .FieldComponents @this, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0) => @this.module.Field(x => x.Date, file, line);