예제 #1
0
        /// <summary>
        /// 檢查工程更多資料數據是否完整
        /// </summary>
        /// <param name="departmentCode">機台所屬科組編號</param>
        /// <param name="projectAdditional">工程更多資料數據對象</param>
        /// <returns></returns>
        public override ReturnValueInfo CheckProjectAdditionalDataFull(string departmentCode,ProjectAdditionalInformation projectAdditional)
        {
            // 檢查工程更多資料數據是否完整

            try
            {
                ReturnValueInfo result = new ReturnValueInfo();

                //if (projectAdditional == null)
                //{
                //    return result;
                //}

                bool isFull = true;
                //ProjectAdditionalInformation paiInfo = projectAdditional;

                //if (paiInfo.pai_iFrontProcessDefectiveQty < 0)
                //{
                //    isFull = false;
                //}

                //if (paiInfo.pai_iFrontProcessWasteQty < 0)
                //{
                //    isFull = false;
                //}

                //if (paiInfo.pai_iRevolution < 1)
                //{
                //    isFull = false;
                //}

                if (departmentCode.Trim() == CustEnum.Department.HBIM.ToString().Trim())
                {

                }

                result.boolValue = isFull;

                return result;
            }
            catch (Exception ex) { throw ex; }
        }
예제 #2
0
        /// <summary>
        /// 新增生產工程更多資料
        /// </summary>
        /// <param name="model">model</param>
        /// <param name="tran">SqlTransaction</param>
        /// <returns></returns>
        public bool AddProjectAdditionalInformation(ProjectAdditionalInformation model, SqlTransaction tran)
        {
            try
            {
                MappingHelper.HandleNullProperty(model);

                StringBuilder strSql = new StringBuilder();
                strSql.Append("insert into ProjectAdditionalInformation_pai(");
                strSql.Append("pai_PPJRecordID,pai_iFrontProcessDefectiveQty,pai_iFrontProcessWasteQty)");
                strSql.Append(" values (");
                strSql.Append("@pai_PPJRecordID,@pai_iFrontProcessDefectiveQty,@pai_iFrontProcessWasteQty)");
                SqlParameter[] parameters = {
                    DbHelperSQL.MakeInParam("@pai_PPJRecordID", SqlDbType.UniqueIdentifier,16, model.pai_PPJRecordID),
                    DbHelperSQL.MakeInParam("@pai_iFrontProcessDefectiveQty", SqlDbType.Int,4, model.pai_iFrontProcessDefectiveQty),
                    DbHelperSQL.MakeInParam("@pai_iFrontProcessWasteQty", SqlDbType.Int,4, model.pai_iFrontProcessWasteQty)};

                DbHelperSQL.ExecuteNonQuery(tran, CommandType.Text, strSql.ToString(), parameters);

                return true;
            }
            catch (Exception ex) { throw ex; }
        }
 /// <summary>
 /// 檢查工程更多資料數據是否完整
 /// </summary>
 /// <param name="departmentCode">機台所屬科組編號</param>
 /// <param name="projectAdditional">工程更多資料數據對象</param>
 /// <returns></returns>
 public abstract ReturnValueInfo CheckProjectAdditionalDataFull(string departmentCode, ProjectAdditionalInformation projectAdditional);
        //------------------->>>Begin Temp Remark By DonaldHuang 20150807
        /* *
         *
        void VirtualMachine_ProductionQtyEvent(object sender, EventBaseInfo<PLCEventArgs> e)
        {
            if (e != null)
            {
                this.MachineEquipment_OnPLCEvent(e.ObjectInformation);
            }
        }

        void VirtualMachine_ExceptionEvent(object sender, EventArgs e)
        {
            this.MachineEquipment_OnErrorPLCEvent(null);
        }

        void VirtualMachine_StopSignalEvent(object sender, EventArgs e)
        {
            this.MachineEquipment_OnStopPLCEvent(null);
        }
         *
         * */
        //-------------------<<<End Temp Remark By DonaldHuang 20150807
        /// <summary>
        /// 檢查工程更多資料數據是否完整
        /// </summary>
        /// <returns></returns>
        ReturnValueInfo IsSaveProjectAdditionalInformation(ProjectAdditionalInformation paiInfo)
        {
            ReturnValueInfo result = null;

            if (paiInfo == null)
            {
                return result;
            }

            result = new ReturnValueInfo();

            result.boolValue = true;

            return result;
        }
        /// <summary>
        /// 設置工程更多資料信息記錄
        /// </summary>
        /// <param name="newInfo">記錄新數據</param>
        public override ReturnValueInfo SaveProjectAdditionalInformation(ProjectAdditionalInformation newInfo)
        {
            ReturnValueInfo result = null;

            if (newInfo == null)
            {
                return result;
            }

            result = this.IsSaveProjectAdditionalInformation(newInfo);

            if (result == null)
            {
                return null;
            }

            if (result.boolValue)
            {
                ProjectAdditionalInformation paiInfo = this.ProductionData.ProjectMProductionData.AdditionalInformation;

                paiInfo.pai_iFrontProcessDefectiveQty = newInfo.pai_iFrontProcessDefectiveQty;
                paiInfo.pai_iFrontProcessWasteQty = newInfo.pai_iFrontProcessWasteQty;

                this.OnProductionChanged(null);

                result = this.IsProjectAdditionalInformationFull();

                if (result != null)
                {
                    this.OnProjectProductionDataFull(CommonDefine.ProjectDataType.ProjectAdditionalInformation, result.boolValue);
                }
            }

            return result;
        }
예제 #6
0
        private ProjectAdditionalInformation GetRecordData()
        {
            ProjectAdditionalInformation paiInfo = new ProjectAdditionalInformation();

            paiInfo.pai_iFrontProcessDefectiveQty = txtFrontProcessDefectiveQty.Value;
            paiInfo.pai_iFrontProcessWasteQty = txtFrontProcessWasteQty.Value;

            return paiInfo;
        }