Пример #1
0
        public R_PANEL_SN GetRow(DataRow DR)
        {
            Row_R_PANEL_SN Ret = (Row_R_PANEL_SN)NewRow();

            Ret.loadData(DR);
            return(Ret.GetDataObject());
        }
Пример #2
0
        public string AddSnToPanel(List <R_PANEL_SN> PanelSNs, string Bu, OleExec DB)
        {
            string         sql      = string.Empty;
            Row_R_PANEL_SN row      = null;
            string         result   = string.Empty;
            DateTime       DateTime = GetDBDateTime(DB);

            if (this.DBType == DB_TYPE_ENUM.Oracle)
            {
                foreach (R_PANEL_SN PanelSn  in PanelSNs)
                {
                    PanelSn.ID        = GetNewID(Bu, DB);
                    PanelSn.EDIT_TIME = DateTime;
                    row    = (Row_R_PANEL_SN)this.ConstructRow(PanelSn);
                    sql    = row.GetInsertString(this.DBType);
                    result = DB.ExecSQL(sql);
                }
                return(result);
            }
            else
            {
                string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() });
                throw new MESReturnMessage(errMsg);
            }
        }
Пример #3
0
        public R_PANEL_SN GetPanelBySn(string SerialNo, OleExec DB)
        {
            string         sql   = string.Empty;
            DataTable      dt    = new DataTable();
            Row_R_PANEL_SN row   = (Row_R_PANEL_SN)NewRow();
            R_PANEL_SN     Panel = null;

            if (this.DBType == DB_TYPE_ENUM.Oracle)
            {
                sql = $@"SELECT * FROM R_PANEL_SN WHERE SN='{SerialNo}'";
                dt  = DB.ExecSelect(sql).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    row.loadData(dt.Rows[0]);
                    Panel = row.GetDataObject();
                }
            }
            else
            {
                string errMsg = MESReturnMessage.GetMESReturnMessage("MES00000019", new string[] { DBType.ToString() });
                throw new MESReturnMessage(errMsg);
            }
            return(Panel);
        }