Exemplo n.º 1
0
        public TreeNodeInfo[] GetMenuTreeNodes(CustEnum.System system)
        {
            List<Sys_FormMaster_fom_Info> infos = new List<Sys_FormMaster_fom_Info>();

            List<TreeNodeInfo> treeNodeInfoList = new List<TreeNodeInfo>();
            TreeNodeInfo rootNodeInfo = null;
            TreeNodeInfo[] treeNodeInfos = null;

            TreeNodeInfo itemNodeInfo = null;

            infos = _sysFormMasterDA.GetWinTreeNode(system.ToString());

            foreach (Sys_FormMaster_fom_Info inf in infos)
            {
                Sys_FormMaster_fom_Info info = inf;
                rootNodeInfo = new TreeNodeInfo();
                rootNodeInfo.Text = info.fom_cFormDesc;
                rootNodeInfo.Name = info.fom_cFormNumber;
                rootNodeInfo.Tag = info.fom_cExePath;
                rootNodeInfo.Index = info.fom_iIndex;

                rootNodeInfo.FileName = info.fom_iRecordID.ToString();

                TreeNodeInfo nodeInfo = null;
                info = new Sys_FormMaster_fom_Info();
                info.fom_iParentID = int.Parse(rootNodeInfo.FileName.ToString());
                foreach (var chile in _sysFormMasterDA.SearchRecords(info, "all"))
                {
                    info = chile as Sys_FormMaster_fom_Info;
                    string Name = info.fom_iRecordID.ToString();
                    nodeInfo = null;
                    nodeInfo = LocalGeneralMenu.Instance.InsertTreeNode(rootNodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, info.fom_iImageIndex);
                    info = new Sys_FormMaster_fom_Info();
                    info.fom_iParentID = int.Parse(Name.ToString());
                    foreach (var q in _sysFormMasterDA.SearchRecords(info, "all"))
                    {
                        info = q as Sys_FormMaster_fom_Info;

                        if (info.fom_cFormNumber.ToString().ToUpper() == "DEMO")
                        {
                            itemNodeInfo = LocalGeneralMenu.Instance.InsertTreeNode(nodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, info.fom_iImageIndex);
                            itemNodeInfo.Remark = "EXE";
                            itemNodeInfo.FileName = "WPFUI\\WPFUI.exe";
                        }
                        else
                            LocalGeneralMenu.Instance.InsertTreeNode(nodeInfo, info.fom_cFormDesc, info.fom_cExePath, info.fom_cFormNumber, info.fom_iIndex, info.fom_iImageIndex);
                    }
                }
                treeNodeInfoList.Add(rootNodeInfo);

            }
            treeNodeInfos = treeNodeInfoList.ToArray();

            return treeNodeInfos;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 設置信息燈狀態
        /// </summary>
        /// <param name="projectStatus">工程狀態</param>
        public override void SetSignalStatus(CustEnum.ProjectStatus projectStatus)
        {
            try
            {
                if (base.SignalLightsStatusInfos != null && base.SignalLightsStatusInfos.Count > 0)
                {
                    SignalLightsStatusInfo currentStatusInfo = base.SignalLightsStatusInfos.FirstOrDefault(x => x.Status == projectStatus.ToString());//匹配指定狀態的信號燈配置記錄

                    if (currentStatusInfo != null)
                    {
                        this.m_currentProjStatus = currentStatusInfo;
                    }
                    else
                    {
                        this.m_currentProjStatus = CreateInitialStatusInfo();
                    }
                }
            }
            catch (Exception)
            {

            }
        }
Exemplo n.º 3
0
        //public ReturnValueInfo DeleteRecord_Sqlite(ProjectQCRecord_pqc_Info model)
        //{
        //    using (DBContext uow = DBContext.Begin())
        //    {
        //        try
        //        {
        //            ReturnValueInfo rvInfo = new ReturnValueInfo();
        //            //ReturnValueInfo rvInfoRecord = new ReturnValueInfo();
        //            if (model.ListProblemRecords != null)
        //            {
        //                foreach (ProjectQCProblem_pqcp_Info problemItem in model.ListProblemRecords)
        //                {
        //                    uow.CurrentSession.Delete(problemItem);
        //                }
        //            }
        //            //rvInfoRecord = this._IProjectQCRecordDA_Sqlite.Delete(model);
        //            //if (!rvInfoRecord.boolValue || rvInfoRecord.isError)
        //            //{
        //            //    return rvInfoRecord;
        //            //}
        //            rvInfo.boolValue = true;
        //            return rvInfo;
        //        }
        //        catch (Exception ex)
        //        {
        //            throw ex;
        //        }
        //    }
        //}
        public bool AddQCBlankRecord(ProjectQCRecord_pqc_Info pqcRecord, CustEnum.RecordType recordType)
        {
            try
            {
                using (DBContext uow = DBContext.Begin())
                {
                    int maxRecord = 0;
                    QCPloblemView_qcpv_Info lastRec = uow.CurrentSession.QueryOver<QCPloblemView_qcpv_Info>().And(d => d.pqc_SPLID == pqcRecord.pqc_SPLID).OrderBy(d => d.pqc_iQCTimes).Desc.Take(1).SingleOrDefault();
                    if (lastRec != null)
                    {
                        maxRecord = lastRec.pqc_iQCTimes;
                    }

                    ProjectQCRecord_pqc_Info pqc = new ProjectQCRecord_pqc_Info();
                    pqc.pqc_RecordID = Guid.NewGuid();
                    pqc.pqc_iQCQTY = 0;
                    pqc.pqc_iProdQTY = pqcRecord.pqc_iProdQTY;
                    pqc.pqc_iQCTimes = maxRecord + 1;
                    pqc.pqc_cMode = CustEnum.RecordMode.MANUAL.ToString();
                    pqc.pqc_cType = recordType.ToString();
                    pqc.pqc_dAddDate = DateTime.Now;
                    pqc.pqc_SPLID = pqcRecord.pqc_SPLID;
                    uow.CurrentSession.Save(pqc);

                    uow.CurrentSession.CreateQuery("update ShiftProjList_spl_Info set spl_iQCTimes=:spl_iQCTimes where spl_RecordID=:spl_RecordID").SetInt32("spl_iQCTimes", pqc.pqc_iQCTimes).SetGuid("spl_RecordID", pqcRecord.pqc_SPLID).ExecuteUpdate();

                    uow.CurrentSession.Flush();
                    return true;
                }

            }
            catch (Exception ex)
            {

                return false;
                throw ex;
            }
        }