Esempio n. 1
0
 public MainForm(bool isPreload = true)
 {
     InitializeComponent();
     this.Text       = "罗斯(无锡)PLM数据同步工具" + Application.ProductName + " v" + Application.ProductVersion;
     Utility         = new Utilities();
     SysConfig       = Utility.GetSysCfg();
     SLabelUser.Text = BasicDatas.CurrentUser;
     CurrentDgv      = this.dataGridViewMain;
     if (SysConfig != null)
     {
         RLD     = new RossLiveRespository();
         RossCfg = RLD.GetRossCfg();
         ERP     = new ERPRepository(SysConfig.ERPConn);
         PLM     = new PLMRespository(SysConfig.PLMConn, RossCfg.Units);
         BscData = new BasicDatas(SysConfig.ERPConn, SysConfig.PLMConn);
         InitData();
         if (isPreload)
         {
             FormLoading formLoad = new FormLoading(SysConfig.ERPConn, SysConfig.PLMConn);
             formLoad.ShowDialog();
             formLoad.Owner = this;
         }
     }
     else
     {
         MessageBox.Show("配置文件错误,请联系软件供应商!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 public FormBOMComp(ERPRepository _ERP, PLMRespository _PLM)
 {
     InitializeComponent();
     ERP     = _ERP;
     PLM     = _PLM;
     Utility = new Utilities();
 }
Esempio n. 3
0
        public FormServer()
        {
            InitializeComponent();
            Utility   = new Utilities();
            RLD       = new RossLiveRespository();
            RossCfg   = RLD.GetRossCfg();
            SysConfig = Utility.GetSysCfg();
            ERP       = new ERPRepository(SysConfig.ERPConn);
            PLM       = new PLMRespository(SysConfig.PLMConn, RossCfg.Units);

            BscData = new BasicDatas(SysConfig.ERPConn, SysConfig.PLMConn);

            StartTime      = DateTime.Now;
            startTime.Text = "启动时间:" + StartTime.ToString();
            notifyMenuItem_start.Enabled = false;
            notifyMenuItem_stop.Enabled  = true;

            UpdateLogs UptLog = new UpdateLogs();

            UptLog.CompleteLog = "Start System Background Service";
            UptLog.LogTitle    = "Start System Service";
            UptLog.Status      = "OK";
            RLD.InsertUptLog(UptLog);

            this.Text = Application.ProductName + " v" + Application.ProductVersion;
        }
Esempio n. 4
0
        public FormLogin()
        {
            InitializeComponent();
            this.Text = "罗斯(无锡)PLM数据同步工具" + Application.ProductName + " v" + Application.ProductVersion;

            Utility   = new Utilities();
            SysConfig = Utility.GetSysCfg();
            if (SysConfig != null)
            {
                ERP = new ERPRepository(SysConfig.ERPConn);
                RLD = new RossLiveRespository();

                if (Utility.CheckUpdate(SysConfig.AutoUpdateURL))
                {
                    if (MessageBox.Show("系统有新版本!确定立即更新吗?", "系统提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                    {
                        System.Diagnostics.Process AutoUpdate = new System.Diagnostics.Process();
                        AutoUpdate.StartInfo.FileName  = Application.StartupPath + @"\AutoUpdate.bat";
                        AutoUpdate.EnableRaisingEvents = true;
                        AutoUpdate.Start();
                    }
                    else
                    {
                        System.Environment.Exit(0);
                    }
                }
            }
            else
            {
                MessageBox.Show("数据库连接出错,请点击设置进行系统配置...", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                btnLogin.Enabled = false;
            }
        }
Esempio n. 5
0
 public FormPartCombined(ERPRepository _ERP, PLMRespository _PLM)
 {
     InitializeComponent();
     ERP       = _ERP;
     PLM       = _PLM;
     Utility   = new Utilities();
     SysConfig = Utility.GetSysCfg();
 }
 public FormUpdatePart(Entity.DTO.DTO_Config _SysConfig, PLMRespository _PLM, ERPRepository _ERP)
 {
     InitializeComponent();
     SysConfig = _SysConfig;
     PLM       = _PLM;
     ERP       = _ERP;
     Utility   = new Utilities();
 }
Esempio n. 7
0
 public FormMain()
 {
     InitializeComponent();
     ERP     = new ERPRepository("ERPDbContextLive");
     PLM     = new PLMRespository("PLMDbContext");
     BscData = new BasicDatas("ERPDbContextLive", "PLMDbContext");
     AutoCache();
     this.Text = "PLM_BOM自检 v" + Application.ProductVersion;
 }
Esempio n. 8
0
        public void DoSync()
        {
            SysConfig = Utility.GetSysCfg();
            if (SysConfig != null)
            {
                ERP = new ERPRepository(SysConfig.ERPConn);
                PLM = new PLMRespository(SysConfig.PLMConn, ConfigUnit);

                timerSync.Enabled = true;
                pecentExe         = 10;
                lblStatus         = "开始同步数据...";

                progressBarSync.Value   = pecentExe;
                progressBarSync.Maximum = 100;

                //Task taskSync = Task.Factory.StartNew(() =>
                //{

                //}, TaskCreationOptions.None);
                buttonStartSync.Enabled = false;
                try
                {
                    ListMBOM  = new List <ExportDto.MBOM_UD>();
                    ListMPART = new List <ExportDto.MPART>();

                    CallGetNewPart(PartNumArr, out ListMBOM, out ListMPART);
                    CallGetDataDelRev(ListMPART, cBoxOnlySyncPart.Checked);
                    CallGetNewBOO(PartNumArr, ListMBOM, cBoxOnlySyncPart.Checked);
                    CallGetNewBOM(PartNumArr, cBoxOnlySyncPart.Checked);

                    StartSync(cBoxOnlySyncPart.Checked);
                }
                catch (Exception err)
                {
                    buttonStartSync.Enabled = true;
                    processSync             = null;
                    Utilities.Log(err);
                    MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Esempio n. 9
0
 public FormPartRev(ERPRepository _ERP)
 {
     InitializeComponent();
     ERP = _ERP;
 }