Example #1
0
        public R_MRB_GT GetDataObject()
        {
            R_MRB_GT DataObject = new R_MRB_GT();

            DataObject.ID               = this.ID;
            DataObject.WORKORDERNO      = this.WORKORDERNO;
            DataObject.SAP_STATION_CODE = this.SAP_STATION_CODE;
            DataObject.FROM_STORAGE     = this.FROM_STORAGE;
            DataObject.TO_STORAGE       = this.TO_STORAGE;
            DataObject.TOTAL_QTY        = this.TOTAL_QTY;
            DataObject.CONFIRMED_FLAG   = this.CONFIRMED_FLAG;
            DataObject.ZCPP_FLAG        = this.ZCPP_FLAG;
            DataObject.SAP_FLAG         = this.SAP_FLAG;
            DataObject.SKUNO            = this.SKUNO;
            DataObject.SAP_MESSAGE      = this.SAP_MESSAGE;
            DataObject.EDIT_EMP         = this.EDIT_EMP;
            DataObject.EDIT_TIME        = this.EDIT_TIME;
            return(DataObject);
        }
Example #2
0
        /// <summary>
        /// 通過from_Storage查詢sap_flag=0的記錄
        /// </summary>
        /// <param name="strWo">工單號</param>
        /// <param name="DB"></param>
        /// <returns></returns>
        public R_MRB_GT GetByFromStorageAndSAPFlageIsZero(string fromStorage, OleExec DB)
        {
            string strSql = $@" select * from r_mrb_gt where from_storage=:wono and sap_flag='0'";

            OleDbParameter[] paramet = new OleDbParameter[1];
            paramet[0] = new OleDbParameter(":wono", fromStorage);
            DataTable table  = DB.ExecuteDataTable(strSql, CommandType.Text, paramet);
            R_MRB_GT  result = new R_MRB_GT();

            if (table.Rows.Count > 0)
            {
                Row_R_MRB_GT ret = (Row_R_MRB_GT)NewRow();
                ret.loadData(table.Rows[0]);
                result = ret.GetDataObject();
            }
            else
            {
                result = null;
            }
            return(result);
        }
Example #3
0
        public int Add(R_MRB_GT newMRBGT, OleExec DB)
        {
            string strSql = $@"insert into r_mrb_gt(id,workorderno,sap_station_code,from_storage,to_storage,total_qty,confirmed_flag,zcpp_flag,sap_flag,skuno,sap_message,edit_emp,edit_time)";

            strSql = strSql + $@"values(:id,:workorderno,:sap_station_code,:from_storage,:to_storage,:total_qty,:confirmed_flag,:zcpp_flag,:sap_flag,:skuno,:sap_message,:edit_emp,sysdate)";
            OleDbParameter[] paramet = new OleDbParameter[]
            {
                new OleDbParameter(":id", newMRBGT.ID),
                new OleDbParameter(":workorderno", newMRBGT.WORKORDERNO),
                new OleDbParameter(":sap_station_code", newMRBGT.SAP_STATION_CODE),
                new OleDbParameter(":from_storage", newMRBGT.FROM_STORAGE),
                new OleDbParameter(":to_storage", newMRBGT.TO_STORAGE),
                new OleDbParameter(":total_qty", newMRBGT.TOTAL_QTY),
                new OleDbParameter(":confirmed_flag", newMRBGT.CONFIRMED_FLAG),
                new OleDbParameter(":zcpp_flag", newMRBGT.ZCPP_FLAG),
                new OleDbParameter(":sap_flag", newMRBGT.SAP_FLAG),
                new OleDbParameter(":skuno", newMRBGT.SKUNO),
                new OleDbParameter(":sap_message", newMRBGT.SAP_MESSAGE),
                new OleDbParameter(":edit_emp", newMRBGT.EDIT_EMP)
            };
            int result = DB.ExecuteNonQuery(strSql, CommandType.Text, paramet);

            return(result);
        }