Пример #1
0
        public ModelApiTests()
        {
            _modelFactoryMoq.Setup(x => x.GetModelPolicies())
            .Returns(_policyList);

            _target = new ModelApi(_modelFactoryMoq.Object);
        }
Пример #2
0
 public DataContextReport()
 {
     try
     {
         var command = new CommandSnuOneAuto();
         ModelApi = ConfigFile.ResultGetTemplate <ModelServiceDataBase>(ConfigFile.ServiceModelInventory);
         ModelApi.ForEach(service => service.ApiService = string.Format(service.ApiService, ConfigFile.HostNameService));
         Report = new ReportXlsxMethod(ConfigFile.ExcelReportFile);
         ReportJournalAndFile  = new ReportJournalMethod(ConfigFile.PathJurnal, ConfigFile.PathInn, ModelApi);
         LabelModel            = new LabelModel();
         DeleteJournal         = new DelegateCommand(() => { ReportJournalAndFile.DeleteXmlReportJournal(); });
         DeleteReport          = new DelegateCommand(() => { Report.DeleteReportFile(); });
         OpenReport            = new DelegateCommand(() => { Report.OpenReport(); });
         OpenFile              = new DelegateCommand(() => { command.ConvertXslToXmlAndOpen(Report, ReportJournalAndFile, ConfigFile.ExcelReportFile); });
         FileToServerApiReport = new DelegateCommand(() => command.FileToServerApiReport(LabelModel, ModelApi, ReportJournalAndFile));
         Update = new DelegateCommand(() =>
         {
             ReportJournalAndFile.AddFileXml(ConfigFile.PathInn);
             ReportJournalAndFile.AddJournal(ConfigFile.PathJurnal);
         });
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
Пример #3
0
        public frmProject(ModelApi mdl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            this.mdl = mdl;
        }
Пример #4
0
        public frmMain()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            mdl    = new ModelApi("Initial Catalog=CodeGen;Data Source=localhost;Integrated Security=SSPI;");
            frmprj = new frmProject(mdl);
            frmprj.Show();
        }
Пример #5
0
        public frmOpenModel(ModelApi mdl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            DataTable dt = mdl.listModels();

            for (int curRow = 0; curRow < dt.Rows.Count; curRow++)
            {
                TreeNode tn = new TreeNode(dt.Rows[curRow][1].ToString().Trim());
                tn.Tag = dt.Rows[curRow][0];
                this.treeView1.Nodes.Add(tn);
            }
        }
Пример #6
0
 public void Init()
 {
     instance = new ModelApi();
 }