コード例 #1
0
ファイル: FormAPIController.cs プロジェクト: SallyKimOh/AST
        // GET: api/FormAPI
        public JsonResult Get()
        {
            FormModule module    = new FormModule(_context);
            var        resultVal = module.GetList();

            return(Json(resultVal));
        }
コード例 #2
0
ファイル: FormAPIController.cs プロジェクト: SallyKimOh/AST
        public JsonResult GetInfo(int id)
        {
            FormModule module = new FormModule(_context);
            var        item   = module.GetInfo(id);

            return(Json(item));
        }
コード例 #3
0
        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>());
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: FMXParser.cs プロジェクト: horzsolt/FMBExplorer
        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);
        }
コード例 #6
0
 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);
コード例 #7
0
 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);
コード例 #8
0
 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);
コード例 #9
0
 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);
コード例 #10
0
        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();
        }
コード例 #11
0
 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);
コード例 #12
0
 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);
コード例 #13
0
 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);
コード例 #14
0
 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);
コード例 #15
0
 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);
コード例 #16
0
 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);
コード例 #17
0
 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);
コード例 #18
0
 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);
コード例 #19
0
 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);
コード例 #20
0
 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);
コード例 #21
0
 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);
コード例 #22
0
 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);
コード例 #23
0
 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);
コード例 #24
0
 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);
コード例 #25
0
 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);
コード例 #26
0
 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);