public frmProdStatusMonitoring()
        {
            InitializeComponent();
            this.lvMacStatus.Font = ControlSetting.ListFont;

            this._ICodeMasterBL = MasterBLLFactory.GetBLL<ICodeMasterBL>(MasterBLLFactory.CodeMaster_cmt);
            this._IProStatusMontoringBL = MasterBLLFactory.GetBLL<IProStatusMontoringBL>(MasterBLLFactory.ProStatusMontoring);
            this._IMachineMasterBL = new MachineMasterBL();
            this.m_AllCodeMaster = new List<CodeMaster_cmt_Info>();
            this.m_AllMachineMaster = new List<MachineMaster_mmt_Info>();
            this.m_AllStatusMonitoring = new List<ProStatusMonitoring>();
            this.m_NowStatusMonitoring = new List<ProStatusMonitoring>();
            this.sysToolBar.BtnRefresh_IsUsed = true;
            this.sysToolBar.BtnExit_IsUsed = true;
            this.sysToolBar.BtnRefresh_IsEnabled = true;
            this.sysToolBar.BtnExit_IsEnabled = true;
            this.sysToolBar.OnItemRefresh_Click += new WindowControls.HBPMS.SystemToolBar.ItemRefresh_Click(sysToolBar_OnItemRefresh_Click);

            this.btnFirst.Click += new EventHandler(btnFirst_Click);
            this.btnUp.Click += new EventHandler(btnUp_Click);
            this.btnDown.Click += new EventHandler(btnDown_Click);
            this.btnLast.Click += new EventHandler(btnLast_Click);
            this.btnGo.Click += new EventHandler(btnGo_Click);

            this.cbxRefreshSpan.SelectedValueChanged += new EventHandler(cbxRefreshSpan_SelectedValueChanged);
            this.cbxAutoRefresh.Click += new EventHandler(cbxAutoRefresh_Click);
            this.cbxViewType.SelectedIndexChanged += new EventHandler(cbxViewType_SelectedIndexChanged);

            this.m_iMaxCount = 100;
            this.labLvMaxCount.Text = this.m_iMaxCount.ToString();
        }
Beispiel #2
0
 public HOTReportSelfCheck()
 {
     InitializeComponent();
     _ProductReportBL = new ProductReportBL(Common.Util.ConfigUtil.GetAppSetting("ConnectionString"));
     this._areaMasterBL = MasterBLLFactory.GetBLL<IAreaMasterBL>(MasterBLLFactory.AreaMaster);
     this._MachineMasterBL = new MachineMasterBL();
     this._codeMasterBL = MasterBLLFactory.GetBLL<ICodeMasterBL>(MasterBLLFactory.CodeMaster_cmt);
     this._shiftTypeMasterBL = MasterBLLFactory.GetBLL<IShiftTypeMasterBL>(MasterBLLFactory.ShiftTypeMaster_stm);
     InitGui();
 }
Beispiel #3
0
 public MachineAppSetting()
 {
     InitializeComponent();
     this._MachineMasterBL = new MachineMasterBL();
     this.mIsChanged = false;
     //todo: 需初始化用戶信息
     if (base.UserInformation == null)
     {
         base.UserInformation = new Model.SysMaster.Sys_UserMaster_usm_Info();
         base.UserInformation.usm_cUserLoginID = UserInformation.usm_cUserLoginID;
     }
 }
        private string _StaffNo; //工號

        #endregion Fields

        #region Constructors

        public WorkingManAppSetting()
        {
            InitializeComponent();
            this._MachineMasterBL = new MachineMasterBL();
            this._StaffInfoMasterBL = new BLL.Impl.HBPMS.Master.StaffInfoMasterBL();
            this._isChanged = false;
            //todo: 需初始化用戶信息
            if (base.UserInformation == null)
            {
                base.UserInformation = new Model.SysMaster.Sys_UserMaster_usm_Info();
                base.UserInformation.usm_cUserLoginID = "sys";
            }
        }
 public MachineSignalStatusGroup()
 {
     InitializeComponent();
     InitializeComponentData();
     try
     {
         this._signalLightsStatusBL = MasterBLLFactory.GetBLL<ISignalLightsStatusBL>(MasterBLLFactory.SignalLightsStatus);
         this._machineMasterBL = new MachineMasterBL();
     }
     catch (Exception Ex)
     {
         ShowErrorMessage(Ex.Message);
     }
 }
Beispiel #6
0
        bool ISync.Download(string machineID)
        {
            try
            {
                ShowMessage("同步機台主檔...");
                IList<MachineMaster_mmt_Info> sourceList;
                MachineMasterBL mmbl = new MachineMasterBL();
                if (!mmbl.CheckNeedUpdate())
                {
                    ShowMessage("機台主檔不需要更新。");
                    return true;
                }
                //加載SERVER機台主檔
                using (DBContext uow = new DBContext(NHConfigFactory.DBConfig.HBIMSN))
                {
                    var query = uow.CurrentSession.QueryOver<MachineMaster_mmt_Info>();
                    sourceList = query.List<MachineMaster_mmt_Info>();

                }

                using (DBContext uow = DBContext.Begin(NHConfigFactory.DBConfig.PPC))
                {

                    uow.CurrentSession.CreateQuery("delete from MachineMaster_mmt_Info").ExecuteUpdate();

                    //保存SERVER機台主檔到LOCAL
                    foreach (var item in sourceList)
                    {
                        uow.CurrentSession.Save(item);
                    }

                }
                ShowMessage("同步機台主檔完成");
                return true;

            }
            catch (Exception ex)
            {
                string message = "同步機台主檔失敗" + ex.Message;
                ShowMessage(message);
                Common.General.BLLoger.Error(message);
                return false;
                //throw ex;
            }
        }
Beispiel #7
0
        /// <summary>
        /// 填充數據到控件(機器主)
        /// </summary>
        /// <param name="source"></param>
        protected void FillData()
        {
            lock (this.snyObj)
            {

                MachineMasterBL MachineMaster = new MachineMasterBL();

                var listMachine = MachineMaster.SearchRecords(new MachineMaster_mmt_Info());

                if (listMachine == null)
                    return;
                this.lvMachineMain.Clear();
                this.lvReadyAll.Clear();
                this.lvReadySelect.Clear();
                this.lvMachineMain.BeginUpdate();

                initMachineMain();
                initReadyAll();
                initReadySelect();

                foreach (MachineMaster_mmt_Info t in listMachine)
                {

                    ListViewItem item = new ListViewItem();

                    item.Tag = t.mmt_cMachineID.ToString();
                    item.SubItems[0].Text = t.mmt_cMachineID.ToString(); ;
                    item.SubItems.Add(t.mmt_cMachineID.ToString());
                    item.SubItems.Add(t.mmt_cPressCode.ToString());
                    item.SubItems.Add(t.mmt_cMachineName.ToString());
                    item.SubItems.Add(t.mmt_cMachineType.ToString());
                    item.SubItems.Add(t.cAreaName.ToString());
                    item.SubItems.Add(t.mmt_cLocation);
                    item.SubItems.Add(t.cAreaCode.ToString());

                    this.lvMachineMain.Items.Add(item);
                }

                this.lvMachineMain.EndUpdate();
            }
        }
Beispiel #8
0
        private void BindcboMachine(Guid AreaID)
        {
            if (AreaID != Guid.Empty)
            {

                List<MachineMaster_mmt_Info> allmac = new MachineMasterBL().MachineList();
                allmac = allmac.Where(w => w.mmt_cAreaID == AreaID).ToList();

                cboMachineNO.DisplayMember = "mmt_cMachineName";
                cboMachineNO.ValueMember = "mmt_cMachineID";
                cboMachineNO.DataSource = allmac;

                cboMachineNO.SelectedIndex = -1;

            }
            else
            {
                cboMachineNO.DataSource = null;
                cboMachineNO.Items.Clear();
            }
        }
Beispiel #9
0
        /// <summary>
        /// 初始化印刷機選擇列表
        /// </summary>
        private void InitMachineTree()
        {
            this.lbxMachineList.Items.Clear();
            this.lbxSelectedMachine.Items.Clear();

            this.lbxMachineList.DisplayMember = "mmt_cBrandName";
            this.lbxMachineList.ValueMember = "RecordID";

            this.lbxSelectedMachine.DisplayMember = "mmt_cBrandName";
            this.lbxSelectedMachine.ValueMember = "RecordID";

            MachineMasterBL machineBL=new MachineMasterBL();

            List<MachineMaster_mmt_Info> machineList = machineBL.MachineList();

            for (int i = 0; i < machineList.Count; i++)
            {
                //MachineMaster_mmt machineMaster = new MachineMaster_mmt();
                //machineMaster.RecordID = i;
                //machineMaster.mmt_cBrandName = "機器" + i;

                machineList[i].mmt_cPressCode = machineList[i].mmt_cMachineID + " " + machineList[i].mmt_cPressCode;

                this.lbxMachineList.Items.Add(machineList[i]);

            }

            //this.lbxMachineList.DataSource = machineList;
        }
Beispiel #10
0
        private void lvReadyMain_SelectedIndexChanged(object sender, EventArgs e)
        {
            Guid PIPFID = Guid.Empty;
            //int iMachineType = -1;
            if (lvReadyMain.SelectedItems.Count > 0)
            {
                if (recordPIPFID != Guid.Empty && recordPIPFID != new Guid(lvReadyMain.SelectedItems[0].SubItems[0].Text.ToString()))
                {
                    if (btnSave.Enabled == true)
                    {
                        if (MessageBox.Show("是否確認保存?", " 保存提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                        {
                            btnSave_Click(null, null);
                        }
                        else
                        {
                            btnSave.Enabled = false;
                            recordPIPFID = Guid.Empty;
                        }
                    }
                }

                this.lvMachineAll.Clear();
                this.lvMachineSelect.Clear();
                PIPFID = new Guid(lvReadyMain.SelectedItems[0].SubItems[0].Text.ToString());
                recordPIPFID = PIPFID;

                IPrepareProjectMasterBL PPM = MasterBLLFactory.GetBLL<IPrepareProjectMasterBL>(MasterBLLFactory.PrepareProjectMaster_ppm);
                List<Model.HBPMS.Management.RunningManagement.PrepareProjectMaster_ppm_Info> listReadyAll = PPM.GetAllProjects();

                //listAllMachine = manager.ShowAllMachineByMachineType(iMachineType);

                MachineMasterBL MachineMaster = new MachineMasterBL();

                var listAllMachine = MachineMaster.SearchRecords(new MachineMaster_mmt_Info()).ToList();

                List<MachinePrepareItem_mpit_Info> listReadySelect = _MachineReadyPlanBL.GetPrepareProjectsByProjectID(recordPIPFID.ToString());

                if (listReadySelect != null)
                {
                    foreach (MachinePrepareItem_mpit_Info selected in listReadySelect)
                    {
                        foreach (MachineMaster_mmt_Info all in listAllMachine)
                        {

                            if (selected.mpit_cDCMPID == all.mmt_cMachineID)
                            {
                                listAllMachine.Remove(all);
                                break;
                            }
                        }
                    }
                }

                FillMachineAll(listAllMachine);
                FillMachineSelect(listReadySelect);
            }
        }
Beispiel #11
0
        private void lvStopReasonsMain_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            if (lvStopReasonsMain.SelectedItems.Count > 0)
            {
                if (CheckIsSave())
                {
                    ShowDialogSaveData();
                }
                StopReasonMaster_srm_Info srp = lvStopReasonsMain.SelectedItems[0].Tag as StopReasonMaster_srm_Info;
                mSelectedReasonID = srp.srm_iRecordID;

                MachineMasterBL machineMaster = new MachineMasterBL();
                MachineMaster_mmt_Info cond = new MachineMaster_mmt_Info();
                cond.mmt_cMachineType = srp.srm_cMachineType;
                var vmachines = machineMaster.SearchRecords(cond);

                IList<MachineStopReasonProfile_msrp_Info> machineStopReasonProfile = _MachineStopReasonBL.GetStopReasonByReasonID(mSelectedReasonID);

                if (machineStopReasonProfile != null)
                {
                    m_MachineStopReasonProfile = machineStopReasonProfile.ToList();
                }
                else
                {
                    m_MachineStopReasonProfile = new List<MachineStopReasonProfile_msrp_Info>();
                }

                List<MachineMaster_mmt_Info> machines = new List<MachineMaster_mmt_Info>();

                foreach (MachineMaster_mmt_Info item in vmachines)
                {
                    machines.Add(item);
                }

                List<MachineMaster_mmt_Info> selectedMachines = new List<MachineMaster_mmt_Info>();
                List<MachineMaster_mmt_Info> unSelectedMachines = new List<MachineMaster_mmt_Info>();
                foreach (MachineStopReasonProfile_msrp_Info item in m_MachineStopReasonProfile)
                {
                    MachineMaster_mmt_Info obj = machines.Find(s => s.mmt_cMachineID.ToUpper().Trim() == item.msrp_cMachineID.ToUpper().Trim());
                    if (obj != null)
                    {
                        selectedMachines.Add(obj);
                    }
                }
                foreach (MachineMaster_mmt_Info item in machines)
                {
                    if (!selectedMachines.Contains(item))
                        unSelectedMachines.Add(item);
                }

                FillMachineData(unSelectedMachines, lvUnSelectedMachines2, true);
                FillMachineData(selectedMachines, lvSelectedMachines2, true);
                //ClearData();
                tsbAdd.Enabled = false;
                m_SelectedMainObject = srp;
            }

            this.Cursor = Cursors.Default;
        }
Beispiel #12
0
        private void BindMachines()
        {
            MachineMasterBL MachineMaster = new MachineMasterBL();

            var vlistMachine = MachineMaster.SearchRecords(new MachineMaster_mmt_Info());

            List<MachineMaster_mmt_Info> listMachine = new List<MachineMaster_mmt_Info>();

            foreach (MachineMaster_mmt_Info item in vlistMachine)
            {
                listMachine.Add(item);
            }

            FillMachineData(listMachine, lvMachinesMain, true);
        }