/// <summary>
        /// 绑定用餐时间类型
        /// </summary>
        void BindMealTypeCombo()
        {
            List<IModelObject> listValues = new List<IModelObject>();
            foreach (Common.DefineConstantValue.MealType item in Enum.GetValues(typeof(Common.DefineConstantValue.MealType)))
            {
                if (item != Common.DefineConstantValue.MealType.UnKnown)
                {
                    ComboboxDataInfo value = new ComboboxDataInfo();
                    value.ValueMember = item.ToString();
                    value.DisplayMember = Common.DefineConstantValue.GetMealTypeDesc(item);
                    listValues.Add(value);
                }
            }

            cbbMealType.SetDataSource(listValues);
            cbbMealType.SelectedIndex = -1;
        }
Beispiel #2
0
        /// <summary>
        /// 从字码主档中获得Combobox数据列表
        /// </summary>
        /// <param name="codeMasterKey1">主键一</param>
        /// <returns></returns>
        public List<ComboboxDataInfo> GetComboboxDataInfoListFromCodeMaster(string codeMasterKey1)
        {
            List<ComboboxDataInfo> comboboxDataInfoList = null;
            List<CodeMasterInfo> codeMasterInfoList = null;
            CodeMasterFindInfo codeMasterFindInfo = new CodeMasterFindInfo();
            ICodeMasterDA iCodeMasterDA = null;

            codeMasterFindInfo.CmtCKey1 = codeMasterKey1;

            iCodeMasterDA = CodeMasterDAFactory.Instance.GetCodeMasterDA();

            try
            {
                codeMasterInfoList = iCodeMasterDA.FindRecord(codeMasterFindInfo);
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            if (codeMasterInfoList != null)
            {
                if (codeMasterInfoList.Count > 0)
                {
                    ComboboxDataInfo comboboxDataInfo = null;
                    comboboxDataInfoList = new List<ComboboxDataInfo>();
                    for (int i = 0; i < codeMasterInfoList.Count; i++)
                    {
                        comboboxDataInfo = new ComboboxDataInfo();
                        comboboxDataInfo.DisplayMember = codeMasterInfoList[i].CmtCValue;
                        comboboxDataInfo.ValueMember = codeMasterInfoList[i].CmtCKey2;

                        comboboxDataInfoList.Add(comboboxDataInfo);
                    }
                }
            }

            return comboboxDataInfoList;
        }
Beispiel #3
0
        /// <summary>
        /// 取得區域信息 by SIMON
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetAreaMaster()
        {
            List<Model.General.ComboboxDataInfo> infoList = new List<Model.General.ComboboxDataInfo>();

            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    IQueryable<AreaMaster_amr> areaInfo = from t in db.AreaMaster_amr
                                                          orderby t.amr_cAreaName
                                                          select t;

                    if (areaInfo != null && areaInfo.Count() > 0)
                    {
                        foreach (AreaMaster_amr item in areaInfo)
                        {
                            Model.General.ComboboxDataInfo info = new Model.General.ComboboxDataInfo();
                            info.DisplayMember = item.amr_cAreaName;
                            info.ValueMember = item.amr_cRecordID.ToString();
                            infoList.Add(info);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #4
0
        /// <summary>
        /// 獲取維修要求--維修級別
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetMaintenanceLevel()
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                ICodeMasterDA da = SQLiteDAFacotry.GetDAL<ICodeMasterDA>(SQLiteDAFacotry.CodeMasterDA);
                CodeMaster_cmt_Info cmtInfo = new CodeMaster_cmt_Info();
                cmtInfo.cmt_cKey1 = Common.DefineConstantValue.CodeMasterDefine.KEY1_PPCFORMITEM;
                cmtInfo.cmt_cKey2 = Common.DefineConstantValue.CodeMasterDefine.KEY2_PPCFORMITEM_MAINTENANCELEVEL;
                Dictionary<string, object> param = new Dictionary<string, object>();
                param.Add("cmt_cKey1", cmtInfo.cmt_cKey1);
                param.Add("cmt_cKey2", cmtInfo.cmt_cKey2);
                List<CodeMaster_cmt_Info> listCmt = da.GetEntities<CodeMaster_cmt_Info>(param).ToList();
                if (listCmt != null && listCmt.Count > 0)
                {
                    foreach (CodeMaster_cmt_Info cmtItem in listCmt)
                    {
                        ComboboxDataInfo info = new ComboboxDataInfo();

                        info.DisplayMember = cmtItem.cmt_cRemark;

                        info.ValueMember = cmtItem.cmt_cValue.ToString();

                        infoList.Add(info);
                    }
                }

            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #5
0
        void BindComboBox_ShiftTypeCode()
        {
            CodeMaster_cmt_Info searchInfo = new CodeMaster_cmt_Info();
            searchInfo.cmt_cKey1 = Common.DefineConstantValue.CodeMasterDefine.KEY1_TYPEVALUE;
            searchInfo.cmt_cKey2 = Common.DefineConstantValue.CodeMasterDefine.KEY2_SHIFTTYPE;

            List<IModelObject> listShiftTypeCode = this.m_codeMasterBLL.SearchRecords(searchInfo);
            if (listShiftTypeCode != null && listShiftTypeCode.Count > 0)
            {
                List<IModelObject> listInfo = new List<IModelObject>();
                foreach (CodeMaster_cmt_Info shiftTypeInfo in listShiftTypeCode)
                {
                    if (shiftTypeInfo != null)
                    {
                        ComboboxDataInfo cbbInfo = new ComboboxDataInfo();
                        cbbInfo.DisplayMember = shiftTypeInfo.cmt_cRemark;
                        cbbInfo.ValueMember = shiftTypeInfo.cmt_cValue;
                        listInfo.Add(cbbInfo);
                    }
                }

                this.cboShiftTypeName.SetDataSource(listInfo);
                this.cboShiftTypeName.SelectedIndex = -1;
            }
        }
Beispiel #6
0
 private List<Model.General.ComboboxDataInfo> GetWinFormSkin()
 {
     List<Model.General.ComboboxDataInfo> infoList = new List<Model.General.ComboboxDataInfo>();
     try
     {
         using (MainDBDataContext db = new MainDBDataContext())
         {
             IQueryable<CodeMaster_cmt> taQuery =
                 from t in db.CodeMaster_cmt
                 where t.cmt_cKey1 == DefineConstantValue.CodeMasterDefine.KEY1_WINFORM_SKIN
                 orderby t.cmt_iRecordID ascending
                 select t;
             if (taQuery.Count() > 0)
             {
                 foreach (CodeMaster_cmt t in taQuery)
                 {
                     Model.General.ComboboxDataInfo info = new Model.General.ComboboxDataInfo();
                     info.DisplayMember = t.cmt_cKey2;
                     info.ValueMember = t.cmt_cValue.ToString();
                     infoList.Add(info);
                 }
             }
         }
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
     return infoList;
 }
        private void initMachineStatus()
        {
            List<IModelObject> list = new List<IModelObject>();

            foreach (Common.DefineConstantValue.ConsumeMachineStatus usingType in Enum.GetValues(typeof(Common.DefineConstantValue.ConsumeMachineStatus)))
            {
                ComboboxDataInfo info = new ComboboxDataInfo();
                info.DisplayMember = DefineConstantValue.GetMacUsingDesc(usingType);
                info.ValueMember = usingType.ToString();
                list.Add(info);
            }

            this.cmbMachineStatus.SetDataSource(list);
            this.cmbMachineStatus.SelectedIndex = 0;
        }
Beispiel #8
0
        /// <summary>
        /// 獲得機臺類型 by SIMON
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetMachineType()
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    IEnumerable<CodeMaster_cmt> objKey = from t in db.CodeMaster_cmt
                                                         where t.cmt_cKey1 == Common.DefineConstantValue.CodeMasterDefine.KEY1_MACHINETYPE && t.cmt_cKey2 == Common.DefineConstantValue.CodeMasterDefine.KEY2_MACHINEMODEL
                                                         select t;

                    if (objKey != null && objKey.Count() > 0)
                    {
                        foreach (CodeMaster_cmt item in objKey)
                        {
                            ComboboxDataInfo info = new ComboboxDataInfo();

                            info.DisplayMember = item.cmt_cRemark;

                            info.ValueMember = item.cmt_cValue;

                            infoList.Add(info);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #9
0
        /// <summary>
        /// 獲取品檢問題解決問題內容
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetQCMasterSettlement()
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                IQualityProblemMasterDA da = SQLiteDAFacotry.GetDAL<IQualityProblemMasterDA>(SQLiteDAFacotry.QualityProblemMaster);

                QualityProblemMaster_qpm_Info qpmInfo = new QualityProblemMaster_qpm_Info() { qpm_lIsAtive = true }; ;
                Dictionary<string, object> dicParam = new Dictionary<string, object>();
                dicParam.Add("qpm_lIsAtive", qpmInfo.qpm_lIsAtive);
                List<QualityProblemMaster_qpm_Info> listQCMaster = da.GetEntities<QualityProblemMaster_qpm_Info>(dicParam).ToList();
                if (listQCMaster != null && listQCMaster.Count > 0)
                {
                    foreach (QualityProblemMaster_qpm_Info qcmItem in listQCMaster)
                    {
                        ComboboxDataInfo info = new ComboboxDataInfo();

                        info.DisplayMember = qcmItem.qpm_cSuggestedTechnique;

                        info.ValueMember = qcmItem.qpm_iRecordID.ToString();

                        infoList.Add(info);
                    }
                }

            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #10
0
        private List<ComboboxDataInfo> GetVacationWorkReason()
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                using (DBContext uow =new DBContext())
                {

                    IList<CodeMaster_cmt_Info> objAll = uow.CurrentSession.QueryOver<CodeMaster_cmt_Info>().And(d => d.cmt_cKey1 == Common.DefineConstantValue.CodeMasterDefine.KEY1_TYPEVALUE && d.cmt_cKey2 == Common.DefineConstantValue.CodeMasterDefine.KEY2_VACATIONWORKREASON).List();

                    if (objAll != null && objAll.Count > 0)
                    {
                        foreach (CodeMaster_cmt_Info item in objAll)
                        {
                            ComboboxDataInfo temp = new ComboboxDataInfo();

                            temp.DisplayMember = item.cmt_cRemark;

                            temp.ValueMember = item.cmt_cValue;

                            infoList.Add(temp);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #11
0
        /// <summary>
        /// 獲得工作組類型信息
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetWorkGroupTypeInfos()
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                IWorkGroupTypeMasterDA da = SQLiteDAFacotry.GetDAL<IWorkGroupTypeMasterDA>(SQLiteDAFacotry.WorkGroupTypeMaster);

                //WorkGroupTypeMaster_wgt_Info workTypeInfo = new WorkGroupTypeMaster_wgt_Info();
                Dictionary<string, object> dicParam = new Dictionary<string, object>();
                dicParam.Add("wgt_lIsAtive", true);
                List<WorkGroupTypeMaster_wgt_Info> listSource = da.GetEntities<WorkGroupTypeMaster_wgt_Info>(dicParam).ToList();
                if (listSource != null && listSource.Count > 0)
                {
                    foreach (WorkGroupTypeMaster_wgt_Info item in listSource)
                    {
                        ComboboxDataInfo info = new ComboboxDataInfo();

                        info.DisplayMember = item.wgt_cWGTName;

                        info.ValueMember = item.wgt_iRecordID.ToString();

                        infoList.Add(info);
                    }
                }

            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #12
0
        /// <summary>
        /// 獲得符合日期的班次內工程信息
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetShirtProjList(ProjectStopRecord_psrd_Info rrecordInfo)
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();
            try
            {
                using (DBContext uow = new DBContext())
                {
                    string strSQL = string.Empty;
                    strSQL += "select spl_RecordID as ValueMember,swl_cItemName as DisplayMember" + Environment.NewLine;
                    strSQL += "from ShiftProjList_spl" + Environment.NewLine;
                    strSQL += "left join PrintProject_ppj" + Environment.NewLine;
                    strSQL += "on spl_PPJID=ppj_RecordID" + Environment.NewLine;
                    strSQL += "left join ScheduleProjList_swl" + Environment.NewLine;
                    strSQL += "on ppj_SWLID=swl_RecordID" + Environment.NewLine;
                    strSQL += "where" + Environment.NewLine;
                    strSQL += "((spl_dBeginTime<='" + rrecordInfo.psrd_dBeginTime.Value.ToString("yyyy-MM-dd HH:mm") + "' and spl_dEndTime >='" + rrecordInfo.psrd_dBeginTime.Value.ToString("yyyy-MM-dd HH:mm") + "' )" + Environment.NewLine;
                    strSQL += "or" + Environment.NewLine;
                    strSQL += "(spl_dBeginTime<='" + rrecordInfo.psrd_dEndTime.Value.ToString("yyyy-MM-dd HH:mm") + "' and spl_dEndTime >='" + rrecordInfo.psrd_dEndTime.Value.ToString("yyyy-MM-dd HH:mm") + "' ))" + Environment.NewLine;

                    ISQLQuery query = uow.CurrentSession.CreateSQLQuery(strSQL.ToString());

                    var s = query.List();
                    if (s != null)
                    {
                        foreach (object[] objItem in s)
                        {
                            ComboboxDataInfo info = new ComboboxDataInfo();

                            info.DisplayMember = objItem[1].ToString();

                            info.ValueMember = objItem[0].ToString();

                            infoList.Add(info);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #13
0
        /// <summary>
        /// 獲取非機長員工信息
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetStaffMasterInfo(string strMacType)
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                IStaffInfoMasterDA da = SQLiteDAFacotry.GetDAL<IStaffInfoMasterDA>(SQLiteDAFacotry.StaffInfoMaster);

                StaffInfoMaster_sim_Info stsaffInfo = new StaffInfoMaster_sim_Info();
                Dictionary<string, object> dicParam = new Dictionary<string, object>();
                dicParam.Add("sim_lIsCaptain", false);
                dicParam.Add("sim_cMachineID", strMacType);
                List<StaffInfoMaster_sim_Info> listCaptainMaster = da.GetEntities<StaffInfoMaster_sim_Info>(dicParam).ToList();
                if (listCaptainMaster != null && listCaptainMaster.Count > 0)
                {
                    foreach (StaffInfoMaster_sim_Info captainItem in listCaptainMaster)
                    {
                        ComboboxDataInfo info = new ComboboxDataInfo();

                        info.DisplayMember = captainItem.sim_cStaffNo.Trim() + "-" + captainItem.sim_cStaffName.Trim();

                        info.ValueMember = captainItem.sim_iRecordID.ToString();

                        infoList.Add(info);
                    }
                }

            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #14
0
        /// <summary>
        /// 取得特定班次內工程信息
        /// </summary>
        /// <param name="shiftRecordID">班次ID</param>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetShiftProjList(string shiftRecordID)
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();
            string strSQL = string.Empty;
            strSQL += "select spl_RecordID as ValueMember,swl_cItemName as DisplayMember" + Environment.NewLine;
            strSQL += "from ShiftProjList_spl" + Environment.NewLine;
            strSQL += "left join PrintProject_ppj" + Environment.NewLine;
            strSQL += "on spl_PPJID=ppj_RecordID" + Environment.NewLine;
            strSQL += "left join ScheduleProjList_swl" + Environment.NewLine;
            strSQL += "on swl_RecordID=ppj_SWLID" + Environment.NewLine;
            strSQL += "where spl_SIFOID='" + shiftRecordID.ToString() + "'" + Environment.NewLine;
            try
            {
                using (DBContext uow =new DBContext())
                {
                    ISQLQuery query = uow.CurrentSession.CreateSQLQuery(strSQL);
                    var s = query.List();
                    if (s != null)
                    {
                        foreach (object[] objItem in s)
                        {
                            ComboboxDataInfo info = new ComboboxDataInfo();

                            if (objItem[1] != null)
                                info.DisplayMember = objItem[1].ToString();
                            else
                                info.DisplayMember = "";

                            info.ValueMember = objItem[0].ToString();

                            infoList.Add(info);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return infoList;
        }
Beispiel #15
0
        private List<ComboboxDataInfo> GetShiftMaster()
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            IList<ShiftTypeMaster_stm_Info> infos = null;
            try
            {
                using (DBContext db = new DBContext())
                {
                    infos = db.CurrentSession.QueryOver<ShiftTypeMaster_stm_Info>().And(d => d.stm_lIsAtive == true).List();
                    if (infos != null)
                    {
                        foreach (ShiftTypeMaster_stm_Info item in infos)
                        {
                            ComboboxDataInfo cbo = new ComboboxDataInfo(item.stm_cShiftName, item.stm_iRecordID.ToString());
                            infoList.Add(cbo);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return infoList;
        }
Beispiel #16
0
        /// <summary>
        /// 獲取品檢問題解決辦法
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetQCSettlement()
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                ICodeMasterDA da = SQLiteDAFacotry.GetDAL<ICodeMasterDA>(SQLiteDAFacotry.CodeMasterDA);
                CodeMaster_cmt_Info cmtInfo = new CodeMaster_cmt_Info();
                cmtInfo.cmt_cKey1 = Common.DefineConstantValue.CodeMasterDefine.KEY1_TYPEVALUE;
                cmtInfo.cmt_cKey2 = Common.DefineConstantValue.CodeMasterDefine.KEY2_TYPEVALUE_QCSETTLEMENT;
                Dictionary<string, object> dicParam = new Dictionary<string, object>();
                dicParam.Add("cmt_cKey1", cmtInfo.cmt_cKey1);
                dicParam.Add("cmt_cKey2", cmtInfo.cmt_cKey2);
                List<CodeMaster_cmt_Info> listCmt = da.GetEntities<CodeMaster_cmt_Info>(dicParam).ToList();
                if (listCmt != null && listCmt.Count > 0)
                {
                    foreach (CodeMaster_cmt_Info cmtItem in listCmt)
                    {
                        ComboboxDataInfo info = new ComboboxDataInfo();

                        info.DisplayMember = cmtItem.cmt_cRemark;

                        info.ValueMember = cmtItem.cmt_iRecordID.ToString();

                        infoList.Add(info);
                    }
                }

            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #17
0
 private List<Model.General.ComboboxDataInfo> GetCodeMaster(string key)
 {
     List<Model.General.ComboboxDataInfo> infoList = new List<Model.General.ComboboxDataInfo>();
     try
     {
         using (MainDBDataContext db = new MainDBDataContext())
         {
             IQueryable<CodeMaster_cmt> taQuery =
                 from t in db.CodeMaster_cmt
                 where t.cmt_cKey1 == key.ToString()
                 orderby t.cmt_cKey2 ascending
                 select t;
             if (taQuery.Count() > 0)
             {
                 foreach (CodeMaster_cmt t in taQuery)
                 {
                     Model.General.ComboboxDataInfo info = new Model.General.ComboboxDataInfo();
                     info.DisplayMember = t.cmt_cValue;
                     info.ValueMember = t.cmt_cKey2;
                     infoList.Add(info);
                 }
             }
         }
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
     return infoList;
 }
Beispiel #18
0
        private List<ComboboxDataInfo> GetShiftTypeMaster()
        {
            List<Model.General.ComboboxDataInfo> infoList = new List<Model.General.ComboboxDataInfo>();

            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    IQueryable<ShiftTypeMaster_stm> allType = from t in db.ShiftTypeMaster_stm
                                                              orderby t.stm_dAddDate ascending
                                                              select t;

                    if (allType != null && allType.Count() > 0)
                    {
                        foreach (ShiftTypeMaster_stm item in allType)
                        {
                            Model.General.ComboboxDataInfo info = new Model.General.ComboboxDataInfo();
                            info.DisplayMember = item.stm_cShiftName;
                            info.ValueMember = item.stm_iRecordID.ToString();
                            infoList.Add(info);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #19
0
 private List<Model.General.ComboboxDataInfo> GetCodeMaster_Key2(string CodeMaster_Key1)
 {
     List<Model.General.ComboboxDataInfo> infoList = new List<Model.General.ComboboxDataInfo>();
     try
     {
         using (MainDBDataContext db = new MainDBDataContext())
         {
             var taQuery =
                 (from t in db.CodeMaster_cmt
                  where t.cmt_cKey1 == CodeMaster_Key1
                  select new { name = t.cmt_cKey2 }).Distinct();
             if (taQuery.Count() > 0)
             {
                 foreach (var t in taQuery)
                 {
                     Model.General.ComboboxDataInfo info = new Model.General.ComboboxDataInfo();
                     info.DisplayMember = t.name;
                     info.ValueMember = t.name;
                     infoList.Add(info);
                 }
             }
         }
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
     return infoList;
 }
Beispiel #20
0
        /// <summary>
        /// SQLite 获取沒有停機原因的班次信息 by SIMON
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetShiftTypeMaster_NoStopReason()
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            string strSQL = string.Empty;
            strSQL += "SELECT " + Environment.NewLine;
            strSQL += " sifo_RecordID AS ValueMember , " + Environment.NewLine;
            strSQL += " date( sifo_dProdDate ) + ' ' + stm_cShiftName AS DisplayMember " + Environment.NewLine;
            strSQL += "FROM" + Environment.NewLine;
            strSQL += " ShiftInfo_sifo LEFT JOIN " + Environment.NewLine;
            strSQL += "ShiftTypeMaster_stm ON stm_iRecordID = sifo_iSTMID " + Environment.NewLine;
            strSQL += "WHERE" + Environment.NewLine;
            strSQL += "sifo_RecordID IN " + Environment.NewLine;
            strSQL += "( " + Environment.NewLine;
            strSQL += "SELECT " + Environment.NewLine;
            strSQL += " spl_SIFOID " + Environment.NewLine;
            strSQL += "FROM" + Environment.NewLine;
            strSQL += "ShiftProjList_spl " + Environment.NewLine;
            strSQL += "WHERE" + Environment.NewLine;
            strSQL += "spl_RecordID IN " + Environment.NewLine;
            strSQL += "(" + Environment.NewLine;
            strSQL += "SELECT" + Environment.NewLine;
            strSQL += "psrd_SPLID " + Environment.NewLine;
            strSQL += "FROM" + Environment.NewLine;
            strSQL += "ProjectStopRecord_psrd LEFT JOIN " + Environment.NewLine;
            strSQL += "ProjectStopReason_pjsr ON pjsr_PSRDID = psrd_RecordID" + Environment.NewLine;
            strSQL += "WHERE" + Environment.NewLine;

            strSQL += "(psrd_dBeginTime+7 )>=date() " + Environment.NewLine;
            strSQL += " ) " + Environment.NewLine;
            strSQL += " ) " + Environment.NewLine;

            try
            {

                using (DBContext uow =new DBContext())
                {
                    ISQLQuery query = uow.CurrentSession.CreateSQLQuery(strSQL);
                    ArrayList objs = (ArrayList)query.List();
                    foreach (Object[] obj in objs)
                    {

                        ComboboxDataInfo comb = new ComboboxDataInfo();
                        comb.ValueMember = obj[0].ToString();
                        comb.DisplayMember = obj[1].ToString();
                        infoList.Add(comb);
                    }
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }

            return infoList;
        }
Beispiel #21
0
        /// <summary>
        /// 获取打印机类型信息 by SIMON
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetPinterMachineType()
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    IQueryable<CodeMaster_cmt> PinterMachineTypeList = from t in db.CodeMaster_cmt
                                                                       where t.cmt_cKey1 == DefineConstantValue.CodeMasterDefine.KEY1_TYPEVALUE && t.cmt_cKey2 == DefineConstantValue.CodeMasterDefine.KEY2_TYPEVALUE_PRINTER
                                                                       select t;

                    if (PinterMachineTypeList.Count() > 0)
                    {
                        foreach (CodeMaster_cmt item in PinterMachineTypeList)
                        {
                            ComboboxDataInfo info = new ComboboxDataInfo();

                            info.DisplayMember = item.cmt_cRemark;

                            info.ValueMember = item.cmt_cValue;

                            infoList.Add(info);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #22
0
        /// <summary>
        /// 獲取維修要求--子結構
        /// </summary>
        /// <param name="strParentID"></param>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetMaintenanceSubStructKey(string strParentID)
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                using (DBContext uow =new DBContext())
                {
                    StringBuilder strSql = new StringBuilder();
                    strSql.AppendLine("select stt_cKey2,stt_cDesc from StructureMaster_stt ");
                    strSql.AppendLine("where  stt_cKey2 <> '00000000-0000-0000-0000-000000000000' ");
                    strSql.AppendLine("and  stt_cKey3 = '00000000-0000-0000-0000-000000000000' ");
                    strSql.AppendLine("and stt_cKey1 = '" + strParentID + "'");
                    ISQLQuery query = uow.CurrentSession.CreateSQLQuery(strSql.ToString());
                    IList listData = query.List();
                    if (listData != null)
                    {
                        foreach (object[] item in listData)
                        {
                            ComboboxDataInfo info = new ComboboxDataInfo();

                            info.DisplayMember = item[1].ToString();

                            info.ValueMember = item[0].ToString();

                            infoList.Add(info);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #23
0
        /// <summary>
        /// 获取班次信息 (最大行數) by SIMON
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetShiftTypeMaster(int maxLimit)
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    var ShiftInfo = (from t in db.ShiftInfo_sifo

                                     join b in db.ShiftTypeMaster_stm on t.sifo_iSTMID

                                     equals b.stm_iRecordID

                                     orderby t.sifo_dProdDate descending, b.stm_cBeginTime ascending

                                     select new { DisplayMember = (t.sifo_dProdDate != null ? t.sifo_dProdDate.Value.ToString("yyyy-MM-dd") : "") + b.stm_cShiftName, ValueMember = t.sifo_RecordID.ToString() }).Take(maxLimit);

                    if (ShiftInfo != null)
                    {
                        foreach (var item in ShiftInfo)
                        {
                            ComboboxDataInfo info = new ComboboxDataInfo();

                            info.DisplayMember = item.DisplayMember;

                            info.ValueMember = item.ValueMember;

                            infoList.Add(info);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #24
0
        private void initCardUseState()
        {
            List<IModelObject> list = new List<IModelObject>();

            ComboboxDataInfo cmbInfo1 = new ComboboxDataInfo();
            cmbInfo1.DisplayMember = "使用中";
            cmbInfo1.ValueMember = DefineConstantValue.CardUseState.InUse.ToString();

            list.Add(cmbInfo1);

            ComboboxDataInfo cmbInfo2 = new ComboboxDataInfo();
            cmbInfo2.DisplayMember = "未使用";
            cmbInfo2.ValueMember = DefineConstantValue.CardUseState.NotUsed.ToString();

            list.Add(cmbInfo2);

            ComboboxDataInfo cmbInfo = new ComboboxDataInfo();
            cmbInfo.DisplayMember = "全部";
            cmbInfo.ValueMember = "";

            list.Add(cmbInfo);

            this.cmbCardState.SetDataSource(list);
            this.cmbCardState.SelectedIndex = list.Count - 1;
        }
Beispiel #25
0
        /// <summary>
        /// 停机原因类型
        /// </summary>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetStopReasonType()
        {
            List<Model.General.ComboboxDataInfo> infoList = new List<Model.General.ComboboxDataInfo>();

            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    IEnumerable<CodeMaster_cmt> allInfo = from t in db.CodeMaster_cmt
                                                          where t.cmt_cKey1 == DefineConstantValue.CodeMasterDefine.KEY1_TYPEVALUE && t.cmt_cKey2 == DefineConstantValue.CodeMasterDefine.KEY2_STOPREASONTYPE
                                                          select t;

                    if (allInfo != null && allInfo.Count() > 0)
                    {
                        foreach (CodeMaster_cmt item in allInfo)
                        {
                            Model.General.ComboboxDataInfo info = new Model.General.ComboboxDataInfo();
                            info.DisplayMember = item.cmt_cRemark;
                            info.ValueMember = item.cmt_cValue;
                            infoList.Add(info);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }
Beispiel #26
0
        /// <summary>
        /// 初始部門下拉框
        /// </summary>
        private void initUserDepartment()
        {
            List<IModelObject> list = _igBM.GetMasterDataInformations(Common.DefineConstantValue.MasterType.UserDepartment);

            if (list == null)
            {
                list = new List<IModelObject>();
            }

            ComboboxDataInfo cmbInfo = new ComboboxDataInfo();
            cmbInfo.DisplayMember = "全部";
            cmbInfo.ValueMember = "";

            list.Add(cmbInfo);

            this.cmbUserDepartment.SetDataSource(list);
            this.cmbUserDepartment.SelectedIndex = list.Count() - 1;
        }
        private void initConsumeMachineType()
        {
            List<IModelObject> listValues = new List<IModelObject>();
            foreach (Common.DefineConstantValue.ConsumeMachineType item in Enum.GetValues(typeof(Common.DefineConstantValue.ConsumeMachineType)))
            {
                if (item != Common.DefineConstantValue.ConsumeMachineType.Unknown)
                {
                    ComboboxDataInfo value = new ComboboxDataInfo();
                    value.ValueMember = item.ToString();
                    value.DisplayMember = Common.DefineConstantValue.GetMacTypeDesc(item);
                    listValues.Add(value);
                }
            }

            cmbType.SetDataSource(listValues);
            cmbType.SelectedIndex = -1;
        }
        private void initMachineType()
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            foreach (Common.DefineConstantValue.ConsumeMachineType macType in Enum.GetValues(typeof(Common.DefineConstantValue.ConsumeMachineType)))
            {
                ComboboxDataInfo info = new ComboboxDataInfo();
                info.DisplayMember = DefineConstantValue.GetMacTypeDesc(macType);
                info.ValueMember = macType.ToString();
                infoList.Add(info);
            }

            ComboboxDataInfo infoTotal = new ComboboxDataInfo();
            infoTotal.DisplayMember = "全部";
            infoTotal.ValueMember = string.Empty;
            infoList.Add(infoTotal);

            this.cmbMachineType.DataSource = infoList;
            this.cmbMachineType.DisplayMember = "DisplayMember";
            this.cmbMachineType.ValueMember = "ValueMember";

            this.cmbMachineType.SelectedIndex = infoList.Count - 1;
        }
        /// <summary>
        /// 绑定消费机模式值
        /// </summary>
        void BindComboDeviceMode()
        {
            List<IModelObject> listValues = new List<IModelObject>();

            foreach (EnumDeviceMode item in Enum.GetValues(typeof(EnumDeviceMode)))
            {
                if (item != EnumDeviceMode.Unknown)
                {
                    ComboboxDataInfo value = new ComboboxDataInfo();
                    value.ValueMember = ((int)item).ToString();
                    value.DisplayMember = EumExchangeTool.GetEumModeName(item);
                    listValues.Add(value);
                }
            }

            cbxDeviceMode.SetDataSource(listValues);
            cbxDeviceMode.SelectedIndex = -1;
        }
Beispiel #30
0
        /// <summary>
        /// 獲取需要的班次信息(现为7天内)
        /// </summary>
        /// <param name="strMacNum">機台編號</param>
        /// <returns></returns>
        private List<ComboboxDataInfo> GetCurrentShiftInfo(string strMacNum)
        {
            List<ComboboxDataInfo> infoList = new List<ComboboxDataInfo>();

            try
            {
                IShiftInfoDA shiftInfoDA = SQLiteDAFacotry.GetDAL<IShiftInfoDA>(SQLiteDAFacotry.ShiftInfo);
                IShiftTypeMasterDA shiftMasterDA = SQLiteDAFacotry.GetDAL<IShiftTypeMasterDA>(SQLiteDAFacotry.ShiftTypeMaster);

                Dictionary<string, object> dicParam = new Dictionary<string, object>();
                List<ShiftInfo_sifo_Info> listShiftInfo = shiftInfoDA.GetEntities<ShiftInfo_sifo_Info>(dicParam).ToList();
                IList<ShiftTypeMaster_stm_Info> listShiftMaster = shiftMasterDA.GetEntities<ShiftTypeMaster_stm_Info>(dicParam);
                if (listShiftInfo != null)
                {
                    listShiftInfo = listShiftInfo.Where(x => x.sifo_dProdDate.Date <= DateTime.Now.Date && x.sifo_dProdDate >= DateTime.Now.Date.AddDays(-6) && x.sifo_cMachineNO == strMacNum).ToList();
                }

                if (listShiftInfo != null && listShiftInfo.Count > 0 && listShiftMaster != null && listShiftMaster.Count > 0)
                {
                    foreach (ShiftTypeMaster_stm_Info masterItem in listShiftMaster)
                    {
                        ShiftInfo_sifo_Info shiftInfo = listShiftInfo.Where(x => x.sifo_iSTMID == masterItem.stm_iRecordID).FirstOrDefault();
                        if (shiftInfo != null)
                        {
                            ComboboxDataInfo info = new ComboboxDataInfo();

                            info.DisplayMember = masterItem.stm_cShiftName + "【" + shiftInfo.sifo_dBeginTime.Value.ToString("yyyy/MM/dd HH:mm") + "-" + shiftInfo.sifo_dEndTime.Value.ToString("HH:mm") + "】";

                            info.ValueMember = shiftInfo.sifo_RecordID.ToString().ToUpper();

                            infoList.Add(info);
                        }
                        else
                        {
                            ComboboxDataInfo info = new ComboboxDataInfo();

                            info.DisplayMember = masterItem.stm_cShiftName + "【" + DateTime.Now.ToString("yyyy/MM/dd") + " " + masterItem.stm_cBeginTime + "-" + masterItem.stm_cEndTime + "】";

                            info.ValueMember = Guid.Empty.ToString();

                            infoList.Add(info);
                        }
                    }
                }

            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return infoList;
        }