private void SwitchProjectsTransfer(object sender, RoutedEventArgs e)
        {
            var projectId = (long)CmbProjects.SelectedValue;
            var project   = _context.FirstOrDefault <EmsProject>($"Id = {projectId}");

            project.onTransfer            = !project.onTransfer;
            _projectOnTransfer[projectId] = project.onTransfer;
            var result = _context.AddOrUpdate(project);

            if (result > 0)
            {
                LblProjectOnTransfer.Content = project.onTransfer;
            }
        }
Пример #2
0
        private static void AddDeviceInfo(emsData emsData, string systemDeviceCode)
        {
            if (_dataSource == "web")
            {
                var info = SystemDevs[systemDeviceCode];
                emsData.devCode = info.UnicomDevCode;
                emsData.prjCode = info.StatCode;
                emsData.prjType = info.ProjectType;
                return;
            }
            var device = _context.FirstOrDefault <EmsDevice>($"SystemCode = {systemDeviceCode}");

            var project = _context.FirstOrDefault <EmsProject>($"code == '{device.projectCode}'");

            emsData.devCode = device.code;
            emsData.prjCode = project.code;
            emsData.prjType = project.prjType;
        }