public int UpdateById(C_STORAGE_CODE NewStorageCode, OleExec DB) { Row_C_STORAGE_CODE NewStorageRow = (Row_C_STORAGE_CODE)NewRow(); NewStorageRow.ID = NewStorageCode.ID; NewStorageRow.PLANT = NewStorageCode.PLANT; NewStorageRow.STORAGE_CODE = NewStorageCode.STORAGE_CODE; NewStorageRow.DESCRIPTION = NewStorageCode.DESCRIPTION; NewStorageRow.EDIT_EMP = NewStorageCode.EDIT_EMP; NewStorageRow.EDIT_TIME = NewStorageCode.EDIT_TIME; int result = DB.ExecuteNonQuery(NewStorageRow.GetUpdateString(DBType, NewStorageCode.ID), CommandType.Text); return(result); }
public List <C_STORAGE_CODE> GetAll(OleExec DB) { string strSql = $@"select * from c_storage_code "; List <C_STORAGE_CODE> result = new List <C_STORAGE_CODE>(); DataTable res = DB.ExecuteDataTable(strSql, CommandType.Text); if (res.Rows.Count > 0) { for (int i = 0; i < res.Rows.Count; i++) { Row_C_STORAGE_CODE ret = (Row_C_STORAGE_CODE)NewRow(); ret.loadData(res.Rows[i]); result.Add(ret.GetDataObject()); } } return(result); }
public C_STORAGE_CODE GetById(string id, OleExec DB) { string strSql = $@"select * from c_storage_code where id=:id "; OleDbParameter[] paramet = new OleDbParameter[] { new OleDbParameter(":id", id) }; DataTable res = DB.ExecuteDataTable(strSql, CommandType.Text, paramet); if (res.Rows.Count > 0) { Row_C_STORAGE_CODE ret = (Row_C_STORAGE_CODE)NewRow(); ret.loadData(res.Rows[0]); return(ret.GetDataObject()); } else { return(null); } }
public List <C_STORAGE_CODE> GetByPlant(string strPlant, OleExec DB) { string strSql = $@"select * from c_storage_code where plant=:strPlant "; OleDbParameter[] paramet = new OleDbParameter[] { new OleDbParameter(":strPlant", strPlant) }; List <C_STORAGE_CODE> result = new List <C_STORAGE_CODE>(); DataTable res = DB.ExecuteDataTable(strSql, CommandType.Text, paramet); if (res.Rows.Count > 0) { for (int i = 0; i < res.Rows.Count; i++) { Row_C_STORAGE_CODE ret = (Row_C_STORAGE_CODE)NewRow(); ret.loadData(res.Rows[i]); result.Add(ret.GetDataObject()); } } return(result); }
public C_STORAGE_CODE GetByPlantAndStorageCode(string strPlant, string strStorageCode, OleExec DB) { string strSql = $@"select * from c_storage_code where plant=:strPlant and storage_code=:StorageCode "; OleDbParameter[] paramet = new OleDbParameter[] { new OleDbParameter(":strPlant", strPlant), new OleDbParameter(":StorageCode", strStorageCode) }; DataTable res = DB.ExecuteDataTable(strSql, CommandType.Text, paramet); if (res.Rows.Count > 0) { Row_C_STORAGE_CODE ret = (Row_C_STORAGE_CODE)NewRow(); ret.loadData(res.Rows[0]); return(ret.GetDataObject()); } else { return(null); } }