public FieldDiscriptor(LogFieldSetupDO obj)
 {
     this.Field    = obj.Field;
     this.Header   = obj.Heading;
     this.Format   = obj.Format;
     this.DataType = typeof(LogVM);
 }
Exemple #2
0
        private void logsButton_Click(object sender, EventArgs e)
        {
            using (var ds = new DAL())
            {
                var cuttingUnit = new CuttingUnit()
                {
                    DAL  = ds,
                    Code = "01"
                };
                cuttingUnit.Save();

                var stratum = new Stratum()
                {
                    DAL  = ds,
                    Code = "01"
                };
                stratum.Save();

                var fieldSetup = new LogFieldSetupDO()
                {
                    DAL        = ds,
                    Stratum_CN = stratum.Stratum_CN,
                    Field      = LOG.LOGNUMBER,
                    Heading    = LOG.LOGNUMBER
                };
                fieldSetup.Save();

                fieldSetup = new LogFieldSetupDO()
                {
                    DAL        = ds,
                    Stratum_CN = stratum.Stratum_CN,
                    Field      = LOG.GRADE,
                    Heading    = LOG.GRADE
                };
                fieldSetup.Save();

                var controller = new ApplicationController(null);
                var tree       = new Tree()
                {
                    DAL            = ds,
                    CuttingUnit_CN = cuttingUnit.CuttingUnit_CN,
                    Stratum_CN     = stratum.Stratum_CN,
                    TreeNumber     = 1
                };
                tree.Save();

                var dataService = new ILogDataService(tree, (RegionLogInfo)null, ds);

                using (var view = new FormLogs(dataService))
                {
                    view.ShowDialog();
                }
            }
        }